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:
@@ -619,9 +619,16 @@ impl DedupService {
|
|||||||
self.backend.initialize().await?;
|
self.backend.initialize().await?;
|
||||||
|
|
||||||
// The reap statement is assembled from the registered reference
|
// The reap statement is assembled from the registered reference
|
||||||
// sources, so it is not greppable in the source tree. Log it once so an
|
// sources, so it is not greppable in the source tree. It DELETES
|
||||||
// operator can read — or paste into psql — exactly what GC will delete.
|
// manifests, so log it unconditionally at info rather than hiding it
|
||||||
tracing::debug!(
|
// 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",
|
target: "oxicloud::dedup",
|
||||||
sources = ?self
|
sources = ?self
|
||||||
.reference_registry
|
.reference_registry
|
||||||
@@ -629,8 +636,12 @@ impl DedupService {
|
|||||||
.iter()
|
.iter()
|
||||||
.map(|s| s.source_name())
|
.map(|s| s.source_name())
|
||||||
.collect::<Vec<_>>(),
|
.collect::<Vec<_>>(),
|
||||||
"manifest reap statement:\n{}",
|
statement = %self
|
||||||
self.manifest_reap_sql,
|
.manifest_reap_sql
|
||||||
|
.split_whitespace()
|
||||||
|
.collect::<Vec<_>>()
|
||||||
|
.join(" "),
|
||||||
|
"🧹 manifest reap predicate registered"
|
||||||
);
|
);
|
||||||
|
|
||||||
let blob_count: i64 = sqlx::query_scalar("SELECT COUNT(*) FROM storage.blobs")
|
let blob_count: i64 = sqlx::query_scalar("SELECT COUNT(*) FROM storage.blobs")
|
||||||
|
|||||||
Reference in New Issue
Block a user