metrics
metrics copied to clipboard
Fix replicas metrics for tarantool raft
Change replica detection from using function box.cfg.read_only
to box.info.ro
.
Function box.info.ro
can be true in case of autofailover-leader change, but box.cfg.read_only
may not.
Reference:
- Lua-function
box.info.ro
calls C-functionbox_is_ro
: info.c#L349. - C-function
box_is_ro
uses variableis_ro_summary
: box.cc#L551. - Variable
is_ro_summary
is a sum of valuebox.cfg.read_only
, orphan status and autofailover-leader status: box.cc#L360. - Variable
is_ro_summary
is recomputed on autofailover-leader change: raft.c#L205