gpdb
gpdb copied to clipboard
Avoid replay dtx info in checkpoint for newly expanded segments
gpexpand will create new segment by doing pg_basebackup from coordinator, and DTX can be started in coordinator during that phase. So the newly added segment's checkpoint XLOG may contain DTX info, which will result in the start of the segment failed. The definition of CheckpointExtendedRecord is different between GPDB6 and GPDB7. In GPDB6 there is an extra field prepared_transaction_agg_state to store all the prepared transactions on the checkpoint.
typedef struct CheckpointExtendedRecord
{
struct TMGXACT_CHECKPOINT *dtxCheckpoint;
uint32 dtxCheckpointLen;
struct prepared_transaction_agg_state *ptas;
} CheckpointExtendedRecord;
In GPDB6 we should skip XLogProcessCheckpointRecord for QE, But should not skip SetupCheckpointPreparedTransactionList.
backport form https://github.com/greenplum-db/gpdb/pull/17346
Backport looks good.