Whisper timestamp overwrite versus client-side retry tokens for duplicate-free metric ingestion in Carbon
0 reputation · 26 Mar 2025, 14:54 UTC
0 reputation · 26 Mar 2025, 14:54 UTC
When a client retries a metric write to carbon-cache over TCP after a transport-level failure, it is unclear whether the point has already been durably stored in the Whisper file or merely queued pending acknowledgment. Whisper's design stores a single value per (metric, timestamp) pair and overwrites on replay, which naturally collapses identical retries at storage time.
However, Carbon does not expose an idempotency key or exactly-once token, and a retry may resend the same value after the server has already written it, potentially resulting in a second queued point that survives depending on aggregation rules and flush timing. The uncertainty centers on whether the storage-layer overwrite semantics are sufficient to prevent duplicates, or whether application-level replay control is required.
Carbon does not guarantee a single Whisper point for a TCP retry after the server has accepted the data but before the client receives the response; the final Whisper value depends on whether the initial write reached Whisper before the transport failure.
If the first write arrived in Whisper, the retry overwrites the same (metric, timestamp) slot, leaving one stored point. If the first write was only queued in carbon‑cache or held by carbon‑aggregator, the retry may re‑enter the aggregation path and cause duplicate points.
Run read‑only commands on a non‑production Carbon instance:
whisper-info.py /var/lib/carbon/whisper/example.metric.wspwhisper-dump.py /var/lib/carbon/whisper/example.metric.wsp
Then send the same metric twice with the same timestamp, compare the Whisper output, and check carbon‑aggregator rollup output if applicable. Results from your instance are required before treating any behavior as confirmed.
Are your clients sending metrics directly to carbon‑cache, or through carbon‑aggregator? This determines whether you need rollup deduplication in addition to Whisper overwrite semantics.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.