wal: preallocate disk space before writing rows
This function introduces a new xlog method xlog_fallocate() that makes sure that the requested amount of disk space is available at the current write position. It does that with posix_fallocate(). The new method is called before writing anything to WAL, see wal_fallocate(). In order not to invoke the system call too often, wal_fallocate() allocates disk space in big chunks (1 MB). The reason why I'm doing this is that I want to have a single and clearly defined point in the code to handle ENOSPC errors, where I could delete old WALs and retry (this is what #3397 is about). Needed for #3397
Showing
- CMakeLists.txt 1 addition, 0 deletionsCMakeLists.txt
- src/box/journal.c 1 addition, 0 deletionssrc/box/journal.c
- src/box/journal.h 4 additions, 0 deletionssrc/box/journal.h
- src/box/txn.c 1 addition, 0 deletionssrc/box/txn.c
- src/box/wal.c 46 additions, 0 deletionssrc/box/wal.c
- src/box/xlog.c 45 additions, 0 deletionssrc/box/xlog.c
- src/box/xlog.h 16 additions, 0 deletionssrc/box/xlog.h
- src/box/xrow.h 13 additions, 0 deletionssrc/box/xrow.h
- src/trivia/config.h.cmake 1 addition, 0 deletionssrc/trivia/config.h.cmake
Loading
Please register or sign in to comment