From 7b9181a92a09084765cecde1ba9015e4f5882a67 Mon Sep 17 00:00:00 2001 From: Yiyang Song Date: Thu, 17 Dec 2015 15:55:17 -0500 Subject: [PATCH] Fixes issue when worker not running, burrow not getting new state MTime in zookeeper will only get updating when being committed or new message pushed, however, burrow has a short-interval check for current and previous timestamp, this will prevent the next checking interval to complete if partition MTime not changed. This fix is basically to tell burrow checks anyway if two adjacent timestamp is the same. --- offsets_store.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/offsets_store.go b/offsets_store.go index 9998b793..0ec5ee63 100644 --- a/offsets_store.go +++ b/offsets_store.go @@ -274,7 +274,7 @@ func (storage *OffsetStorage) addConsumerOffset(offset *PartitionOffset) { } else { // Prevent old offset commits, and new commits that are too fast (less than the min-distance config) previousTimestamp := storage.offsets[offset.Cluster].consumer[offset.Group][offset.Topic][offset.Partition].Prev().Value.(*ConsumerOffset).Timestamp - if offset.Timestamp-previousTimestamp < (storage.app.Config.Lagcheck.MinDistance * 1000) { + if offset.Timestamp-previousTimestamp < (storage.app.Config.Lagcheck.MinDistance * 1000) && offset.Timestamp-previousTimestamp != 0{ storage.offsets[offset.Cluster].consumerLock.Unlock() return }