From: | Bowen Shi <zxwsbg12138(at)gmail(dot)com> |
---|---|
To: | Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com> |
Cc: | pgsql-bugs(at)lists(dot)postgresql(dot)org |
Subject: | Re: BUG #17744: Fail Assert while recoverying from pg_basebackup |
Date: | 2023-02-01 02:47:32 |
Message-ID: | CAM_vCufpoQrPyVe2qpLtdeBxXOYRTiBmakfA_Qraaiu0Tk4x=Q@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
Thanks for your advice!
I wonder that whether there are some potential risks if we just
compiling the PG code without `--enable-cassert.
regards.
Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com> 于2023年1月13日周五 17:36写道:
>
> At Tue, 10 Jan 2023 07:45:45 +0000, PG Bug reporting form <noreply(at)postgresql(dot)org> wrote in
> > #2 0x0000000000b378e9 in ExceptionalCondition (
> > conditionName=0xd13697 "TransactionIdIsValid(initial)",
> > errorType=0xd12df4 "FailedAssertion", fileName=0xd12de8 "procarray.c",
> >
> > lineNumber=1750) at assert.c:69
> > #3 0x0000000000962195 in ComputeXidHorizons (h=0x7ffe93de25e0)
> > at procarray.c:1750
> > #4 0x00000000009628a3 in GetOldestTransactionIdConsideredRunning ()
> > at procarray.c:2050
> > #5 0x00000000005972bf in CreateRestartPoint (flags=256) at xlog.c:7153
> > #6 0x00000000008cae37 in CheckpointerMain () at checkpointer.c:464
>
> The function requires a valid value in
> ShmemVariableCache->latestCompleteXid. But it is not initialized and
> maintained in this case. The attached quick hack seems working, but
> of course more decent fix is needed.
>
>
> diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
> index 0070d56b0b..667c990301 100644
> --- a/src/backend/access/transam/xlog.c
> +++ b/src/backend/access/transam/xlog.c
> @@ -5363,7 +5363,7 @@ StartupXLOG(void)
> * control file and we've established a recovery snapshot from a
> * running-xacts WAL record.
> */
> - if (ArchiveRecoveryRequested && EnableHotStandby)
> + if (1 || (ArchiveRecoveryRequested && EnableHotStandby))
> {
> TransactionId *xids;
> int nxids;
> diff --git a/src/backend/storage/ipc/standby.c b/src/backend/storage/ipc/standby.c
> index 94cc860f5f..c814c991f8 100644
> --- a/src/backend/storage/ipc/standby.c
> +++ b/src/backend/storage/ipc/standby.c
> @@ -1161,7 +1161,7 @@ standby_redo(XLogReaderState *record)
> Assert(!XLogRecHasAnyBlockRefs(record));
>
> /* Do nothing if we're not in hot standby mode */
> - if (standbyState == STANDBY_DISABLED)
> + if (standbyState == STANDBY_DISABLED && info != XLOG_RUNNING_XACTS)
> return;
>
> if (info == XLOG_STANDBY_LOCK)
>
> regards.
>
> --
> Kyotaro Horiguchi
> NTT Open Source Software Center
From | Date | Subject | |
---|---|---|---|
Next Message | h-shibata | 2023-02-01 04:44:30 | Was there a bug fix in the COPY command in Version 15? |
Previous Message | Scott Mead | 2023-01-31 15:35:54 | Re: [BUG] Autovacuum not dynamically decreasing cost_limit and cost_delay |