fix(dedup): log the manifest reap predicate at info, not debug

The reap statement is assembled from the registered reference sources,
so it cannot be grepped out of the source tree — and it DELETES
manifests. Hiding it behind a debug filter an operator has to know to
enable was the wrong default: if what GC considers "referenced" ever
changes, that has to be visible on the next boot without anyone going
looking for it.

Reported in testing: `RUST_LOG=info,oxicloud::dedup=debug` did not
surface it, while a global `RUST_LOG=debug` did — at the cost of an
unusably noisy boot. Rather than have operators carry a special filter
for a line describing a destructive statement, promote it.

The statement is whitespace-collapsed into a single `statement` field
so a multi-line query does not sprawl across the boot log, and the
registered `sources` are logged alongside it — that list is what
actually determines the predicate, so a change to it is the thing worth
noticing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Edouard Vanbelle
2026-08-23 17:19:08 +02:00
parent 213e1c553a
commit 7e8029027e
+16 -5
View File
@@ -619,9 +619,16 @@ impl DedupService {
self.backend.initialize().await?;
// The reap statement is assembled from the registered reference
// sources, so it is not greppable in the source tree. Log it once so an
// operator can read — or paste into psql — exactly what GC will delete.
tracing::debug!(
// sources, so it is not greppable in the source tree. It DELETES
// manifests, so log it unconditionally at info rather than hiding it
// behind a filter an operator has to know to enable — if what GC
// considers "referenced" ever changes, that must be visible on the
// next boot without anyone going looking.
//
// Whitespace-collapsed to a single field so a multi-line query does
// not sprawl across the boot log; expand it with
// `sed 's/ AND / AND\n /g'` or just paste it into psql.
tracing::info!(
target: "oxicloud::dedup",
sources = ?self
.reference_registry
@@ -629,8 +636,12 @@ impl DedupService {
.iter()
.map(|s| s.source_name())
.collect::<Vec<_>>(),
"manifest reap statement:\n{}",
self.manifest_reap_sql,
statement = %self
.manifest_reap_sql
.split_whitespace()
.collect::<Vec<_>>()
.join(" "),
"🧹 manifest reap predicate registered"
);
let blob_count: i64 = sqlx::query_scalar("SELECT COUNT(*) FROM storage.blobs")