This patch moves the 40 something peering state variables over into
PeeringState while leaving references to them in PG. The following
patches will move over the users until all users are in PeeringState.
Then, the PG references will be removed. A subsequent patch will also
move the recovery_state member to be the last initialize and first
destructed.
Signed-off-by: sjust@redhat.com <sjust@redhat.com>
I don't think there's any need to worry about the pg locking from
PGStateHistory. NamedState::begin/exit and dump_pgstate_history are the
only users, so the only calls should be under the peering event handler,
the asok command, or the PG constructor and destructor. The first two
already have the lock. The last should be safe as well as long as
the state machine states are constructed and destructed after and
before the PGStateHistory instance. As such, this patch removes most
of that state leaving the epoch generation as an interface
implemented by PG.
The snap trimming state machine was already excluded, so that this
patch leaves it disabled.
Signed-off-by: Samuel Just <sjust@redhat.com>
I'm going to extract this logic and reuse it in crimson. Recovery* has
always been a confusing name as it implements neither log-based recovery
nor backfill. Rather, it's mainly the buisiness logic for agreeing on
an authoritative log and some ancillary things such as scrub/backfill
reservation.
$ for i in $(git grep -l 'RecoveryMachine'); do sed -i 's/RecoveryMachine/PeeringMachine/g' $i; done
$ for i in $(git grep -l 'RecoveryState'); do sed -i 's/RecoveryState/PeeringState/g' $i; done
$ for i in $(git grep -l 'RecoveryCtx'); do sed -i 's/RecoveryCtx/PeeringCtx/g' $i; done
Signed-off-by: Samuel Just <sjust@redhat.com>
* refs/pull/27804/head:
common, osd: remove erroneous 'section' in dump functions
dencoder: include some missed types
common: make utime_t dencoder-compatible
common: make uuid_d dencoder-compatible
osd: make watch_item_t dencoder-compatible
Reviewed-by: Sage Weil <sage@redhat.com>
strictly speaking, time_t is an opaque time, and in this context, we
need a uint32_t, so it is not necessary and wrong. let's remove it.
Signed-off-by: Kefu Chai <kchai@redhat.com>
we could have kept rotating_keyring as a plain member variable, but
`AuthClientHandler` keeps a weak reference to it, we are not able to
update it to point it to the new rotating_keyring in the newly created
active_con created from the connected pending connection -- the move
ctor of ceph::mon::Connection does create a new RotatingKeyring. so this
has two consequences:
- the raw pointer held by AuthClientHandler is not valid anymore, after
the pending connection is destroyed when it is promoted to active_con.
so we are writing to freed memory when renewing the rotating keyring.
- we won't have access to the updated keyring.
if we use a std::vector<unique_ptr<Connection>> for pending_conns, this
change won't be needed. we could make this change in a future change
though.
Signed-off-by: Kefu Chai <kchai@redhat.com>
AuthAuthorizeHandler::verify_authorizer() neither changes the keystore,
nor expects a nullptr. so we should pass the keystore by const reference
for better readability
Signed-off-by: Kefu Chai <kchai@redhat.com>
crimson-common and ceph-common have subtle difference which is
conditionalized by WITH_SEASTAR macro. and the different implementations
share the same name, so we should not link crimson executables against ceph-common .
Signed-off-by: Kefu Chai <kchai@redhat.com>
crimson messenger's tests does not use ConfigProxy at the time of writing,
and ldout() cannot tell if a log message should be written to the
logfile or not without querying config subsystem, so, to avoid involving
config system in crimson messenger's tests, the log line is disabled if
WITH_SEASTAR, we will kill this workaround once we ditch crimson/net/Config.h.
Signed-off-by: Kefu Chai <kchai@redhat.com>