fix(memiavl): fail the snapshot rewrite when a tree write panics #135
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 235 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 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.327
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #135"
general
weight: 0.35
thomas-nguy
What
memiavl's
MultiTree.WriteSnapshotWithContextnow fails when a tree write panics, and it waits for every tree writer before it returns. It writes the trees through a newRunWorkerGrouphelper instead of pond'sGroupContext.Issue
pond recovers a task's panic and only logs it. So when one tree's snapshot write panics, the rewrite counts it as a success. It writes the metadata and points
currentat a snapshot that is missing that tree. The nextCommitfails withbackground snapshot rewriting failed: open .../current/<tree>/metadata: no such file or directory, and reopening the DB fails the same way. The node halts and can't restart without a manual fix.There is a second bug.
GroupContext.Waitreturns as soon as its context is canceled, either by the caller or by the first failing task. The caller then goes on, andRewriteSnapshotWithContextremoves the tmp dir while other writers are still running.Solution
RunWorkerGroupruns one task per tree on a plain pond group and waits for all of them. A panic becomes an error that names the tree. The first failure cancels a derived context, so queued trees are skipped, as before. All errors are joined, so the log may also show onecontext canceledper skipped tree.WriteSnapshotWithContextnow also checks the caller's ctx after the wait, so a cancel is reported even when every write succeeded.currentstays put andCommitgoes on.RunWorkerGroup,runWorkerTaskandWriteSnapshotWithContextcode, plus the same multitree tests. When #107 merges master,multitree.goandmultitree_test.goauto-merge. #102 has its own wait-for-all version (no panic recovery). When it syncs, it should take this side and drop thesyncimport, as #107 does.