diff options
| author | Stefan Boberg <[email protected]> | 2021-11-01 19:03:42 +0100 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-11-01 19:03:54 +0100 |
| commit | f3bd5be8beeae2bbc5a0c0612407ce8e72a9b8cf (patch) | |
| tree | 368ce9f28b80900a8e424a697d3b9ee8a46b76f3 /zenstore/filecas.cpp | |
| parent | project: fixed logging of new oplog entries (again) to be easier to scan (diff) | |
| download | zen-f3bd5be8beeae2bbc5a0c0612407ce8e72a9b8cf.tar.xz zen-f3bd5be8beeae2bbc5a0c0612407ce8e72a9b8cf.zip | |
gc: added DeletionMode flag to allow gc dry runs
Diffstat (limited to 'zenstore/filecas.cpp')
| -rw-r--r-- | zenstore/filecas.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/zenstore/filecas.cpp b/zenstore/filecas.cpp index c83f87c1b..0efdc96f5 100644 --- a/zenstore/filecas.cpp +++ b/zenstore/filecas.cpp @@ -557,13 +557,24 @@ FileCasStrategy::CollectGarbage(GcContext& GcCtx) if (ChunksToDelete.empty()) { + ZEN_INFO("nothing to delete"); + return; } ZEN_INFO("deleting file CAS garbage: {} chunks ({})", ChunksToDelete.size(), NiceBytes(ChunksToDeleteBytes)); + if (GcCtx.IsDeletionMode() == false) + { + ZEN_INFO("NOTE: not actually deleting anything since deletion is disabled"); + + return; + } + for (const IoHash& Hash : ChunksToDelete) { + ZEN_TRACE("deleting chunk {}", Hash); + std::error_code Ec; DeleteChunk(Hash, Ec); |