Skip to content

metric(submitqueue): record creates whose callers accept an existing row as result=already_exists - #1167

Merged
roychying merged 2 commits into
mainfrom
chenghan.ying/storage-already-exists-metric
Dec 3, 2026
Merged

roychying merged 2 commits into
mainfrom
chenghan.ying/storage-already-exists-metric

Conversation

@roychying

@roychying roychying commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

Why?

Stores record a duplicate create as result=error, even where the caller treats ErrAlreadyExists as success. The gateway re-creates URI mappings and receipts on every request log, which leads to false "errors" right now in. Orchestrator redeliveries and lost races do the same. So store error rates can't be alerted on.

What?

Only the metric's result tag changes. Callers and returned errors are unchanged.

  • New storage.CompleteCreateMetricsOp records ErrAlreadyExists as result=already_exists; everything else goes through op.Complete.
  • Used by stores whose callers accept a duplicate: gateway request_uri/request_receipt; orchestrator request, request_batch, batch_dependent, build, path_build, speculation_path_set; tango signature.
  • Not used where the caller fails on a duplicate (gateway request_summary, orchestrator batch) or where Create has no caller (tango dictionary).

Test Plan

  • TestCompleteCreateMetricsOp, plus result-tag assertions in the gateway URI and receipt store tests.
  • bazel test passes for the storage, tango, gateway and orchestrator packages; make lint and make gazelle are clean.

Issue

@roychying roychying changed the title fix(submitqueue): record idempotent gateway creates of existing rows … fix(submitqueue): record idempotent gateway creates of existing rows as result=already_exists Dec 3, 2026
@roychying
roychying force-pushed the chenghan.ying/storage-already-exists-metric branch from 14be0c9 to 5616350 Compare December 3, 2026 04:46
@roychying roychying changed the title fix(submitqueue): record idempotent gateway creates of existing rows as result=already_exists metric(submitqueue): record creates whose callers accept an existing row as result=already_exists Dec 3, 2026
@roychying
roychying marked this pull request as ready for review December 3, 2026 21:43
@roychying
roychying requested review from a team and sbalabanov as code owners December 3, 2026 21:43
@roychying
roychying added this pull request to the merge queue Dec 3, 2026
Merged via the queue into main with commit 8bdf3f0 Dec 3, 2026
39 checks passed
@roychying
roychying deleted the chenghan.ying/storage-already-exists-metric branch December 3, 2026 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants