Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix range deletion tombstone ingestion with global seqno #43

Conversation

jeffrey-xiao
Copy link

@jeffrey-xiao jeffrey-xiao commented Aug 14, 2019

If we are writing a global seqno for an ingested file, the range tombstone meta-block gets accessed and put in the block cache during ingestion preparation. At the time, the global seqno has not been
determined so the cached block does not have a global seqno. When the file's ingested and we read its range tombstone meta-block, it will be returned from the cache with no global seqno. In that case, we use the actual seqnos stored in the range tombstones, which are all zero, so the
tombstones cover nothing.

This commit adds a flag to disable filling the cache when the range tombstone meta-block is accessed for the first time and adds a regression test for the bug.


This change is Reviewable

If we are writing a global seqno for an ingested file, the range
tombstone meta-block gets accessed and put in the block cache during
ingestion preparation. At the time, the global seqno has not been
determined so the cached block does not have a global seqno. When the
file's ingested and we read its range tombstone meta-block, it will be
returned from the cache with no global seqno. In that case, we use the
actual seqnos stored in the range tombstones, which are all zero, so the
tombstones cover nothing.

This commit adds a flag to disable filling the cache when the range
tombstone meta-block is accessed for the first time and adds a
regression test for the bug.
@jeffrey-xiao
Copy link
Author

With this change, TestStoreRangeMergeRaftSnapshot passes with an on disk RocksDB engine and bank/cluster-recovery passes 150 times.

Copy link
Member

@nvanbenschoten nvanbenschoten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but @ajkr should weigh in on this.

@petermattis
Copy link

See cockroachdb/cockroach#39604 (comment) which suggests another approach which may fix a related bug. (I'm not sure that related bug exists).

Copy link

@ajkr ajkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 17 of 17 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@jeffrey-xiao jeffrey-xiao merged commit 56b3b8f into crl-release-6.2.1 Aug 15, 2019
jeffrey-xiao added a commit to jeffrey-xiao/cockroach that referenced this pull request Aug 15, 2019
craig bot pushed a commit to cockroachdb/cockroach that referenced this pull request Aug 15, 2019
39689: storage: reintroduce building SSTs from KV_BATCH snapshot r=jeffrey-xiao a=jeffrey-xiao

The final commit of #38932 was previously reverted to due an underlying bug in RocksDB with ingesting range deletion tombstones with a global seqno. See #39604 for discussion on the bug and cockroachdb/rocksdb#43 for the temporary short-term resolution of the bug.

Release note: None


Co-authored-by: Jeffrey Xiao <jeffrey.xiao1998@gmail.com>
@jeffrey-xiao jeffrey-xiao deleted the jeffreyxiao/fix-range-deletion-tombstone-global-seqno-caching branch August 15, 2019 17:46
jeffrey-xiao added a commit to jeffrey-xiao/cockroach that referenced this pull request Aug 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants