Re: [BUG] Panic due to incorrect missingContrecPtr after promotion

Поиск
Список
Период
Сортировка
Искать
От
Imseih (AWS), Sami
Тема
Re: [BUG] Panic due to incorrect missingContrecPtr after promotion
Дата
в 02:01:27
Msg-id
FB0DEA0B-E14E-43A0-811F-C1AE93D00FF3@amazon.com
Список
Дерево обсуждения
[BUG] Panic due to incorrect missingContrecPtr after promotion "Imseih (AWS), Sami" <simseih@amazon.com>
Re: [BUG] Panic due to incorrect missingContrecPtr after promotion Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: [BUG] Panic due to incorrect missingContrecPtr after promotion "Imseih (AWS), Sami" <simseih@amazon.com>
Re: [BUG] Panic due to incorrect missingContrecPtr after promotion Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: [BUG] Panic due to incorrect missingContrecPtr after promotion Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: [BUG] Panic due to incorrect missingContrecPtr after promotion "Imseih (AWS), Sami" <simseih@amazon.com>
Re: [BUG] Panic due to incorrect missingContrecPtr after promotion "Imseih (AWS), Sami" <simseih@amazon.com>
Re: [BUG] Panic due to incorrect missingContrecPtr after promotion "alvherre@alvh.no-ip.org" <alvherre@alvh.no-ip.org>
Re: [BUG] Panic due to incorrect missingContrecPtr after promotion "Imseih (AWS), Sami" <simseih@amazon.com>
Re: [BUG] Panic due to incorrect missingContrecPtr after promotion Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: [BUG] Panic due to incorrect missingContrecPtr after promotion "Imseih (AWS), Sami" <simseih@amazon.com>
Re: [BUG] Panic due to incorrect missingContrecPtr after promotion Michael Paquier <michael@paquier.xyz>
Re: [BUG] Panic due to incorrect missingContrecPtr after promotion Michael Paquier <michael@paquier.xyz>
After further research, we found the following.

Testing on 13.6 with the attached patch we see
that the missingContrecPtr is being incorrectly
set on the standby and the promote in the tap
test fails.

Per the comments in xlog.c, the
missingContrecPtr should not be set when
in standby mode.

            /*
             * When not in standby mode we find that WAL ends in an incomplete
             * record, keep track of that record.  After recovery is done,
             * we'll write a record to indicate downstream WAL readers that
             * that portion is to be ignored.
             */
            if (!StandbyMode &&
                !XLogRecPtrIsInvalid(xlogreader->abortedRecPtr))
            {
                abortedRecPtr = xlogreader->abortedRecPtr;
                missingContrecPtr = xlogreader->missingContrecPtr;
                elog(LOG, "missingContrecPtr == %ld", missingContrecPtr);
            }

If StandbyModeRequested is checked instead, which
checks for the presence of a standby signal file,
The missingContrecPtr is not set on the
standby and the test succeeds.

            if (!StandbyModeRequested &&
                !XLogRecPtrIsInvalid(xlogreader->abortedRecPtr))
            {
                abortedRecPtr = xlogreader->abortedRecPtr;
                missingContrecPtr = xlogreader->missingContrecPtr;
                elog(LOG, "missingContrecPtr == %ld", missingContrecPtr);
            }

If this is a bug as it appears, it appears the original patch
to resolve this issue is not needed and the ideal fix
Is to ensure that a standby does not set
missingContrecPtr.

Would like to see what others think.

Thanks

--
Sami Imseih
Amazon Web Services


В списке pgsql-hackers по дате отправления
От: Kyotaro Horiguchi
Дата:
От: Amit Kapila
Дата:
FAQ