Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
db: remove compactionIter's sameStripeNonSkippable
This commit removes the compaction iterator's concept of a key that lies within the same snapshot stripe but is non-skippable. These "non-skippable" keys lead to bizarre behavior, such as a sequence like: a.MERGE.5 a.RANGEDEL.4 a.MERGE.4 yielding the separate unmerged a.MERGE.5 and a.MERGE.4 internal keys (Note a.RANGEDEL.4 does not delete a.MERGE.4 because they share the same sequence number.) The sameStripeNonSkippable fell out of the fact that range deletions were previously interleaved by the input iterator at their start key with their sequence number. These sameStripeNonSkippable could interrupt any logic iterating across the keys of a stripe, complicating the compaction iterator logic. With cockroachdb#3219, range deletions began to be interleaved at their start key with the maximal sequence number, ensuring they never interrupt the keys of a snapshot stripe. In some instances INVALID keys were also returned with sameStripeNonSkippable. These keys are now treated similarly to other errors encountered during iteration: i.err is set and newStripeNewKey is returned. Close cockroachdb#3082.
- Loading branch information