forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit174952e
committed
Fix assertion when decoding XLOG_PARAMETER_CHANGE on promoted primary.
When a standby replays an XLOG_PARAMETER_CHANGE record that lowerswal_level below logical, we invalidate all logical slots in hotstandby mode. However, if this record was replayed while not in hotstandby mode, logical slots could remain valid even after promotion,potentially causing an assertion failure during WAL record decoding.To fix this issue, this commit adds a check for hot_standby statuswhen restoring a logical replication slot on standbys. This checkensures that logical slots are invalidated when they becomeincompatible due to insufficient wal_level during recovery.Backpatch to v16 where logical decoding on standby was introduced.Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>Discussion:https://postgr.es/m/CAD21AoABoFwGY_Rh2aeE6tEq3HkJxf0c6UeOXn4VV9v6BAQPSw%40mail.gmail.comBackpatch-through: 161 parentfde7c01 commit174952e
File tree
2 files changed
+61
-6
lines changed- src
- backend/replication
- test/recovery/t
2 files changed
+61
-6
lines changedLines changed: 23 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2327 | 2327 |
| |
2328 | 2328 |
| |
2329 | 2329 |
| |
2330 |
| - | |
2331 |
| - | |
2332 |
| - | |
2333 |
| - | |
2334 |
| - | |
2335 |
| - | |
| 2330 | + | |
| 2331 | + | |
| 2332 | + | |
| 2333 | + | |
| 2334 | + | |
| 2335 | + | |
| 2336 | + | |
| 2337 | + | |
| 2338 | + | |
| 2339 | + | |
| 2340 | + | |
| 2341 | + | |
| 2342 | + | |
| 2343 | + | |
| 2344 | + | |
| 2345 | + | |
| 2346 | + | |
| 2347 | + | |
| 2348 | + | |
| 2349 | + | |
| 2350 | + | |
| 2351 | + | |
| 2352 | + | |
2336 | 2353 |
| |
2337 | 2354 |
| |
2338 | 2355 |
| |
|
Lines changed: 38 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
345 | 345 |
| |
346 | 346 |
| |
347 | 347 |
| |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
348 | 386 |
| |
349 | 387 |
| |
350 | 388 |
| |
|
0 commit comments
Comments
(0)