summaryrefslogtreecommitdiffstats
path: root/src/crimson
diff options
context:
space:
mode:
authorLaura Flores <lflores@redhat.com>2024-02-15 20:41:31 +0100
committerGitHub <noreply@github.com>2024-02-15 20:41:31 +0100
commitf50f7fd97bd9d03d9026891e4eabc783584c3fd4 (patch)
treedf945570a7f8cd86617258eb3c097619f365dff9 /src/crimson
parentMerge pull request #55566 from zdover23/wip-doc-2024-02-14-cephadm-services-nfs (diff)
parentfixup: don't store ref-to-on-stack-temporary in RecoveryBackend::coll (diff)
downloadceph-f50f7fd97bd9d03d9026891e4eabc783584c3fd4.tar.xz
ceph-f50f7fd97bd9d03d9026891e4eabc783584c3fd4.zip
Merge pull request #54930 from rzarzynski/wip-osd-ec-rework
osd: rework EC for the sake of integration with crimson
Diffstat (limited to 'src/crimson')
-rw-r--r--src/crimson/osd/osd_operations/scrub_events.cc2
-rw-r--r--src/crimson/osd/pg_backend.h18
-rw-r--r--src/crimson/osd/recovery_backend.cc10
-rw-r--r--src/crimson/osd/recovery_backend.h9
-rw-r--r--src/crimson/osd/scrub/scrub_validator.cc12
5 files changed, 35 insertions, 16 deletions
diff --git a/src/crimson/osd/osd_operations/scrub_events.cc b/src/crimson/osd/osd_operations/scrub_events.cc
index 9777ce20ef1..a7b782a7100 100644
--- a/src/crimson/osd/osd_operations/scrub_events.cc
+++ b/src/crimson/osd/osd_operations/scrub_events.cc
@@ -221,7 +221,7 @@ ScrubScan::ifut<> ScrubScan::scan_object(
if (i.second.length() == 0) {
entry.attrs[i.first];
} else {
- entry.attrs.emplace(i.first, i.second.front());
+ entry.attrs.emplace(i.first, i.second);
}
}
}).handle_error_interruptible(
diff --git a/src/crimson/osd/pg_backend.h b/src/crimson/osd/pg_backend.h
index 98723ff588b..f3f27fd05ba 100644
--- a/src/crimson/osd/pg_backend.h
+++ b/src/crimson/osd/pg_backend.h
@@ -451,4 +451,22 @@ private:
std::vector<pg_log_entry_t>&& log_entries) = 0;
friend class ReplicatedRecoveryBackend;
friend class ::crimson::osd::PG;
+
+protected:
+ boost::container::flat_set<hobject_t> temp_contents;
+
+ template <class... Args>
+ void add_temp_obj(Args&&... args) {
+ temp_contents.insert(std::forward<Args>(args)...);
+ }
+ void clear_temp_obj(const hobject_t &oid) {
+ temp_contents.erase(oid);
+ }
+ template <class T>
+ void clear_temp_objs(const T &cont) {
+ for (const auto& oid : cont) {
+ clear_temp_obj(oid);
+ }
+ }
+ friend class RecoveryBackend;
};
diff --git a/src/crimson/osd/recovery_backend.cc b/src/crimson/osd/recovery_backend.cc
index e5ba9f8d562..1c55b9c6c61 100644
--- a/src/crimson/osd/recovery_backend.cc
+++ b/src/crimson/osd/recovery_backend.cc
@@ -32,6 +32,16 @@ hobject_t RecoveryBackend::get_temp_recovery_object(
return hoid;
}
+void RecoveryBackend::add_temp_obj(const hobject_t &oid)
+{
+ backend->add_temp_obj(oid);
+}
+
+void RecoveryBackend::clear_temp_obj(const hobject_t &oid)
+{
+ backend->clear_temp_obj(oid);
+}
+
void RecoveryBackend::clean_up(ceph::os::Transaction& t,
std::string_view why)
{
diff --git a/src/crimson/osd/recovery_backend.h b/src/crimson/osd/recovery_backend.h
index c65bf565392..4c9c67770ab 100644
--- a/src/crimson/osd/recovery_backend.h
+++ b/src/crimson/osd/recovery_backend.h
@@ -201,12 +201,9 @@ protected:
boost::container::flat_set<hobject_t> temp_contents;
- void add_temp_obj(const hobject_t &oid) {
- temp_contents.insert(oid);
- }
- void clear_temp_obj(const hobject_t &oid) {
- temp_contents.erase(oid);
- }
+ void add_temp_obj(const hobject_t &oid);
+ void clear_temp_obj(const hobject_t &oid);
+
void clean_up(ceph::os::Transaction& t, std::string_view why);
virtual seastar::future<> on_stop() = 0;
private:
diff --git a/src/crimson/osd/scrub/scrub_validator.cc b/src/crimson/osd/scrub/scrub_validator.cc
index b7dcc46a35e..a3979f790bc 100644
--- a/src/crimson/osd/scrub/scrub_validator.cc
+++ b/src/crimson/osd/scrub/scrub_validator.cc
@@ -96,11 +96,9 @@ shard_evaluation_t evaluate_object_shard(
if (xiter == obj.attrs.end()) {
ret.shard_info.set_info_missing();
} else {
- bufferlist bl;
- bl.push_back(xiter->second);
ret.object_info = object_info_t{};
try {
- auto bliter = bl.cbegin();
+ auto bliter = xiter->second.cbegin();
::decode(*(ret.object_info), bliter);
} catch (...) {
ret.shard_info.set_info_corrupted();
@@ -120,11 +118,9 @@ shard_evaluation_t evaluate_object_shard(
if (xiter == obj.attrs.end()) {
ret.shard_info.set_snapset_missing();
} else {
- bufferlist bl;
- bl.push_back(xiter->second);
ret.snapset = SnapSet{};
try {
- auto bliter = bl.cbegin();
+ auto bliter = xiter->second.cbegin();
::decode(*(ret.snapset), bliter);
} catch (...) {
ret.shard_info.set_snapset_corrupted();
@@ -138,11 +134,9 @@ shard_evaluation_t evaluate_object_shard(
if (xiter == obj.attrs.end()) {
ret.shard_info.set_hinfo_missing();
} else {
- bufferlist bl;
- bl.push_back(xiter->second);
ret.hinfo = ECUtil::HashInfo{};
try {
- auto bliter = bl.cbegin();
+ auto bliter = xiter->second.cbegin();
decode(*(ret.hinfo), bliter);
} catch (...) {
ret.shard_info.set_hinfo_corrupted();