Re: [BUG] Panic due to incorrect missingContrecPtr after promotion
Kyotaro Horiguchi <horikyota.ntt@gmail.com>
From: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
To: simseih@amazon.com
Cc: michael@paquier.xyz, alvherre@alvh.no-ip.org,
pgsql-hackers@postgresql.org
Date: 2022-08-10T08:37:18Z
Lists: pgsql-hackers
Hello. > Yes, that is correct. Mmm. I believed that the log came from a single server run, since the PID (I believe the [359], [357] are PID) did not change through the log lines. > 2022-08-05 18:50:13 UTC::@:[359]:LOG: creating missing WAL directory "pg_wal/archive_status" This means that someone removes the content of pg_wal directory. Removing some WAL files in pg_wal may lead to this symptom. > 2022-08-05 18:50:13 UTC::@:[359]:LOG: entering standby mode > recovering 00000002.history > 2022-08-05 18:50:13 UTC::@:[359]:LOG: ### [S] @6/B8000198: abort=(0/0)0/0, miss=(0/0)0/0, SbyMode=0, SbyModeReq=1 > 2022-08-05 18:50:13 UTC::@:[359]:LOG: database system was not properly shut down; automatic recovery in progress > 2022-08-05 18:50:13 UTC::@:[359]:LOG: redo starts at 6/B80000E8 > > And a few hours later, is when we see a panic So, it seems that the *standby* received the inconsistent WAL stream (aborted-contrecord not followed by a overwriting-missing-contrecord) from the primary. Thus the inconsistency happened on the primary, not on the standby. So... I'm still failing to draw the big picutre of what is happening here. Could you show us the server configuration (dbservers involved and their roles (primary/standby..)), and the exact steps when you restart the server after carsh? regards. -- Kyotaro Horiguchi NTT Open Source Software Center
Commits
-
Prevent WAL corruption after a standby promotion.
- 0b3ff539dd34 10.23 landed
- 002fba80ebde 11.18 landed
- 3c0ef0832748 12.13 landed
- 3f2701cda590 13.9 landed
- 0e54a5e27494 14.6 landed
- eb29fa38895c 15.0 landed
- 6672d7913929 16.0 landed
-
Fix "missing continuation record" after standby promotion
- caaeb88ff7ae 14.3 landed
- c714ebd0e8c1 12.11 landed
- 9d92582abf91 15.0 landed
- 9ade3c09a5d1 10.21 landed
- 98eb3e06ce3a 13.7 landed
- 199cd7b59a16 11.16 landed