On 2026-10-09, Zhijie Hou wrote: > Thanks for the explanation. I re-read the code and comments and have some > suggestions to simplify the code and improve some comments. I think we can > reduce the code in Kuroda-san's patch with a simpler loop: > > txn = ReorderBufferTXNByXid(rb, xid, false, NULL, InvalidXLogRecPtr, > false); > > for (int i = 0; txn == NULL && i < nsubxacts; i++) > txn = ReorderBufferTXNByXid(rb, subxacts[i], false, NULL, > InvalidXLogRecPtr, false); > > followed by a single early return covering all the skip cases: > > if (txn == NULL || !rbtxn_is_known_subxact(txn)) > return; > > I think this makes the code cleaner and shorter, and also fixes the BF failure > IIUC. > > I also rewrote some of the comments above > ReorderBufferCleanupAbortedSubTxnTupleCids(), using wording that's more > consistent with the rest of the codebase and simplifying the explanation of > logic that isn't directly related, hoping it reads better.
Hmm I had already made essentially the same changes locally plus a few others. I'll share my patches over the weekend. -- Álvaro Herrera
