Skip to content
This repository was archived by the owner on Dec 13, 2023. It is now read-only.
This repository was archived by the owner on Dec 13, 2023. It is now read-only.

【提问】pv_controller中的resync协程是什么作用?为什么这么设计? #73

Open
@WxySupn

Description

@WxySupn

问题描述

kube-controller中的pv_controller有三个协程:

  • resync:定期使用List方法,同步所有pvc到claimQueue,同步所有pv到volumeQueue;
  • volumeWorker:处理volumeQueue中的PV对象;
  • claimWorker:处理claimQueue中的PVC对象。

1)使用resync定期同步pvc和pv的必要性是什么?为什么这么设计?

2)在volumeWorker和claimWorker中,处理PV和PVC是异步的。因此,一些PV对象的处理失败,可能是对应PVC处理未完成导致的。所以,PV在处理失败的obj时,并未直接将其重新Add进volumeWorker队列,而是等待resync协程将其重新放入队列。此时,使用queue.AddRateLimited()这类方法,是不是也可以达到响应的目的?resync协程是否还有其他的作用?

环境信息

相关代码

pkg/controller/volume/persistentvolume

备注

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions