summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatan Breizman <mbreizma@redhat.com>2023-12-31 16:00:35 +0100
committerMatan Breizman <mbreizma@redhat.com>2024-01-04 16:18:11 +0100
commit869fc82a74b73c8e5661db21d48d7b8953f71c85 (patch)
treeb13236cf125b2cfcd0b4b55557d8c265e5759ab8
parentrename prep_push to prep_push_to_replica (diff)
downloadceph-869fc82a74b73c8e5661db21d48d7b8953f71c85.tar.xz
ceph-869fc82a74b73c8e5661db21d48d7b8953f71c85.zip
crimson/osd/replicated_recovery_backend: seperate prep_push_to_replica and prep_push
Signed-off-by: Matan Breizman <mbreizma@redhat.com>
Diffstat (limited to '')
-rw-r--r--src/crimson/osd/replicated_recovery_backend.cc34
-rw-r--r--src/crimson/osd/replicated_recovery_backend.h5
2 files changed, 28 insertions, 11 deletions
diff --git a/src/crimson/osd/replicated_recovery_backend.cc b/src/crimson/osd/replicated_recovery_backend.cc
index 92435a9c925..da416427d62 100644
--- a/src/crimson/osd/replicated_recovery_backend.cc
+++ b/src/crimson/osd/replicated_recovery_backend.cc
@@ -319,16 +319,26 @@ ReplicatedRecoveryBackend::prep_push_to_replica(
auto& recovery_waiter = get_recovering(soid);
auto& obc = recovery_waiter.obc;
- interval_set<uint64_t> data_subset;
- if (obc->obs.oi.size) {
- data_subset.insert(0, obc->obs.oi.size);
- }
- const auto& missing = pg.get_shard_missing().find(pg_shard)->second;
- const auto it = missing.get_items().find(soid);
- assert(it != missing.get_items().end());
- data_subset.intersection_of(it->second.clean_regions.get_dirty_regions());
- logger().debug("prep_push: {} data_subset {} to {}",
- soid, data_subset, pg_shard);
+ // TODO: use calc_clone_subsets
+ crimson::osd::subsets_t subsets;
+
+ return prep_push(soid,
+ need,
+ pg_shard,
+ subsets);
+
+}
+
+RecoveryBackend::interruptible_future<PushOp>
+ReplicatedRecoveryBackend::prep_push(
+ const hobject_t& soid,
+ eversion_t need,
+ pg_shard_t pg_shard,
+ const crimson::osd::subsets_t& subsets)
+{
+ logger().debug("{}: {}, {}", __func__, soid, need);
+ auto& recovery_waiter = get_recovering(soid);
+ auto& obc = recovery_waiter.obc;
auto& push_info = recovery_waiter.pushing[pg_shard];
pg.begin_peer_recover(pg_shard, soid);
@@ -338,7 +348,8 @@ ReplicatedRecoveryBackend::prep_push_to_replica(
push_info.obc = obc;
push_info.recovery_info.size = obc->obs.oi.size;
- push_info.recovery_info.copy_subset = data_subset;
+ push_info.recovery_info.copy_subset = subsets.data_subset;
+ push_info.recovery_info.clone_subset = subsets.clone_subsets;
push_info.recovery_info.soid = soid;
push_info.recovery_info.oi = obc->obs.oi;
push_info.recovery_info.version = obc->obs.oi.version;
@@ -356,6 +367,7 @@ ReplicatedRecoveryBackend::prep_push_to_replica(
push_info.recovery_progress = push_op.after_progress;
return push_op;
});
+
}
void ReplicatedRecoveryBackend::prepare_pull(
diff --git a/src/crimson/osd/replicated_recovery_backend.h b/src/crimson/osd/replicated_recovery_backend.h
index 8d0e5ecabb7..00e1021b9eb 100644
--- a/src/crimson/osd/replicated_recovery_backend.h
+++ b/src/crimson/osd/replicated_recovery_backend.h
@@ -53,6 +53,11 @@ protected:
const hobject_t& soid,
eversion_t need,
pg_shard_t pg_shard);
+ interruptible_future<PushOp> prep_push(
+ const hobject_t& soid,
+ eversion_t need,
+ pg_shard_t pg_shard,
+ const crimson::osd::subsets_t& subsets);
void prepare_pull(
const crimson::osd::ObjectContextRef &head_obc,
PullOp& pull_op,