Merge pull request #44333 from rzarzynski/wip-crimson-fix-recovery-discarding

crimson/osd: implement op discarding for pglog-based recovery. 

Reviewed-by: Samuel Just <sjust@redhat.com>
Reviewed-by: Chunmei Liu <chunmei.liu@intel.com>
This commit is contained in:
Kefu Chai 2021-12-26 21:46:41 +08:00 committed by GitHub
commit 85e30b4dfd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -592,6 +592,10 @@ RecoveryBackend::interruptible_future<>
ReplicatedRecoveryBackend::handle_pull(Ref<MOSDPGPull> m)
{
logger().debug("{}: {}", __func__, *m);
if (pg.can_discard_replica_op(*m)) {
logger().debug("{}: discarding {}", __func__, *m);
return seastar::now();
}
return seastar::do_with(m->take_pulls(), [this, from=m->from](auto& pulls) {
return interruptor::parallel_for_each(pulls,
[this, from](auto& pull_op) {
@ -712,6 +716,10 @@ RecoveryBackend::interruptible_future<>
ReplicatedRecoveryBackend::handle_pull_response(
Ref<MOSDPGPush> m)
{
if (pg.can_discard_replica_op(*m)) {
logger().debug("{}: discarding {}", __func__, *m);
return seastar::now();
}
const PushOp& pop = m->pushes[0]; //TODO: only one push per message for now.
if (pop.version == eversion_t()) {
// replica doesn't have it!
@ -800,6 +808,10 @@ RecoveryBackend::interruptible_future<>
ReplicatedRecoveryBackend::handle_push(
Ref<MOSDPGPush> m)
{
if (pg.can_discard_replica_op(*m)) {
logger().debug("{}: discarding {}", __func__, *m);
return seastar::now();
}
if (pg.is_primary()) {
return handle_pull_response(m);
}