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.
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
feat: compute tbs entry size before writing and flush to avoid limit error #12120
feat: compute tbs entry size before writing and flush to avoid limit error #12120
Changes from 1 commit
1d22c37
bb819bc
a16a4ce
613e58f
958ffc5
c19c88e
9c9cca2
40c17a2
25f0a4c
52767f8
de0230b
ac8f074
d6fece5
af8a170
5842784
57c734b
bc0188e
94aaa7e
c0cd5ff
0848890
4a351af
5519367
a71b50d
7113324
22b613f
6bb59ca
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of defaulting to 1024, should we perhaps use
s.db.Size()
? And rather than calculatingpendingSize
, maybe we could track the remaining capacity? i.e.StorageLimitInBytes - Size()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed the default 1024. For tracking I'd prefer to use
pendingSize
but I have no strong opinion on itThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like in
ReadWriter.writeEntry
, this should be coordinated across all ReadWriters.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed this a bit.
IIUC when flushing we're just committing the current (readwriter) transaction which is independent from other ReadWriters so we need to track the total underlying storage
pendingSize
(sum of all the readwriterspendingSize
s) but also the per-readwriterpendingSize
.When a ReadWriter flushes we reset its current
pendingSize
and subtract it from the storagependingSize
.