mirror of
https://github.com/ceph/ceph
synced 2025-01-18 17:12:29 +00:00
Merge pull request #16944 from liewegas/wip-kraken-x
mon/Elector: force election epoch bump on start Reviewed-by: Greg Farnum <gfarnum@redhat.com>
This commit is contained in:
commit
dd2fb6c40b
@ -6,6 +6,10 @@ meta:
|
||||
overrides:
|
||||
ceph:
|
||||
fs: xfs
|
||||
log-whitelist:
|
||||
- overall HEALTH_
|
||||
- \(MON_DOWN\)
|
||||
- \(MGR_DOWN\)
|
||||
conf:
|
||||
global:
|
||||
enable experimental unrecoverable data corrupting features: "*"
|
||||
|
@ -35,9 +35,19 @@ static ostream& _prefix(std::ostream *_dout, Monitor *mon, epoch_t epoch) {
|
||||
void Elector::init()
|
||||
{
|
||||
epoch = mon->store->get(Monitor::MONITOR_NAME, "election_epoch");
|
||||
if (!epoch)
|
||||
if (!epoch) {
|
||||
dout(1) << "init, first boot, initializing epoch at 1 " << dendl;
|
||||
epoch = 1;
|
||||
dout(1) << "init, last seen epoch " << epoch << dendl;
|
||||
} else if (epoch % 2) {
|
||||
dout(1) << "init, last seen epoch " << epoch
|
||||
<< ", mid-election, bumping" << dendl;
|
||||
++epoch;
|
||||
auto t(std::make_shared<MonitorDBStore::Transaction>());
|
||||
t->put(Monitor::MONITOR_NAME, "election_epoch", epoch);
|
||||
mon->store->apply_transaction(t);
|
||||
} else {
|
||||
dout(1) << "init, last seen epoch " << epoch << dendl;
|
||||
}
|
||||
}
|
||||
|
||||
void Elector::shutdown()
|
||||
|
Loading…
Reference in New Issue
Block a user