Improve Entity History Cleanup Performance - #352
Merged
Merged
Conversation
JonoPrest
commented
Nov 20, 2024
Collaborator
- Adds a "shouldDeepClean" flag to have a lighter version of the cleanup function
- Moves the cleanup function into it's own task that happens async with a throttler. On every 20th cycle it will try deep clean (configurable)
DZakh
approved these changes
Nov 20, 2024
| } | ||
| } | ||
| } | ||
| state.writeThrottlers.pruneStaleEntityHistory->Throttler.schedule(runPrune) |
Member
There was a problem hiding this comment.
Am I right that it'll simply log if the transaction fails? For example, if we terminate it on our side.
Collaborator
Author
There was a problem hiding this comment.
Yeah exactly it just logs
JonoPrest
force-pushed
the
jp/improve-prune-performance
branch
from
November 21, 2024 07:53
85e7e86 to
e6b9340
Compare
JonoPrest
commented
Nov 21, 2024
Comment on lines
+143
to
+145
| let shouldPruneHistory = (config, ~isInReorgThreshold) => | ||
| switch config.historyConfig { | ||
| | {historyFlag: MinHistory} => true | ||
| | {rollbackFlag: RollbackOnReorg, historyFlag: MinHistory} if isInReorgThreshold => true |
Collaborator
Author
There was a problem hiding this comment.
@DZakh note I made one more change here. I noticed on the monitoring that even the non-rollback indexers were firing this off. (Obviously a very light query with no history but still should only apply to rollback indexers)
And I baked in the isInReorgThreshold check here just like the shouldSaveHistory function above
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.