vinyl: optimize deletion of compacted run files
On completion of compaction tasks we remove compacted run files created after the last checkpoint immediately to save disk space. In order to perform this optimization we compare the unused runs' dump LSN with the last checkpoint's one. But during replica's initial JOIN stage we set the LSN of all rows received from remote master to 0 (see box/box.cc/boostrap_journal_write). Considering that the LSN of an initial checkpoint is also 0, our optimization stops working, and we receive a huge disk space usage spike (as the unused run files will only get removed when garbage collection occurs). We should check the vinyl space engine's status and perform our optimization unconditionally if we are in replica's initial JOIN stage. Closes #6568 (cherry picked from commit 599f0c13)
Showing
- changelogs/unreleased/gh-6568-replica-initial-join-removal-of-compacted-run-files.md 4 additions, 0 deletions...68-replica-initial-join-removal-of-compacted-run-files.md
- src/box/vinyl.c 2 additions, 0 deletionssrc/box/vinyl.c
- src/box/vy_run.c 1 addition, 0 deletionssrc/box/vy_run.c
- src/box/vy_run.h 5 additions, 0 deletionssrc/box/vy_run.h
- src/box/vy_scheduler.c 2 additions, 1 deletionsrc/box/vy_scheduler.c
- test/vinyl-luatest/gh_6568_replica_initial_join_removal_of_compacted_run_files_test.lua 73 additions, 0 deletions...lica_initial_join_removal_of_compacted_run_files_test.lua
- test/vinyl-luatest/suite.ini 4 additions, 0 deletionstest/vinyl-luatest/suite.ini
Loading
Please register or sign in to comment