Merge pull request #55202 from zhscn/fix-ssc

crimson/osd: get SnapSetContext from head_obc

Reviewed-by: Samuel Just <sjust@redhat.com>
Reviewed-by: Matan Breizman <mbreizma@redhat.com>
This commit is contained in:
Matan Breizman 2024-01-18 12:05:04 +02:00 committed by GitHub
commit 74d985f64e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -807,8 +807,8 @@ PGBackend::rollback_iertr::future<> PGBackend::rollback(
target_coid.snap = snapid;
return obc_loader.with_clone_obc_only<RWState::RWWRITE>(
head, target_coid,
[this, &os, &txn, &delta_stats, &osd_op_params, &snapid]
(auto, auto resolved_obc) {
[this, &os, &txn, &delta_stats, &osd_op_params, snapid]
(auto head_obc, auto resolved_obc) {
if (resolved_obc->obs.oi.soid.is_head()) {
// no-op: The resolved oid returned the head object
logger().debug("PGBackend::rollback: loaded head_obc: {}"
@ -846,7 +846,7 @@ PGBackend::rollback_iertr::future<> PGBackend::rollback(
// 3) Calculate clone_overlaps by following overlaps
const auto& clone_overlap =
resolved_obc->ssc->snapset.clone_overlap;
head_obc->ssc->snapset.clone_overlap;
auto iter = clone_overlap.lower_bound(snapid);
ceph_assert(iter != clone_overlap.end());
interval_set<uint64_t> overlaps = iter->second;
@ -869,7 +869,7 @@ PGBackend::rollback_iertr::future<> PGBackend::rollback(
// if there's no snapshot, we delete the object;
// otherwise, do nothing.
crimson::ct_error::enoent::handle(
[this, &os, &snapid, &txn, &delta_stats, &snapc, &ss, &osd_op_params] {
[this, &os, snapid, &txn, &delta_stats, &snapc, &ss, &osd_op_params] {
logger().debug("PGBackend::rollback: deleting head on {}"
" with snap_id of {}"
" because got ENOENT|whiteout on obc lookup",