box: enable WAL before making initial checkpoint
While a replica is bootstrapped from a remote master, vinyl engine may need to perform compaction, which means that it may write to the _vinyl_deferred_delete system space. Compaction proceeds fully asynchronously, i.e. a write may occur after the join stage is complete, but before the WAL is initialized, in which case the new replica will crash. To make sure a race like that won't happen, let's setup WAL before making the initial checkpoint. The WAL writer is now initialized right before starting the WAL thread and so we don't need to split WAL struct into the thread and the writer anymore. Closes #3968
Showing
- src/box/box.cc 39 additions, 29 deletionssrc/box/box.cc
- src/box/wal.c 68 additions, 77 deletionssrc/box/wal.c
- src/box/wal.h 13 additions, 5 deletionssrc/box/wal.h
- test/vinyl/replica_quota.result 28 additions, 6 deletionstest/vinyl/replica_quota.result
- test/vinyl/replica_quota.test.lua 20 additions, 7 deletionstest/vinyl/replica_quota.test.lua
Loading
Please register or sign in to comment