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

gc: use separate latch for range tombstone operations #86551

Closed
aliher1911 opened this issue Aug 22, 2022 · 1 comment · Fixed by #86608
Closed

gc: use separate latch for range tombstone operations #86551

aliher1911 opened this issue Aug 22, 2022 · 1 comment · Fixed by #86608
Assignees
Labels
A-kv-replication Relating to Raft, consensus, and coordination. C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)

Comments

@aliher1911
Copy link
Contributor

aliher1911 commented Aug 22, 2022

Range tombstone GC requests require obtaining write latches on the range to prevent any other range tombstone operations from interfering with stats calculations in case of range splits or merges in underlying pebble.
This is done by obtaining write latches on future timestamp that allows all the reads to go through, but hold all writes within the range.

This is not very good for potential writers. That could be the case where range had cancelled import that had data written on top of that operation.

To address the problem we may have a separate write latch to serialize range tombstone write operations while only keeping read latches for the actual ranges if they are not modified. With such approach slower consistency checks could still be performed by GC requests without affecting foreground traffic.

All write operations on range tombstones would acquire read latch on this key and any latches that they require for consistency, while GC operation will obtain write latch on this key only. That behaviour will let reader and writers on current timestamp to proceed, while preventing any range key boundaries change.

Jira issue: CRDB-18813

Epic CRDB-2624

@aliher1911 aliher1911 added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) A-kv-replication Relating to Raft, consensus, and coordination. labels Aug 22, 2022
@aliher1911 aliher1911 self-assigned this Aug 22, 2022
@blathers-crl
Copy link

blathers-crl bot commented Aug 22, 2022

cc @cockroachdb/replication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-kv-replication Relating to Raft, consensus, and coordination. C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant