summaryrefslogtreecommitdiffstats
path: root/src/osd/scrubber/ScrubStore.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
commite6918187568dbd01842d8d1d2c808ce16a894239 (patch)
tree64f88b554b444a49f656b6c656111a145cbbaa28 /src/osd/scrubber/ScrubStore.h
parentInitial commit. (diff)
downloadceph-e6918187568dbd01842d8d1d2c808ce16a894239.tar.xz
ceph-e6918187568dbd01842d8d1d2c808ce16a894239.zip
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/osd/scrubber/ScrubStore.h')
-rw-r--r--src/osd/scrubber/ScrubStore.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/osd/scrubber/ScrubStore.h b/src/osd/scrubber/ScrubStore.h
new file mode 100644
index 000000000..567badf60
--- /dev/null
+++ b/src/osd/scrubber/ScrubStore.h
@@ -0,0 +1,63 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
+#ifndef CEPH_SCRUB_RESULT_H
+#define CEPH_SCRUB_RESULT_H
+
+#include "common/map_cacher.hpp"
+#include "osd/SnapMapper.h" // for OSDriver
+
+namespace librados {
+struct object_id_t;
+}
+
+struct inconsistent_obj_wrapper;
+struct inconsistent_snapset_wrapper;
+
+namespace Scrub {
+
+class Store {
+ public:
+ ~Store();
+ static Store* create(ObjectStore* store,
+ ObjectStore::Transaction* t,
+ const spg_t& pgid,
+ const coll_t& coll);
+ void add_object_error(int64_t pool, const inconsistent_obj_wrapper& e);
+ void add_snap_error(int64_t pool, const inconsistent_snapset_wrapper& e);
+
+ // and a variant-friendly interface:
+ void add_error(int64_t pool, const inconsistent_obj_wrapper& e);
+ void add_error(int64_t pool, const inconsistent_snapset_wrapper& e);
+
+ bool empty() const;
+ void flush(ObjectStore::Transaction*);
+ void cleanup(ObjectStore::Transaction*);
+
+ std::vector<ceph::buffer::list> get_snap_errors(
+ int64_t pool,
+ const librados::object_id_t& start,
+ uint64_t max_return) const;
+
+ std::vector<ceph::buffer::list> get_object_errors(
+ int64_t pool,
+ const librados::object_id_t& start,
+ uint64_t max_return) const;
+
+ private:
+ Store(const coll_t& coll, const ghobject_t& oid, ObjectStore* store);
+ std::vector<ceph::buffer::list> get_errors(const std::string& start,
+ const std::string& end,
+ uint64_t max_return) const;
+ private:
+ const coll_t coll;
+ const ghobject_t hoid;
+ // a temp object holding mappings from seq-id to inconsistencies found in
+ // scrubbing
+ OSDriver driver;
+ mutable MapCacher::MapCacher<std::string, ceph::buffer::list> backend;
+ std::map<std::string, ceph::buffer::list> results;
+};
+} // namespace Scrub
+
+#endif // CEPH_SCRUB_RESULT_H