aboutsummaryrefslogtreecommitdiff
path: root/zenstore/include
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-09-21 14:17:23 +0200
committerStefan Boberg <[email protected]>2021-09-21 14:17:23 +0200
commitc35c36bf81cae52dacf8e3f8dc858bb376ca424b (patch)
tree891475f41d4c8be86cbb3f2bd6c269f596ff668d /zenstore/include
parentRemoved scrubbing from CasImpl::Initialize since this is triggered by higher ... (diff)
downloadzen-c35c36bf81cae52dacf8e3f8dc858bb376ca424b.tar.xz
zen-c35c36bf81cae52dacf8e3f8dc858bb376ca424b.zip
Wired up scrubbing to more higher level services
Also moved sharding logic for filecas into a function to redduce cut/pasta
Diffstat (limited to 'zenstore/include')
-rw-r--r--zenstore/include/zenstore/CAS.h14
-rw-r--r--zenstore/include/zenstore/cidstore.h4
2 files changed, 15 insertions, 3 deletions
diff --git a/zenstore/include/zenstore/CAS.h b/zenstore/include/zenstore/CAS.h
index bb310b179..ed235bb4b 100644
--- a/zenstore/include/zenstore/CAS.h
+++ b/zenstore/include/zenstore/CAS.h
@@ -8,6 +8,7 @@
#include <zencore/iobuffer.h>
#include <zencore/iohash.h>
#include <zencore/refcount.h>
+#include <zencore/timer.h>
#include <atomic>
#include <filesystem>
#include <memory>
@@ -37,12 +38,22 @@ public:
private:
};
+/** Context object for data scrubbing
+ *
+ * Data scrubbing is when we traverse stored data to validate it and
+ * optionally correct/recover
+ */
+
class ScrubContext
{
public:
- virtual void ReportBadChunks(std::span<IoHash> BadChunks);
+ virtual void ReportBadChunks(std::span<IoHash> BadChunks);
+ inline uint64_t ScrubTimestamp() const { return m_ScrubTime; }
+ inline bool RunRecovery() const { return m_Recover; }
private:
+ uint64_t m_ScrubTime = GetHifreqTimerValue();
+ bool m_Recover = true;
};
class CasChunkSet
@@ -78,6 +89,7 @@ public:
protected:
CasStoreConfiguration m_Config;
+ uint64_t m_LastScrubTime = 0;
};
ZENCORE_API CasStore* CreateCasStore();
diff --git a/zenstore/include/zenstore/cidstore.h b/zenstore/include/zenstore/cidstore.h
index 49f2bf99a..f4439e083 100644
--- a/zenstore/include/zenstore/cidstore.h
+++ b/zenstore/include/zenstore/cidstore.h
@@ -50,8 +50,8 @@ public:
// TODO: add batch filter support
private:
- struct CidState;
- std::unique_ptr<CidState> m_Impl;
+ struct Impl;
+ std::unique_ptr<Impl> m_Impl;
};
} // namespace zen