replication: add monitoring and fix crashes
Add replication status to box.info(). When replication is off, box.info.replication.status is 'off'. Other allowed statuses are: - 'connecting' - trying to connect to the master - 'connected' - connected, but nothing read yet, - 'running' - successfully received first rows - 'failed' - network error - 'stopped' - apply conflict, replication needs to be restarted Move recovery_last_update and recovery_delay to section 'replication' in box.info(), replace the first with 'lag' variable, indicating the time difference between the currnet time and row time of the last row, and 'idle' variable, indicating the difference between the current time and the time of last event from the master. Also output the text of the last error when it happens and stops replication. Make vclock output in box.info more compact. Remove 'sophia' section from box.info, it's big, and we need to solve the problem of status systematically for all engines. Fix crashes when trying to stop failed replication: fiber_cancel() of a dead cancellable fiber would try to schedule it and crash.
Showing
- src/box/lua/info.cc 33 additions, 10 deletionssrc/box/lua/info.cc
- src/box/recovery.cc 1 addition, 0 deletionssrc/box/recovery.cc
- src/box/recovery.h 2 additions, 1 deletionsrc/box/recovery.h
- src/box/replica.cc 25 additions, 9 deletionssrc/box/replica.cc
- src/box/replica.h 3 additions, 0 deletionssrc/box/replica.h
- src/fiber.cc 12 additions, 1 deletionsrc/fiber.cc
- test/box/admin.result 6 additions, 1 deletiontest/box/admin.result
- test/box/admin.test.lua 6 additions, 1 deletiontest/box/admin.test.lua
- test/box/info.result 3 additions, 9 deletionstest/box/info.result
- test/box/info.test.lua 1 addition, 2 deletionstest/box/info.test.lua
- test/sophia/info.result 2 additions, 8 deletionstest/sophia/info.result
- test/sophia/info.test.lua 2 additions, 2 deletionstest/sophia/info.test.lua
- test/unit/fiber.cc 42 additions, 0 deletionstest/unit/fiber.cc
- test/unit/fiber.result 3 additions, 0 deletionstest/unit/fiber.result
Loading
Please register or sign in to comment