Return an error instead of panicking on a short revision key #512
All Vouch review confidence checks passed
Residual risk 0.09 = Change Risk (0.29) × (1 − Review Confidence (0.70)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.29 · 61 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.55 · 4 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.247
Real PR Conversation Timeline
6 items
/ok-to-test
/lgtm
Thanks @arpitjain099 for fixing this!
/cc @hwdef
Approved
Approved these changes.
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: <a href="https://github.com/etcd-io/auger/pull/512#" title="Author self-approved">arpitjain099</a>, <a href="https://github.com/etcd-io/auger/pull/512#pullrequestreview-4973163714" title="Approved">siyuanfoundation</a>
The full list of commands accepted by this bot can be found here.
The pull request process is described here
<details >
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
</details>
<!-- META={"approvers":[]} -->
siyuanfoundation
arpitjain099
bytesToRevlength-checks only the tombstone byte. The two reads above it are unguarded, so any entry in the key bucket shorter than 17 bytes takes the process down:There is no
recover()anywhere in the non-test code, so this is a hard abort rather than an error. It matters because it fires on exactly the input auger exists to handle: a truncated or damaged database.This is the same shape as #365, which was the nil-bucket panic one line away in the same
walkcallback. I followed the fix from737ef47deliberately, so the error string matchesbucketOrError's style and the tests use the existingcreateTestDBhelper.After the change:
exit code 1, and a real fixture database still analyzes normally.
Two call sites are covered, since both can reach it.
walkhandles the key bucket, andgetCompactRevisionreadsfinishedCompactRevfrom the meta bucket where the existing guard islen != 0rather than a length floor. There is a test for each, and both panic without the fix.While in there I also switched the tombstone read to the
markBytePositionandmarkTombstoneconstants that were already declared next torevBytesLenbut unused.bytesToRevis unexported and the signature change is contained to those two callers.walk's exported behaviour is unchanged, since it already returned an error.go build ./...,gofmtandgo test ./pkg/...are clean.