mirror of
https://github.com/Icinga/icingadb.git
synced 2026-05-28 04:35:54 -04:00
Channels and WaitGroups should be overwritten on HA overtake
This commit is contained in:
parent
9bd28ac325
commit
dd9b22ab34
1 changed files with 21 additions and 10 deletions
|
|
@ -36,15 +36,15 @@ func Operator(super *supervisor.Supervisor, chHA chan int, ctx *Context) error {
|
|||
|
||||
var (
|
||||
done chan struct{}
|
||||
chInsert = make(chan []string)
|
||||
chInsertBack = make(chan []configobject.Row)
|
||||
chDelete = make(chan []string)
|
||||
chUpdateComp = make(chan []string)
|
||||
chUpdate = make(chan []string)
|
||||
chUpdateBack = make(chan []configobject.Row)
|
||||
wgInsert = &sync.WaitGroup{}
|
||||
wgDelete = &sync.WaitGroup{}
|
||||
wgUpdate = &sync.WaitGroup{}
|
||||
chInsert chan []string
|
||||
chInsertBack chan []configobject.Row
|
||||
chDelete chan []string
|
||||
chUpdateComp chan []string
|
||||
chUpdate chan []string
|
||||
chUpdateBack chan []configobject.Row
|
||||
wgInsert *sync.WaitGroup
|
||||
wgDelete *sync.WaitGroup
|
||||
wgUpdate *sync.WaitGroup
|
||||
)
|
||||
for msg := range chHA {
|
||||
switch msg {
|
||||
|
|
@ -58,8 +58,19 @@ func Operator(super *supervisor.Supervisor, chHA chan int, ctx *Context) error {
|
|||
|
||||
//TODO: This should only be done, if HA was taken over from another instance
|
||||
insert, update, delete = GetDelta(super, ctx)
|
||||
log.Infof("%s - Delta: (Insert: %d, Maybe Update: %d, Delete: %d)", ctx.ObjectType, len(insert), len(update), len(delete))
|
||||
|
||||
done = make(chan struct{})
|
||||
chInsert = make(chan []string)
|
||||
chInsertBack = make(chan []configobject.Row)
|
||||
chDelete = make(chan []string)
|
||||
chUpdateComp = make(chan []string)
|
||||
chUpdate = make(chan []string)
|
||||
chUpdateBack = make(chan []configobject.Row)
|
||||
wgInsert = &sync.WaitGroup{}
|
||||
wgDelete = &sync.WaitGroup{}
|
||||
wgUpdate = &sync.WaitGroup{}
|
||||
|
||||
done = make(chan struct{})
|
||||
updateCounter := new(uint32)
|
||||
|
||||
go InsertPrepWorker(super, ctx, done, chInsert, chInsertBack)
|
||||
|
|
|
|||
Loading…
Reference in a new issue