]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mon: make tiebreaker mon optional in stretch-mode
authorKamoltat (Junior) Sirivadhna <ksirivad@redhat.com>
Wed, 15 Apr 2026 22:34:08 +0000 (22:34 +0000)
committerKamoltat (Junior) Sirivadhna <ksirivad@redhat.com>
Mon, 11 May 2026 15:52:25 +0000 (15:52 +0000)
commitaa9e1dad056fa5cb611310a8c0ed9d1e890b3f2d
tree0b0ece7ae9217c03dddec715f026de08e1ecd7f2
parent66ee9aaa4bf31112e7b6ac08cafb93f15be14dee
mon: make tiebreaker mon optional in stretch-mode

Motivation:
To future support EC stretch feature, we need to
simplify how we enable stretch-mode

Solution:
Make tiebreaker argument optional.

old:
```
ceph mon enable_stretch_mode <tiebreaker_mon> <new_crush_rule>
<dividing_bucket>
```
new:
ceph mon enable_stretch_mode <tiebreaker_mon (optional)> <new_crush_rule>
<dividing_bucket>

Ceph will try to select a tiebreaker mon that resides in
the crush <dividing_bucket> type but doesn't belong
to any of the data sites which the OSDs resides in.

Also created a helper function
`MonmapMonitor::validate_and_enable_stretch_mode`
inside `MonmapMonitor::try_enable_stretch_mode`
making the logic unittestable

Moreover, ceph mon enable_stretch_mode will
automatically set monitor election strategy to Connectivity.

We now also enforce that at least 1 monitor exists for each data zone.

Signed-off-by: Kamoltat (Junior) Sirivadhna <ksirivad@redhat.com>
src/crush/CrushWrapper.cc
src/crush/CrushWrapper.h
src/mon/MonCommands.h
src/mon/MonmapMonitor.cc
src/mon/MonmapMonitor.h
src/mon/OSDMonitor.cc
src/mon/OSDMonitor.h