On Mon, Jan 31, 2022 at 11:50 AM Kyotaro Horiguchi
<horikyota.ntt@gmail.com> wrote:
>
> SnapBUildInitialSnapshot tries to store XIDS of both top and sub
> transactions into snapshot->xip array but the array is easily
> overflowed and CREATE_REPLICATOIN_SLOT command ends with an error.
>
> To fix this, this patch is doing the following things.
>
> - Use subxip array instead of xip array to allow us have larger array
> for xids. So the snapshot is marked as takenDuringRecovery, which
> is a kind of abuse but largely reduces the chance of getting
> "initial slot snapshot too large" error.
>
> - Still if subxip is overflowed, retry with excluding subtransactions
> then set suboverflowed. This causes XidInMVCCSnapshot (finally)
> scans over subxip array for targetted top-level xid.
>
> We could take another way: make a !takenDuringRecovery snapshot by
> using xip instead of subxip. It is cleaner but it has far larger
> chance of needing to retry.
>
> (renamed the patch since it represented a part of the patch)
>
Thanks for the updated version. I will look into it this week.
--
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com