Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We had a complicated mechanism to keep track of which transactions have been concluded, and which Raft proposals corresponded to those transactions. This required us to have a txnMark watermark, which kept track of all applied mutations and their Raft indices, which is quite confusing.
Instead, now we just make use of the StartTs stored in proposal.Mutations and the fact that we have a Oracle which already knows the status of transactions. I make use of those givens to remove txnMarks and simplify how we do snapshots.
Further more, I now propose snapshot indices so that the entire Raft group is synchronized on the same snapshot index, calculated by the leader. This also makes it clear that only leader does the snapshot calculation, and the corresponding action of aborting old transactions, with no health signal for some time.
Also, rename MaxPending to MaxAssigned, which is a better term for what the variable holds, i.e. MaxAssigned timestamp by Zero so far.
This change is