-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fix endless chunk rewriting when db is idle - improvement #4000
Closed
vreuland
wants to merge
4
commits into
h2database:master
from
vreuland:fix-endless-chunk-rewriting-when-db-is-idle
Closed
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
c83b88d
Adapt chunk rewriting/compaction stop condition in store housekeeping
vreuland 2e860ac
Merge branch 'h2database:master' into fix-endless-chunk-rewriting-whe…
vreuland cab7c06
Refine chunk rewriting/compaction stop condition in store housekeeping
vreuland adac0f9
Merge remote-tracking branch 'origin/fix-endless-chunk-rewriting-when…
vreuland File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Oops, something went wrong.
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.
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.
It looks like this condition may yield true only by a coincident, because if last housekeeping has rewritten chunks, chunks fill rate is likely to change, even without any user activity
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.
To be honest, It is based on the observations I have made on my database where practically the chunkFillRate was not moving during the housekeeping (quickly stayed in my case at 78%): Only the rewriteable chunk fill rate was incrementally increasing (up to 100%) until the retention time of the first rewritten chunks was hit, driving back the rewritable chunk fill rate to the starting point and restarting the useless housekeeping cycle.
The condition has also an equality ( and not a <=) because I needed a way to detect when to "resume" the housekeeping if some user operations were made (at least enough operations to have an impact on the chunkFillRate) and without using isIdle.
So the logic is really:
But you are right, I guess the fact that the chunkFillRate is not "moved" by the housekeeping in my tests might very well be specific to my database(s). And depending on the database, we could probably have a situation where chunkFillRate is also somehow fluctuating (78, 79, 77, 78, 79, ...) after each housekeeping, blowing up the stopping condition.
I have seen you have made another proposal (in #4006). Thanks a lot for that. I will thoroughly test it and will come back to you as soon as I can.