fix(utxo/aerospike): surface BatchOperate error in storeExternallyWithLock#784
Merged
ordishs merged 1 commit intoMay 5, 2026
Conversation
…hLock (refs #4588)
Contributor
|
🤖 Claude Code Review Status: Complete This PR fixes a critical bug where top-level BatchOperate failures were silently ignored, causing transactions to appear successful when they actually failed to write to Aerospike. Review Result: No issues found The implementation is solid:
|
|
Contributor
Benchmark Comparison ReportBaseline: Current: Summary
All benchmark results (sec/op)
Threshold: >10% with p < 0.05 | Generated: 2026-04-29 03:12 UTC |
icellan
approved these changes
Apr 29, 2026
freemans13
approved these changes
May 5, 2026
4 tasks
oskarszoon
pushed a commit
that referenced
this pull request
May 12, 2026
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Closes #4588.
Summary
storeExternallyWithLockdiscarded the top-level error froms.client.BatchOperate(...)with_ =. If the entire batch call failed (connection lost, timeout), per-record error checking ran against an unpopulated result set,hasFailuresstayed false, and the function reported transaction creation as successful even though no records were written.Fix
Capture the top-level error from
BatchOperate. On non-nil, send a wrappedProcessingErrortobItem.doneand return immediately. Per-record error iteration is unchanged for the success-of-call path.A small test seam (
batchOperateFnfield +SetBatchOperateFnhelper) was added so the regression test can drive the BatchOperate-failure path without TestContainers-level connection disruption. Production code path defaults tos.client.BatchOperatewhen the override is unset.Test plan
aerospike.Errorvia the test seam; assertsbItem.donereceives a non-nilProcessingErrorreferencing the tx hash.bItem.donegot nil).go test -race ./stores/utxo/aerospike/...passes.