Fix overflow of shmCommittedGxactArray on standby (#11071)
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>
Showing
想要评论请 注册 或 登录