box: delete .inprogress files from wal_dir#12247
Open
LevKats wants to merge 1 commit intotarantool:masterfrom
Open
box: delete .inprogress files from wal_dir#12247LevKats wants to merge 1 commit intotarantool:masterfrom
LevKats wants to merge 1 commit intotarantool:masterfrom
Conversation
57a2d7d to
d87cac1
Compare
drewdzzz
reviewed
Jan 28, 2026
src/box/wal.c
Outdated
| wal_remove_temporary_files(void) | ||
| { | ||
| struct wal_writer *writer = &wal_writer_singleton; | ||
| xdir_remove_temporary_files(&writer->wal_dir); |
Contributor
There was a problem hiding this comment.
I just glanced over wal_writer and it seems to me that writer->wal_dir can be updated from WAL thread. Do I miss something or there is a potential data race here?
Contributor
Author
There was a problem hiding this comment.
Fixed. Sorry for long response.
In tarantool, each engine maintains its own files including `.inprogress`. However, `.xlog` files do not belong to any particular engine and are common. When `wal_dir` matches `memtx_dir`, xlogs just happen to be accidentally deleted by memtx engine. In this patch, the `wal_remove_temporary_files` function is introduced to delete such common files from `wal_dir`. Fixes tarantool#12081 NO_DOC=bugfix NO_CHANGELOG=bugfix
d87cac1 to
dbb0440
Compare
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.
In tarantool, each engine maintains its own files including
.inprogress. However,.xlogfiles do not belong to any particular engine and are common. Whenwal_dirmatchesmemtx_dir, xlogs just happen to be accidentally deleted by memtx engine.In this patch, the
wal_remove_temporary_filesfunction is introduced to delete such common files fromwal_dir.Fixes #12081
NO_DOC=bugfix
NO_CHANGELOG=bugfix