summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXuehan Xu <xuxuehan@qianxin.com>2023-09-05 03:26:17 +0200
committerXuehan Xu <xuxuehan@qianxin.com>2024-01-09 06:40:36 +0100
commit8431207a71aed498389e92a0d5975f2b0935f88e (patch)
tree8d51907889243f27d81735003b50dd51da7f3aee
parentMerge pull request #54870 from Svelar/crimson_g_conf (diff)
downloadceph-8431207a71aed498389e92a0d5975f2b0935f88e.tar.xz
ceph-8431207a71aed498389e92a0d5975f2b0935f88e.zip
crimson/osd/pg: set obc's ssc when handling pull responses
Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
-rw-r--r--src/crimson/osd/replicated_recovery_backend.cc18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/crimson/osd/replicated_recovery_backend.cc b/src/crimson/osd/replicated_recovery_backend.cc
index 1ff0623abdc..9a1060c440e 100644
--- a/src/crimson/osd/replicated_recovery_backend.cc
+++ b/src/crimson/osd/replicated_recovery_backend.cc
@@ -804,11 +804,21 @@ ReplicatedRecoveryBackend::_handle_pull_response(
recovery_waiter.obc = obc;
obc->obs.oi.decode_no_oid(push_op.attrset.at(OI_ATTR),
push_op.soid);
- if (push_op.attrset.contains(SS_ATTR)) {
- bufferlist ssbl = push_op.attrset.at(SS_ATTR);
- SnapSet ss(ssbl);
+ auto ss_attr_iter = push_op.attrset.find(SS_ATTR);
+ if (ss_attr_iter != push_op.attrset.end()) {
+ if (!obc->ssc) {
+ obc->ssc = new crimson::osd::SnapSetContext(
+ push_op.soid.get_snapdir());
+ }
+ try {
+ obc->ssc->snapset = SnapSet(ss_attr_iter->second);
+ obc->ssc->exists = true;
+ } catch (const buffer::error&) {
+ logger().warn("unable to decode SnapSet");
+ throw crimson::osd::invalid_argument();
+ }
assert(!pull_info.obc->ssc->exists ||
- ss.seq == pull_info.obc->ssc->snapset.seq);
+ obc->ssc->snapset.seq == pull_info.obc->ssc->snapset.seq);
}
pull_info.recovery_info.oi = obc->obs.oi;
if (pull_info.recovery_info.soid.snap &&