gc: do not abort garbage collection if failed to unlink snap file
We build the checkpoint list from the list of memtx snap files. So to ensure that it is always possible to recover from any checkpoint present in box.info.gc() output, we abort garbage collection if we fail to unlink a snap file. This introduces extra complexity to the garbage collection code, which makes it difficult to make WAL file removal fully asynchronous. Actually, it looks like we are being way too overcautious here, because unlink() doesn't normally fail so an error while removing a snap file is highly unlikely to occur. Besides, even if it happens, it still won't be critical, because we never delete the last checkpoint, which is usually used for backups/recovery. So let's simplify the code by removing that check. Needed for #3938
Showing
- src/box/engine.c 4 additions, 8 deletionssrc/box/engine.c
- src/box/engine.h 4 additions, 4 deletionssrc/box/engine.h
- src/box/gc.c 11 additions, 6 deletionssrc/box/gc.c
- src/box/memtx_engine.c 3 additions, 14 deletionssrc/box/memtx_engine.c
- src/box/vinyl.c 2 additions, 3 deletionssrc/box/vinyl.c
- src/box/wal.c 1 addition, 11 deletionssrc/box/wal.c
- src/box/xlog.c 1 addition, 6 deletionssrc/box/xlog.c
- src/box/xlog.h 1 addition, 1 deletionsrc/box/xlog.h
Loading
Please register or sign in to comment