hbswcsyzx commented on PR #1884: URL: https://github.com/apache/cloudberry/pull/1884#issuecomment-5202434303
Thanks for identifying these issues. They exposed a real flaw in the earlier approach, which removed the GXID from the proc array before QE commit notification. That approach has been superseded by the current head `4dc2724`. The current fix preserves the original ordering. Before the first QE commit notification, the QD sets a `commitInProgress` marker under exclusive `ProcArrayLock`. A QD distributed snapshot either acquires the lock before the marker and records the GXID as in progress, or acquires it after the marker and waits on the existing GXID heavyweight lock. The wait finishes only after the QE notifications return and normal QD cleanup reaches the existing proc-array and lock-release points. Therefore `ProcArrayEndGxact()` is not moved, `includeInCkpt` remains set until the existing FORGET path, and checkpoint/crash recovery retains its original GXID list behavior. The one-phase path sets the same marker before `COMMIT ONE PHASE`, and the phase-2 marker covers the complete broadcast and retry loop. I also changed the wait path to use `pg_atomic_read_u64()` for `atomic_gxid`. Targeted Docker validation covered the isolation2 regression, partial and retrying phase-2 commits, one-phase commit, checkpoint/crash recovery, and a 16-writer/8-reader repeatable-read workload. The isolation2 test passed 2/2; the recovery test retained committed data and left no prepared transactions. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
