gpdb icon indicating copy to clipboard operation
gpdb copied to clipboard

Avoid replay dtx info in checkpoint for newly expanded segments

Open zxuejing opened this issue 1 year ago • 1 comments

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

zxuejing avatar Apr 28 '24 09:04 zxuejing

Backport looks good.

haolinw avatar Apr 29 '24 02:04 haolinw