aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/include
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2023-12-11 11:48:23 +0100
committerGitHub <[email protected]>2023-12-11 11:48:23 +0100
commit37920b41048acffa30cf156d7d36bfc17ba15c0e (patch)
tree15c4f652a54470e359a9b9dcd194e89cb10eaaf9 /src/zenstore/include
parentmulti-line logging improvements (#597) (diff)
downloadzen-37920b41048acffa30cf156d7d36bfc17ba15c0e.tar.xz
zen-37920b41048acffa30cf156d7d36bfc17ba15c0e.zip
improved scrubbing of oplogs and filecas (#596)
- Improvement: Scrub command now validates compressed buffer hashes in filecas storage (used for large chunks) - Improvement: Added --dry, --no-gc and --no-cas options to zen scrub command - Improvement: Implemented oplog scrubbing (previously was a no-op) - Improvement: Implemented support for running scrubbint at startup with --scrub=<options>
Diffstat (limited to 'src/zenstore/include')
-rw-r--r--src/zenstore/include/zenstore/gc.h4
-rw-r--r--src/zenstore/include/zenstore/scrubcontext.h5
2 files changed, 8 insertions, 1 deletions
diff --git a/src/zenstore/include/zenstore/gc.h b/src/zenstore/include/zenstore/gc.h
index 698b0d4e8..30dd97ce8 100644
--- a/src/zenstore/include/zenstore/gc.h
+++ b/src/zenstore/include/zenstore/gc.h
@@ -492,6 +492,8 @@ public:
{
bool SkipGc = false;
std::chrono::seconds MaxTimeslice = std::chrono::seconds::max();
+ bool SkipDelete = false;
+ bool SkipCas = false;
};
bool TriggerScrub(const TriggerScrubParams& Params);
@@ -508,7 +510,7 @@ private:
GcVersion UseGCVersion,
uint32_t CompactBlockUsageThresholdPercent,
bool Verbose);
- void ScrubStorage(bool DoDelete, std::chrono::seconds TimeSlice);
+ void ScrubStorage(bool DoDelete, bool SkipCid, std::chrono::seconds TimeSlice);
LoggerRef Log() { return m_Log; }
virtual bool AreDiskWritesAllowed() const override { return !m_AreDiskWritesBlocked.load(); }
DiskSpace CheckDiskSpace();
diff --git a/src/zenstore/include/zenstore/scrubcontext.h b/src/zenstore/include/zenstore/scrubcontext.h
index cefaf0888..2f28cfec7 100644
--- a/src/zenstore/include/zenstore/scrubcontext.h
+++ b/src/zenstore/include/zenstore/scrubcontext.h
@@ -38,15 +38,20 @@ public:
inline uint64_t ScrubbedBytes() const { return m_ByteCount; }
HashKeySet BadCids() const;
+ bool IsBadCid(const IoHash& Cid) const;
inline bool RunRecovery() const { return m_Recover; }
inline void SetShouldDelete(bool DoDelete) { m_Recover = DoDelete; }
+ inline bool IsSkipCas() const { return m_SkipCas; }
+ inline void SetSkipCas(bool DoSkipCas) { m_SkipCas = DoSkipCas; }
+
inline WorkerThreadPool& ThreadPool() { return m_WorkerThreadPool; }
private:
uint64_t m_ScrubTime = GetHifreqTimerValue();
bool m_Recover = true;
+ bool m_SkipCas = false;
std::atomic<uint64_t> m_ChunkCount{0};
std::atomic<uint64_t> m_ByteCount{0};
mutable RwLock m_Lock;