Draft
Conversation
- Analyzed snapshot write rate limiting implementation - Validated design decisions and code quality - Identified pre-existing test failure in storev2/rootmulti (unrelated) - Recommendation: APPROVE with minor notes - All tests passing, well-designed global rate limiter approach Co-authored-by: Steven Landers <[email protected]>
|
Cursor Agent can help with this pull request. Just |
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2803 +/- ##
==========================================
+ Coverage 46.97% 56.62% +9.65%
==========================================
Files 1965 2031 +66
Lines 160525 165854 +5329
==========================================
+ Hits 75410 93922 +18512
+ Misses 78585 63686 -14899
- Partials 6530 8246 +1716
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes and provide context
This PR introduces an optional I/O rate limiter for snapshot writes, configurable via
sc-snapshot-write-rate-mbps. The primary goal is to prevent page cache eviction and improve stability on machines with limited RAM by capping the total write bandwidth during snapshot creation.It implements a global token bucket rate limiter shared across all trees and files, ensuring the total I/O is truly capped regardless of parallelism. The default value of 0 means unlimited, preserving existing behavior and ensuring backward compatibility.
Testing performed to validate your change
TestGlobalRateLimiterSharedAcrossWriters, to validate shared limiter behavior and timing.TestWriteSnapshotWithBufferto pass anillimiter (unlimited).sei-dbtests, integration tests, and linting passed.storev2/rootmulti/store_test.gowhich is not caused by this PR.Slack Thread