replication: remove old snapshot files not needed by replicas
Garbage collection doesn't distinguish consumers which need checkpoint files, such as backup, and the ones, who only need WALS, such as replicas. A disconnected replica will 'hold' all checkpoint files, created after it got unsynchronised, even though it doesn't need them, which may lead to disk space shortage. To fix this, we store consumer's type, and treat consumers differently during garbage collection: now only the old WALS are stored for replicas, and old checkpoints are stored for backup, if any. Also changed the tests to check updated garbage collection correctly. Closes #3444
Showing
- src/box/box.cc 3 additions, 2 deletionssrc/box/box.cc
- src/box/gc.c 54 additions, 18 deletionssrc/box/gc.c
- src/box/gc.h 12 additions, 1 deletionsrc/box/gc.h
- src/box/relay.cc 1 addition, 1 deletionsrc/box/relay.cc
- test/replication/gc.result 64 additions, 9 deletionstest/replication/gc.result
- test/replication/gc.test.lua 28 additions, 13 deletionstest/replication/gc.test.lua
Loading
Please register or sign in to comment