-
Notifications
You must be signed in to change notification settings - Fork 183
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
AutoCompact & CompactWithDeprecateTable Support #165
Merged
Merged
Conversation
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
…autoCompact. And add default value of lower and upper threshold in options.
=== RUN TestDBCompact/test_compaction shard:1 Function took existTime:395.82922ms,reader:535.043275ms,rewriteTime:790.151805ms,all:1.945597922s shard:2 Function took existTime:409.16579ms,reader:547.093471ms,rewriteTime:810.14034ms,all:1.996946539s shard:0 Function took existTime:414.753128ms,reader:547.752194ms,rewriteTime:826.628021ms,all:2.024067234s === RUN TestDBCompactWitchDeprecateable/test_compaction shard:1 Function took existTime:15.4204ms,reader:563.989168ms,rewriteTime:910.374564ms,all:1.67209614s shard:0 Function took existTime:21.662887ms,reader:587.597162ms,rewriteTime:996.416705ms,all:1.794619638s shard:2 Function took existTime:16.989118ms,reader:627.684099ms,rewriteTime:996.287388ms,all:1.833219848s
…e features. Support printing performance data for two different types of compacts and TestautoCompact.
感谢 PR,请修复对应的 comment,并且 rebase 一下代码。 |
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.
AutoCompact & CompactWithDeprecateable
Add autoCompact support.
AutoCompact can automatically occur in the background. There are not implementation for IO state, only reserve space for it.
This feature adds a memory-based deprecated table (dptable), which marks deprecated data in the vlog based on the UUID of each operation, without the need to retrieve deprecated data through the bptree.
This feature mainly reduces the overhead of accessing the bptree.Reduced by approximately one order of magnitude.
bptreeTime:219.758243 ms > dptableTime:24.207176 ms
We need to further discuss the IO status. It is initially believed that disk-level monitoring is superior to API hooks.
disk-level monitoring | maybe useful:github.com/shirou/gopsutil
Changes
Modified the encoding format of records in the vlog to include UUID information.
Changed the value format in the bptree to include UUID information.
Added a listener coroutine responsible for triggering AutoCompact.
Introduced the CompactWithDeprecateable method, which implements compaction based on the dptable.
Modified some test functions to cover cases involving compaction.
Added relevant options.
Test Reuslt
According to a mixed read-write ratio of 5:1.
Compare
The results of comparing Compact and CompactWithDeprecatedable are as follows:
We can easily observe that bptreeTime is significantly higher than dptableTime, as it has a greater access overhead. Notably, the original compact has slightly lower overhead when modifying the B+ tree information a second time. This is likely because after the first read, there is a high probability that the cache entry exists in memory, which is a common characteristic of B+ trees.
TestDBAutoCompact