etcd
etcd copied to clipboard
etcdserver: compact raft log entries more frequently
Part of #17098
Goal
Compact raft log more frequently to save memory.
Key Changes
- Added a new function
maybeCompactRaftLogto handle raft log compaction. - Introduce 2 variables:
CompactRaftLogEveryNAppliesandDefaultCompactRaftLogEveryNAppliesto control how frequently the raft log is compacted. - Fix a test
TODO
- [ ] Add tests for the changes
- [ ] Run benchmarks
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: clement2026 Once this PR has been reviewed and has the lgtm label, please assign wenjiaswe for approval. For more information see the Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
Hi @clement2026. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.
Once the patch is verified, the new status will be reflected by the ok-to-test label.
I understand the commands that are listed here.
Instructions 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.
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 68.81%. Comparing base (59cfd7a) to head (273905b).
:warning: Report is 2106 commits behind head on main.
:warning: Current head 273905b differs from pull request most recent head f1a76a2
Please upload reports for the commit f1a76a2 to get more accurate results.
Additional details and impacted files
| Files with missing lines | Coverage Δ | |
|---|---|---|
| server/config/config.go | 79.76% <ø> (ø) |
|
| server/etcdserver/server.go | 81.48% <100.00%> (+0.13%) |
:arrow_up: |
... and 14 files with indirect coverage changes
@@ Coverage Diff @@
## main #18622 +/- ##
==========================================
+ Coverage 68.79% 68.81% +0.01%
==========================================
Files 420 420
Lines 35522 35532 +10
==========================================
+ Hits 24438 24451 +13
+ Misses 9657 9654 -3
Partials 1427 1427
Continue to review full report in Codecov by Sentry.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 59cfd7a...f1a76a2. Read the comment docs.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
This change does to many things, there are two changes here that should be independent:
- Separate
maybeCompactRaftLogfunction allowing us to compact log independently from snapshots. - Run compaction more frequently. As currently compacti is dependent on snapshot, we would first need to confirm that we are ok with lower number of entries.
Sure. I'll break down this PR.
PR needs rebase.
Instructions 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.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions.