• D
    Fix overflow of shmCommittedGxactArray on standby (#11071) · afcf30be
    dreamedcheng 提交于
    Previously, standby will replay checkpoint XLOG record's DTX info
    in function XLogProcessCheckpointRecord. However, is some certain cases,
    it will cause anomaly: When a DTX has flushed FORGET COMMITTED XLOG into
    disk, but didn't change its own state to DTX_STATE_INSERTED_FORGET_COMMITTED.
    If at this very moment, checkpoint process is calculating DTX info, it
    will include the DTX into its XLOG record. So when standby replaying this
    checkpoint XLOG record from master, it will add an already forgotten GID to
    shmCommittedGxactArray again, which may cause the overflow of shmCommittedGxactArray.
    
    Since DTX info stored in checkpoint XLOG record has been populated earlier in
    ReadCheckpointRecord(), there is no need to call XLogProcessCheckpointRecord()
    again during recovery.
    Co-authored-by: Nwuchengwen <wcw190496@alibaba-inc.com>
    Co-authored-by: NDenis Smirnov <sd@arenadata.io>
    afcf30be
xlog.c 402.0 KB