relay: join new replicas off read view
Historically, we join a new replica off the last checkpoint. As a result, we must always keep the last memtx snapshot and all vinyl data files corresponding to it. Actually, there's no need to use the last checkpoint for joining a replica. Instead we can use the current read view as both memtx and vinyl support it. This should speed up the process of joining a new replica, because we don't need to replay all xlogs written after the last checkpoint, only those that are accumulated while we are relaying the current read view. This should also allow us to avoid creating a snapshot file on bootstrap, because the only reason why we need it is allowing joining replicas. Besides, this is a step towards decoupling the vinyl metadata log from checkpointing in particular and from xlogs in general. Closes #1271
Showing
- src/box/blackhole.c 2 additions, 0 deletionssrc/box/blackhole.c
- src/box/box.cc 22 additions, 38 deletionssrc/box/box.cc
- src/box/engine.c 63 additions, 5 deletionssrc/box/engine.c
- src/box/engine.h 38 additions, 12 deletionssrc/box/engine.h
- src/box/memtx_engine.c 111 additions, 52 deletionssrc/box/memtx_engine.c
- src/box/relay.cc 24 additions, 1 deletionsrc/box/relay.cc
- src/box/relay.h 1 addition, 1 deletionsrc/box/relay.h
- src/box/sysview.c 2 additions, 0 deletionssrc/box/sysview.c
- src/box/vinyl.c 150 additions, 273 deletionssrc/box/vinyl.c
- src/box/vy_run.c 0 additions, 6 deletionssrc/box/vy_run.c
- src/box/vy_tx.c 3 additions, 7 deletionssrc/box/vy_tx.c
- src/box/vy_tx.h 8 additions, 0 deletionssrc/box/vy_tx.h
- src/lib/core/errinj.h 1 addition, 1 deletionsrc/lib/core/errinj.h
- test/box/errinj.result 17 additions, 17 deletionstest/box/errinj.result
- test/replication-py/cluster.result 0 additions, 13 deletionstest/replication-py/cluster.result
- test/replication-py/cluster.test.py 0 additions, 25 deletionstest/replication-py/cluster.test.py
- test/replication/join_without_snap.result 88 additions, 0 deletionstest/replication/join_without_snap.result
- test/replication/join_without_snap.test.lua 32 additions, 0 deletionstest/replication/join_without_snap.test.lua
- test/replication/suite.cfg 1 addition, 0 deletionstest/replication/suite.cfg
- test/vinyl/errinj.result 2 additions, 2 deletionstest/vinyl/errinj.result
Loading
Please register or sign in to comment