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

add bolt compaction sleep interval #13018

Merged

Conversation

AlexStocks
Copy link
Contributor

@AlexStocks AlexStocks commented May 20, 2021

In mvcc/kvstore_compaction.go:store.scheduleCompaction() func, users can set the compaction number by "experimental-compaction-sleep-interval". However, the sleep interval is a constant btw every compaction loop which is 10ms.

I wanna test how long the interval is perfect in my huge k8s cluster if I can set this param by "experimental-compaction-sleep-interval".

@AlexStocks AlexStocks force-pushed the feature/bolt-compaction-sleep-interval branch from b6f3aaa to ad42eef Compare May 20, 2021 15:03
@AlexStocks AlexStocks changed the title add sleep interval add bolt compaction sleep interval May 20, 2021
@AlexStocks AlexStocks force-pushed the feature/bolt-compaction-sleep-interval branch 2 times, most recently from 1f399d4 to 9e765fb Compare May 20, 2021 15:37
ExperimentalCompactionBatchLimit int `json:"experimental-compaction-batch-limit"`
ExperimentalEnableLeaseCheckpoint bool `json:"experimental-enable-lease-checkpoint"`
ExperimentalCompactionBatchLimit int `json:"experimental-compaction-batch-limit"`
// ExperimentalCompactionSleepInterval is the sleep interval between every bolt compaction loop.
Copy link
Contributor

Choose a reason for hiding this comment

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

bolt -> etcd. Compaction happens in etcd data-model. defrag would be bbolt operation.

When user should enlarge that time ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done. have change to 'etcd' from 'bolt'.

Q: When user should enlarge that time ?
A: In more then 5,000 nodes k8s cluster.

@AlexStocks AlexStocks force-pushed the feature/bolt-compaction-sleep-interval branch from 9e765fb to 184b0e5 Compare May 24, 2021 08:22
@codecov-commenter
Copy link

Codecov Report

Merging #13018 (184b0e5) into main (b29e8e4) will decrease coverage by 3.79%.
The diff coverage is 92.30%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #13018      +/-   ##
==========================================
- Coverage   68.20%   64.41%   -3.80%     
==========================================
  Files         435      422      -13     
  Lines       33186    33597     +411     
==========================================
- Hits        22636    21641     -995     
- Misses       8615     9764    +1149     
- Partials     1935     2192     +257     
Flag Coverage Δ
all 64.41% <92.30%> (-3.80%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
server/config/config.go 39.39% <ø> (-34.85%) ⬇️
server/embed/config.go 50.80% <ø> (-19.75%) ⬇️
server/mvcc/kvstore_compaction.go 78.94% <80.00%> (-15.50%) ⬇️
server/embed/etcd.go 66.20% <100.00%> (-2.73%) ⬇️
server/etcdmain/config.go 81.02% <100.00%> (-2.71%) ⬇️
server/etcdserver/server.go 73.50% <100.00%> (-4.85%) ⬇️
server/mvcc/kvstore.go 78.79% <100.00%> (-5.90%) ⬇️
raft/quorum/quorum.go 0.00% <0.00%> (-100.00%) ⬇️
raft/tracker/state.go 0.00% <0.00%> (-100.00%) ⬇️
server/mvcc/backend/hooks.go 0.00% <0.00%> (-100.00%) ⬇️
... and 205 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b29e8e4...184b0e5. Read the comment docs.

@spzala
Copy link
Member

spzala commented May 25, 2021

approved workflow run

Copy link
Member

@spzala spzala left a comment

Choose a reason for hiding this comment

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

lgtm Thanks @AlexStocks

@spzala spzala merged commit 05674c8 into etcd-io:main May 25, 2021
@JalinWang JalinWang mentioned this pull request Aug 23, 2024
2 tasks
@@ -52,9 +52,11 @@ const (

var restoreChunkKeys = 10000 // non-const for testing
var defaultCompactBatchLimit = 1000
var minimumBatchInterval = 10 * time.Millisecond
Copy link
Member

Choose a reason for hiding this comment

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

Should rename to defaultBatchInterval.

By 'minimum,' we mean that the interval should be adjusted to 10ms if users set a smaller value, but clearly, the current implementation does not reflect this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fixed in pull request #18495: #18495 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

6 participants