Repository navigation
chore(sync): key record wait and drain retry logs by a hashed recording id - #24881
Conversation
…ng id The record_capture_pending log line and the record_pending drain retry line carried no per-recording key, so the 2026-11-07 post-fix read could not group ~2.3k waits per 15 min by recording or join a stuck upload to its admission retry reason without row-level user-data reads. Add a 16-hex prefix of the record content hash (the intake key) and of the segment id. Both are one-way hashes; no uid or conversation id is logged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017CeWy3fepTWkruwXu3wafS
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
audio_coverage_unproven was ~43% of record_capture_pending after the account-pause fix, with nothing saying whether the phone holds audio the record lacks or the overlap simply differs. Log a static cause from the coverage check. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017CeWy3fepTWkruwXu3wafS
There was a problem hiding this comment.
All reported issues were addressed
You’re at about 94% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact [email protected].
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
…g line The segment id is sha256(content:0), not the record content hash the sync pending line logs, so the two could not be joined. Log the job's record_content_id prefix instead (cubic review). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017CeWy3fepTWkruwXu3wafS
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fc7744897d
ℹ️ 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".
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017CeWy3fepTWkruwXu3wafS
Requested by David · project thread
What changed and why
After #24853 shipped,
record_capture_pending503s on/v2/sync-local-filesheld steady at about 2.3k per 15 minutes on 2026-11-07, roughly halfrecord_jobs_missingand halfaudio_coverage_unproven. Three questions couldn't be answered from the logs:Answering any of them meant row-level reads of user data.
This is a log-only change:
event=sync_record_upload outcome=pendingaddsrecord=<16 hex>. That's a prefix of the record content hashsha256("record-v1:{uid}:{cid}"), which is also the intake keybp_<content>. A wait raised before the record identity is known logsrecord=-.event=batch_live_admission outcome=retryadds the samerecord=<16 hex>key, taken from the record_pending job'srecord_content_id, so a pending upload can be joined to its drain retry reason.New
event=sync_record_coverage outcome=unproven cause=<cause>before anaudio_coverage_unprovenwait, with a static cause:wal_audio_outside_record: the WAL has audio before or between the record's units.wal_audio_past_record: the WAL runs past the record's last unit.audio_bytes_differ: the overlapping samples differ.record_unit_exhausted: no overlapping record samples were left.This separates a phone holding audio the record lacks from a decode or alignment mismatch, and the two need different fixes.
The key is a one-way hash. No uid, conversation id, audio or error text is logged. Status codes, bodies, retention and admission behavior are unchanged.
Product invariants affected
none
How it was verified
backend/:python -m pytest tests/unit/test_sync_admission_diagnostics.py tests/unit/test_record_drain_barrier_backoff.py tests/unit/test_record_drain_privacy_defer.py→ 42 passed.scripts/backend-python-format --writeon the changed files.scripts/pr-preflight --pr-body-file→ 36 checks passed.Tests
test_sync_admission_diagnostics.py:record=key: the content prefix, or-for an owner-context mismatch. Neither the uid nor the conversation id appears in the line._coveredlogs no cause when the audio is covered. It logs the right cause for WAL audio before the record, after the record, or with differing bytes.test_record_drain_barrier_backoff.py: the drain retry line ends with the job'srecord=content prefix and doesn't contain the owner id.UI evidence
UI-Evidence: none -- no UI change
🤖 Generated with Claude Code
https://claude.ai/code/session_017CeWy3fepTWkruwXu3wafS