server: commit compaction deletes after unlocking batch tx#21982
Conversation
|
Hi @xigang. Thanks for your PR. I'm waiting for a etcd-io member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: xigang The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Why deferring the commit is safe for compaction deletes The commit during Compaction deletes are different. They remove historical revisions at or below
The final batch also calls Microbenchmark This benchmark validates the lock-contention mechanism rather than representing an end-to-end workload. It uses real bbolt fsyncs, high batch limits, and an apply waiter queued for at least 2 ms before compaction unlocks.
The total compaction cost is unchanged because the commit is moved, not removed. The improvement is that an already queued apply operation can acquire the batch-tx lock between compaction's |
e8793e3 to
9938360
Compare
Signed-off-by: xigang <wangxigang2014@gmail.com>
9938360 to
9f62dc8
Compare
This PR reduces lock contention during compaction deletes.
Previously, compaction synchronously committed bbolt while holding the batch-tx lock after deleting old revisions. Any apply operation queued behind it had to wait for the fsync to complete.
The change releases the batch-tx lock before committing, so queued apply operations can proceed without being blocked by compaction’s fsync.
Normal client deletes are unchanged and retain their existing immediate-commit semantics.