On Wed, Sep 20, 2023 at 11:46:45AM +0900, Kuwamura Masaki wrote: > I also found a bug (maybe). If we call `CreateRestartPoint()` during > crash-recovery, the assertion fails at ComputeXidHorizon() in procarray.c. > It's inherently orthogonal to the problem I already reported. So you can > reproduce this at HEAD with this procedure. > > 1. Start primary and standby server > 2. Modify checkpoint_timeout to 1h on standby > 3. Insert 10^10 records and concurrently run CHECKPOINT every second on > primary > 4. Do an immediate stop on both standby and primary at the end of the insert > 5. Modify checkpoint_timeout to 30 on standby > 6. Remove standby.signal on standby > 7. Restart standby (it will start crash-recovery) > 8. Assertion failure is raised shortly > > I think this is because `TruncateSUBTRANS();` in `CreateRestartPoint()` is > called but `StartupSUBTRANS()` isn't called yet. In `StartupXLOG()`, we > call > `StartupSUBTRANS()` if `(ArchiveRecoveryRequested && EnableHotStandby)`. > However, in `CreateRestartPoint()`, we call `TruncateSUBTRANS()` if > `(EnableHotStandby)`. I guess the difference causes this bug. The latter > possibly be called even crash-recovery while former isn't. > The attached patch 0002 fixes it. I think we could discuss about this bug > in > another thread if needed.
This is a known issue. I guess that the same as this thread and this CF entry: https://commitfest.postgresql.org/44/4244/ https://www.postgresql.org/message-id/flat/zarvomifjze7f...@paquier.xyz -- Michael
signature.asc
Description: PGP signature