doc/dev/mon-on-disk-formats.rst
############## ON-DISK FORMAT ##############
UPGRADE PATH
On-disk formats, or even data structure formats, may be changed during an
upgrade. Services wishing to do so, may so do it via the
PaxosService::upgrade_format() call path. There is no formalized, unified
format versioning; the PaxosService class keeps track of its
format_version through a key in the store, assumed an unsigned int, but
it will be the service's responsibility to give meaning to those versions.
versions are represented with a single unsigned int. By default, the value
zero represents the absence of a formal upgraded format. The first format
version was introduced in Dumpling; clusters upgrading to Dumpling saw their
format version being increased from zero to one::
0 to 1 - introduced in v0.65, dev release for v0.67 dumpling 1 to 2 - introduced in v12.0.2, dev release for luminous 2 to 3 - introduced in mimic
0 - all clusters pre-dumpling 1 - all clusters dumpling+ and pre-luminous 2 - all clusters luminous+ and pre-mimic 3 - all clusters mimic+
version 1: introduces new-style monitor caps (i.e., profiles) version 2: introduces mgr caps and bootstrap-mgr key version 3: creates all bootstrap and admin keys if they don't yet exist
format_version set on PaxosService::refresh()::
AuthMonitor::upgrade_format() called by PaxosService::_active()::
called from C_Committed callback, from PaxosService::propose_pending()
called from C_Active callback, from PaxosService::_active()
called from PaxosService::election_finished()
on a freshly deployed cluster, upgrade_format() will be first called after create_initial().
on an existing cluster, upgrade_format() will be called after the first election.
upgrade_format() is irrelevant on a freshly deployed cluster, as there is no format to upgrade at this point.
format_version >= current_version then format is up-to-date, return.features doesn't contain LUMINOUS then current_version = 1features doesn't contain MIMIC then current_version = 2current_version = 3if format_version == 0::
if format_version == 1::
if format_version == 2::