aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/include
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2024-09-25 10:21:53 +0200
committerGitHub Enterprise <[email protected]>2024-09-25 10:21:53 +0200
commite27a5da5dae33f958a4b809a9e20a0af33c24f90 (patch)
tree3f22bdba794108fa2a4a4d5d1fc308a986b3483b /src/zenstore/include
parentexception safety when writing block (#168) (diff)
downloadzen-e27a5da5dae33f958a4b809a9e20a0af33c24f90.tar.xz
zen-e27a5da5dae33f958a4b809a9e20a0af33c24f90.zip
Add `gc-attachment-passes` option to zenserver (#167)
Added option `gc-attachment-passes` to zenserver Cleaned up GCv2 start and stop logs and added identifier to easily find matching start and end of a GC pass in log file Fixed project store not properly sorting references found during lock phase
Diffstat (limited to 'src/zenstore/include')
-rw-r--r--src/zenstore/include/zenstore/gc.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/zenstore/include/zenstore/gc.h b/src/zenstore/include/zenstore/gc.h
index 3f2f5448d..56965e3e3 100644
--- a/src/zenstore/include/zenstore/gc.h
+++ b/src/zenstore/include/zenstore/gc.h
@@ -201,7 +201,7 @@ public:
};
std::span<IoHash> KeepUnusedReferences(std::span<const IoHash> SortedUsedReferences, std::span<IoHash> SortedReferences);
-bool FilterReferences(GcCtx& Ctx, std::vector<IoHash>& InOutReferences);
+bool FilterReferences(GcCtx& Ctx, std::string_view Context, std::vector<IoHash>& InOutReferences);
/**
* @brief An interface to implement a lock for Stop The World (from writing new data)
@@ -451,6 +451,7 @@ struct GcSchedulerConfig
uint32_t CompactBlockUsageThresholdPercent = 90;
bool Verbose = false;
bool SingleThreaded = false;
+ uint16_t AttachmentPassCount = 1;
};
struct GcSchedulerState
@@ -477,6 +478,9 @@ struct GcSchedulerState
std::optional<GcResult> LastLightweightGCV2Result;
std::optional<GcResult> LastFullGCV2Result;
+
+ IoHash LastFullAttachmentRangeMin = IoHash::Zero;
+ IoHash LastFullAttachmentRangeMax = IoHash::Max;
};
class DiskUsageWindow
@@ -525,8 +529,8 @@ public:
std::optional<uint32_t> CompactBlockUsageThresholdPercent;
std::optional<bool> Verbose;
std::optional<bool> SingleThreaded;
- IoHash AttachmentRangeMin = IoHash::Zero;
- IoHash AttachmentRangeMax = IoHash::Max;
+ std::optional<IoHash> AttachmentRangeMin;
+ std::optional<IoHash> AttachmentRangeMax;
};
bool TriggerGc(const TriggerGcParams& Params);
@@ -561,7 +565,7 @@ private:
LoggerRef Log() { return m_Log; }
virtual bool AreDiskWritesAllowed() const override { return !m_AreDiskWritesBlocked.load(); }
DiskSpace CheckDiskSpace();
- void AppendGCLog(GcClock::TimePoint GcStartTime, const GcSettings& Settings, const GcResult& Result);
+ void AppendGCLog(std::string_view Id, GcClock::TimePoint GcStartTime, const GcSettings& Settings, const GcResult& Result);
LoggerRef m_Log;
GcManager& m_GcManager;
@@ -569,6 +573,9 @@ private:
GcClock::TimePoint m_LastGcTime{};
GcClock::TimePoint m_LastLightweightGcTime{};
GcClock::TimePoint m_LastGcExpireTime{};
+ IoHash m_LastFullAttachmentRangeMin = IoHash::Zero;
+ IoHash m_LastFullAttachmentRangeMax = IoHash::Max;
+ uint8_t m_AttachmentPassIndex;
std::chrono::milliseconds m_LastFullGcDuration{};
GcStorageSize m_LastFullGCDiff;