reconciler

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2021 License: AGPL-3.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EtcdNeedCompensatePrefix = "/devops/pipeline/compensate/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PipelineSvcFunc

type PipelineSvcFunc struct {
	CronNotExecuteCompensate func(id uint64) error
}

该结构体为了解决假如 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) ListenGC

func (r *Reconciler) ListenGC()

ListenGC 监听需要 GC 的 pipeline.

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

func (*Reconciler) WaitDBGC

func (r *Reconciler) WaitDBGC(pipelineID uint64, ttl uint64, needArchive bool)

Directories

Path Synopsis
queuemanage

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL