metrics icon indicating copy to clipboard operation
metrics copied to clipboard

Fix replicas metrics for tarantool raft

Open reo7sp opened this issue 7 months ago • 0 comments

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:

  1. Lua-function box.info.ro calls C-function box_is_ro: info.c#L349.
  2. C-function box_is_ro uses variable is_ro_summary: box.cc#L551.
  3. Variable is_ro_summary is a sum of value box.cfg.read_only, orphan status and autofailover-leader status: box.cc#L360.
  4. Variable is_ro_summary is recomputed on autofailover-leader change: raft.c#L205

reo7sp avatar Jul 23 '24 14:07 reo7sp