cloudberry
cloudberry copied to clipboard
Enhancement: Commit sequence numbers for distributed transactions
This feature request originated from Ashwin's comment here: https://github.com/greenplum-db/gpdb/pull/10177#issuecomment-645690791. It seemed worth tracking as an issue.
The basic idea is to eliminate distributed in-progress array and determine tuple visibility by comparing the tuple's CSN with the snapshot's CSN. CSN is a monotonically increasing 64-bit integer. Tuples continue to record local transaction IDs. CSNs are generated and assigned during commit and a mapping between the local XID and its CSN needs to be maintained (this is similar to distributed transaction log).
CSN related proposals for PostgreSQL:
- https://www.postgresql.org/message-id/171f45038c4.bf66538a492783.4211925925146471362%40highgo.ca
- https://www.postgresql.org/message-id/07b2c899-4ed0-4c87-1327-23c750311248%40postgrespro.ru
- https://www.postgresql.org/message-id/[email protected]