Skip to content

fix(sync): background pin path logs a successful capsule download while storing nothing #341

Description

@MichaelTaylor3d

Task

The background pin path logs a successful download for an operation that stored nothing.

Observed on a real two-host EC2 run (run id mvp4-20260824-160219, dig-node v0.145.0 from the
released .deb):

whole-store sync downloaded a capsule ... bytes=134968615

Nothing was stored. The CLI sync trigger path reports the same underlying failure honestly; only
the background path claims success.

Why this is worth a ticket rather than a comment

Diagnosing from logs alone would mislead — and logs are the only surface available on a headless node,
which is exactly where this path runs. An operator reading that line concludes the capsule is resident and
moves on to debug the wrong layer. The e2e lane that found it was chasing an unrelated question and hit
this by comparing two surfaces that disagreed.

It also meets the bar on its own: a shipped surface that asserts a fact the system does not have. That
the fact is "your content downloaded" rather than a balance does not change the class — the honest
alternative was available and the CLI path already emits it.

The two surfaces disagreeing is the tell. One of them is wrong, and it is the one with no human in the
loop.

Context

  • Producer: the background pin / whole-store sync path (contrast with the CLI sync trigger path, which
    is correct — copy its shape rather than inventing one).
  • The byte count in the message (134968615) is close to but not equal to the capsule that genuinely
    moved in the same session (134,968,945 bytes, byte-exact C→A over mTLS). Worth checking whether the
    logged figure is bytes received being reported as bytes stored — that would explain both the message
    and the discrepancy.

Scope

Make the background path report what actually happened. Prefer the CLI path's existing honest wording over
new wording. If a partial download genuinely occurred, say that — a resumable partial is a real state
(§2.6's temp-file/resume model), and "downloaded" is not how to describe it.

Do not fix this by silencing the log. An operator with no line at all is better off than one with a
false line, but a correct line is better than both.

Evidence

A test asserting the emitted log line for a failed store — not that the failure path is reachable.
Read a passed-count, never an ok. Include the negative: the old wording must fail the new assertion, or
it proves nothing.

Cross-references

Found during: https://github.com/DIG-Network/dig_ecosystem/issues/2191 (the miss-contract e2e leg)
Fleet evidence: run mvp4-20260824-160219

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions