Reduce log noise from found shards in worker event loop (#66)

Signed-off-by: Kev Burns <kevburnsjr@gmail.com>
This commit is contained in:
Kevin Burns 2020-01-22 03:26:22 -08:00 committed by Tao Jiang
parent f1935bc0ff
commit 8f0d7bc8d8

View file

@ -238,6 +238,7 @@ func (w *Worker) newShardConsumer(shard *par.ShardStatus) *ShardConsumer {
func (w *Worker) eventLoop() {
log := w.kclConfig.Logger
var foundShards int
for {
// Add [-50%, +50%] random jitter to ShardSyncIntervalMillis. When multiple workers
// starts at the same time, this decreases the probability of them calling
@ -252,7 +253,10 @@ func (w *Worker) eventLoop() {
continue
}
log.Infof("Found %d shards", len(w.shardStatus))
if foundShards == 0 || foundShards != len(w.shardStatus) {
foundShards = len(w.shardStatus)
log.Infof("Found %d shards", foundShards)
}
// Count the number of leases hold by this worker excluding the processed shard
counter := 0