Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: silentred 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 |
|
Hi @silentred. 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 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. |
d58a975 to
968ed4a
Compare
…ating kvhash and deleting obsolete revision to reduce the time required for etcdserver compaction Signed-off-by: shenmu.wy <shenmu.wy@antfin.com>
968ed4a to
c98f975
Compare
|
Got it. This PR is for an overview of changes and complexity, for the community to decide whether this feature should be proceeded with. If yes, then we could start adding tests and benchmarks, as you mentioned. |
Try to resolve #21284
This PR introduces a new compaction implementation that parallelly does calculating kvhash and deleting obsolete revision to reduce the time required for etcdserver compaction.
What is changed:
map[Revision]struct{}to return means the set of revisions to delete.compactmethod ofkeyIndexscheduleCompactionRangeFreemethod for*storeTo address the suggestions in the review #21284 (comment)
Before starting to delete revisions, a new
ReadTx()is obtained. The underlying bbolt read tx should be able to see all the revisions at that moment, including the revisions that will be deleted in compaction.For the moment, I choose to wait for hash calculation done in the compaction logic, by doing
hash := <-kvHashChbefore returning. So there should not be overlap of different hash calculation.There certainly is room for optimization. We could make compaction not wait hash calculation finished, and just return a
<-chan KeyValueHashand let other component wait for the result, for example, HashStorage.