Documentation ¶
Index ¶
- Constants
- type PipelineSvcFunc
- type Reconciler
- func (r *Reconciler) Add(pipelineID uint64)
- func (r *Reconciler) CompensateGCNamespaces()
- func (r *Reconciler) ContinueBackupThrottler()
- func (r *Reconciler) DoDBGC(pipelineID uint64, gcOption apistructs.PipelineGCDBOption) error
- func (r *Reconciler) EnsureDatabaseGC()
- func (r *Reconciler) Listen()
- func (r *Reconciler) ListenDatabaseGC()
- func (r *Reconciler) ListenGC()
- func (r *Reconciler) PipelineDatabaseGC()
- func (r *Reconciler) WaitDBGC(pipelineID uint64, ttl uint64, needArchive bool)
Constants ¶
const (
EtcdNeedCompensatePrefix = "/devops/pipeline/compensate/"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PipelineSvcFunc ¶
该结构体为了解决假如 Reconciler 引入 pipelinesvc 导致循环依赖问题,所以将 svc 方法挂载进来
type Reconciler ¶
type Reconciler struct { QueueManager types.QueueManager TaskThrottler throttler.Throttler // contains filtered or unexported fields }
func New ¶
func New(js jsonstore.JsonStore, etcd *etcd.Store, bdl *bundle.Bundle, dbClient *dbclient.Client, actionAgentSvc *actionagentsvc.ActionAgentSvc, extMarketSvc *extmarketsvc.ExtMarketSvc, pipelineSvcFunc *PipelineSvcFunc, ) (*Reconciler, error)
New generate a new reconciler.
func (*Reconciler) Add ¶
func (r *Reconciler) Add(pipelineID uint64)
Add add pipelineID to reconciler, until add success
func (*Reconciler) CompensateGCNamespaces ¶ added in v1.1.0
func (r *Reconciler) CompensateGCNamespaces()
sometimes the pipeline is in downtime or restart time then the etcd lease of gc may expire at this time and then there is no instance get lease, which results in some namespaces pod not being gc
func (*Reconciler) ContinueBackupThrottler ¶
func (r *Reconciler) ContinueBackupThrottler()
ContinueBackupThrottler 持续备份 throttler
func (*Reconciler) DoDBGC ¶ added in v1.1.0
func (r *Reconciler) DoDBGC(pipelineID uint64, gcOption apistructs.PipelineGCDBOption) error
func (*Reconciler) EnsureDatabaseGC ¶
func (r *Reconciler) EnsureDatabaseGC()
EnsureDatabaseGC etcd lease ttl reset 存在问题,因此要定期巡检,主动 delete 那些已经到了 gcAt 时间仍然存在的 etcd key 来触发 dbgc github issue: https://github.com/etcd-io/etcd/issues/9395
func (*Reconciler) Listen ¶
func (r *Reconciler) Listen()
Listen watch incoming pipelines which need to be scheduled from etcd.
func (*Reconciler) ListenDatabaseGC ¶
func (r *Reconciler) ListenDatabaseGC()
ListenDatabaseGC 监听需要 GC 的 pipeline database record.
func (*Reconciler) PipelineDatabaseGC ¶ added in v1.1.0
func (r *Reconciler) PipelineDatabaseGC()
remove ListenDatabaseGC and EnsureDatabaseGC these two methods, these two methods will create a lot of etcd ttl, will cause high load on etcd use fixed gc time, traverse the data in the database every day