Merge 66fdfbb817 into f6e79f1a2d
This commit is contained in:
commit
cd42b85c6d
1 changed files with 58 additions and 56 deletions
|
|
@ -304,9 +304,11 @@ func (w *Worker) eventLoop() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// max number of lease has not been reached yet
|
|
||||||
if counter < w.kclConfig.MaxLeasesForWorker {
|
|
||||||
for _, shard := range w.shardStatus {
|
for _, shard := range w.shardStatus {
|
||||||
|
// max number of lease has not been reached yet
|
||||||
|
if counter >= w.kclConfig.MaxLeasesForWorker {
|
||||||
|
break
|
||||||
|
}
|
||||||
// already owner of the shard
|
// already owner of the shard
|
||||||
if shard.GetLeaseOwner() == w.workerID {
|
if shard.GetLeaseOwner() == w.workerID {
|
||||||
continue
|
continue
|
||||||
|
|
@ -364,9 +366,9 @@ func (w *Worker) eventLoop() {
|
||||||
log.Errorf("Error in getRecords: %+v", err)
|
log.Errorf("Error in getRecords: %+v", err)
|
||||||
}
|
}
|
||||||
}(shard)
|
}(shard)
|
||||||
// exit from for loop and not to grab more shard for now.
|
|
||||||
break
|
// Increase the number of leases we have
|
||||||
}
|
counter++
|
||||||
}
|
}
|
||||||
|
|
||||||
if w.kclConfig.EnableLeaseStealing {
|
if w.kclConfig.EnableLeaseStealing {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue