Repository navigation
[aggregator] Followers CanLead before the first flush is persisted - #4169
Conversation
| zap.Error(err), | ||
| ) | ||
| } else if flushTimes == nil || len(flushTimes.ByShard) == 0 { | ||
| // If there are no flush times, the cluster is just coming up (the leader has not |
There was a problem hiding this comment.
Sanity: I think this probably makes sense for the new topology case. What about the "nodes just added to the topology case"? Those two nodes will have a new shardset; do we need to ensure that the follower is up at least as long as the leader?
There was a problem hiding this comment.
Hmm probably cutover/cutoff times handle that, actually; worth reasoning through imo (though it probably just works).
There was a problem hiding this comment.
Good point. The function used to set the cutover for a shard is here, which happens when we try to generate a placement for instance adds. The function essentially sets the cutover as the next (max) window in the future. When nodes are added, even if the follower comes up later than the leader, the cutover time will prevent it from flushing until that time is passed.
I think this makes this diff still work. Concerns?
| "go.uber.org/zap" | ||
| ) | ||
|
|
||
| //nolint:dupl |
There was a problem hiding this comment.
Anything we can do to dedupe some of this? Perhaps a common setup method? (setup here is pretty long).
There was a problem hiding this comment.
Nice, much cleaner. Get rid of the nolint:dupl directive? (assuming linter passes now).
| @@ -241,6 +241,20 @@ func (mgr *followerFlushManager) CanLead() bool { | |||
| mgr.metrics.notCampaigning.Inc(1) | |||
There was a problem hiding this comment.
@justinjc for my understanding: we're not campaigning if we're not cutover right?
b57e193 to
a7eefec
Compare
| func newTestServerSetups( | ||
| t *testing.T, | ||
| customServerOpts ...func(testServerOptions) testServerOptions, | ||
| ) (testServerSetups, *testClock, topic.Service) { |
There was a problem hiding this comment.
Prefer structs for this--multi returns get real unwieldy quickly.
…3db#4169) * Have follower report CanLead if there are no flush times * Refactor out common integration test multiServerSetup
Fixes #4168