-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rac2,tracker: use CircularBuffer for tracker.Inflights
The custom circular/ring buffer implementation in Raft's tracker.Inflights does not shrink and unnecessarily grows to the maximum configured size (unless the buffer becomes empty). With RAC2, the maximum size is no longer a maximum, in lazy replication mode. There was a bug in incorrectly trying to impose this maximum, which motivated this slightly bigger cleanup. In general, it is beneficial for the inflight buffer to also shrink, and by using the existing CircularBuffer, we can simplify the code in tracker.Inflights. As part of this change rac2.CircularBuffer is moved to util/container/ring and becomes ring.Buffer. There is another ring.Buffer in util/ring, which doesn't shrink and is not optimized to use bit arithmetic -- there is a todo added there to replace it with the implementation in util/container/ring. Fixes #135223 Epic: none Release note: None
- Loading branch information
1 parent
89df825
commit e5dca03
Showing
13 changed files
with
125 additions
and
161 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
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
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
Oops, something went wrong.