-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Coordinator.heartbeat also cleans up exhausted shards #17
This isn't a bug fix, just an optimization. Previously, if an active shard without a sequence_number became exhausted, heartbeat() would still try to get records out of it. Because Shard.__next__ returns immediately when self.exhausted, this wasn't an issue. The shard wouldn't be removed from active on future heartbeats. It would be removed from the active list and its children would be promoted on the next Coordinator.next when the buffer is empty. Now, exhausted active shards will be cleaned up as part of a heartbeat. This means shards in the active list will never be exhausted[0]. In the future, that distinction could be relevant, or the assumption made that exhausted shards aren't part of the active list. [0] Won't be exhausted locally. The actual ShardIterator may be the last for the Shard, but that isn't known yet.
- Loading branch information
1 parent
220d8e3
commit 812c0ed
Showing
3 changed files
with
32 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters