fix(txn): discard partial writes from failed EXEC commands#3556
fix(txn): discard partial writes from failed EXEC commands#3556advisedy wants to merge 2 commits into
Conversation
|
Hi @PragmaTwice, this PR tries to fix #3555 with command-level savepoints during EXEC so a failed write does not leave partial ops in the shared batch. Would you mind taking a look when you have time? |
|
@PragmaTwice, Thanks for triggering CI. The only failure is : This matches the known flake tracked in #3515 and is unrelated to this PR. The new test in Could you please re-run the failed jobs when you have a chance? |
|
|
Hi @mapleFU , quick question — all CI checks pass, and I've added Does that mean I can ignore the SonarCloud coverage failure here? Thanks! |
|
I'm quite busy these days, will review before 7.16 night |
SonarCloud failure is not a blocker. Reviewer will decide if it's good to merge. |


Summary
Fixes #3555.
Add command-level RocksDB savepoints during
EXECso a failed write commandcannot leave partial ops in the shared transaction batch.
Changes
Storage::{Set,Pop,Rollback}TxnSavePointaround the transaction write batchConnection::ExecuteCommandsforkCmdWriteduringEXECscripting.ccEVAL/FCALLwithkCmdSkipTxnSavepointso outer script errors do notroll back already successful nested writes
EXECaborts the shared batch and returns errors forthe queued command list
Tests
Go cases in
tests/gocase/unit/multi/multi_test.go:HSETunderwrite_batch_max_bytesleaves no partialhash fields; the following
SETstill commitsEVALruntime error keeps a previously successful nestedSETredis.pcallrolls back only that command; alater nested
SETstill commits