wal: make wal_sync fail on write error
wal_sync() simply flushes the tx<->wal request queue, it doesn't guarantee that all pending writes are successfully committed to disk. This works for now, but in order to implement replica join off the current read view, we need to make sure that all pending writes have been persisted and won't be rolled back before we can use memtx snapshot iterators. So this patch adds a return code to wal_sync(): since now on it returns -1 if rollback is in progress and hence some in-memory changes are going to be rolled back. We will use this method after opening memtx snapshot iterators used for feeding a consistent read view a newly joined replica so as to ensure that changes frozen by the iterators have made it to the disk.
Showing
- src/box/vinyl.c 14 additions, 8 deletionssrc/box/vinyl.c
- src/box/wal.c 31 additions, 3 deletionssrc/box/wal.c
- src/box/wal.h 3 additions, 2 deletionssrc/box/wal.h
- src/lib/core/errinj.h 1 addition, 0 deletionssrc/lib/core/errinj.h
- test/box/errinj.result 13 additions, 11 deletionstest/box/errinj.result
- test/vinyl/errinj_ddl.result 56 additions, 0 deletionstest/vinyl/errinj_ddl.result
- test/vinyl/errinj_ddl.test.lua 26 additions, 0 deletionstest/vinyl/errinj_ddl.test.lua
Loading
Please register or sign in to comment