fix: improve delete_metrics_splits error handling and doc comments#6280
fix: improve delete_metrics_splits error handling and doc comments#6280
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…link Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fcf8e650a7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| LEFT JOIN metrics_splits | ||
| ON metrics_splits.index_uid = $1 | ||
| AND metrics_splits.split_id = input_splits.split_id | ||
| ), |
There was a problem hiding this comment.
Lock metrics rows before deriving not_deletable state
delete_metrics_splits computes input_splits from metrics_splits without FOR UPDATE, unlike the non-metrics delete_splits flow it is mirroring. Under concurrent mark_metrics_splits_for_deletion updates, this statement can evaluate an older split_state snapshot and return FailedPrecondition for splits that were already transitioned to MarkedForDeletion by a racing transaction, causing spurious delete failures and retry churn. Adding row locking in the state-read CTE (as done in delete_splits) avoids this stale-state race.
Useful? React with 👍 / 👎.
Summary
delete_metrics_splitsin postgres metastore to distinguish "not found" (warn + succeed) from "not deletable" (FailedPrecondition), matching the non-metricsdelete_splitspatternrow_keys_protodoc comment to use plain code span instead of broken rustdoc linkSplit out from #6247 (docs PR) where these code changes didn't belong.
Test plan
🤖 Generated with Claude Code