raft: check box_raft is inited before usage
Since box_raft is now initialized at runtime and is used from several subsystems (memtx for snapshots; applier for accepting rows; box.info for monitoring), it may be easy to screw the intialization order and accidentally use the not initialized global raft object. This patch adds a sanity check ensuring it does not happen. The raft state is set to 0 at program start. Then any access to the global raft object firstly checks the state not being 0. The initialization order will get trickier when raft will stop using globals from replication and from box, and will be used from them more extensively. Part of #5303
Loading
Please register or sign in to comment