postgresql/src/backend
Alexander Korotkov 70d8a91f82 Remove excess assert from InvalidatePossiblyObsoleteSlot()
ca307d5cec introduced keeping WAL segments by slot's last saved restart LSN.
It also added an assertion that the slot's restart LSN never goes backward.
However, situations when the restart LSN goes backward have been spotted by
buildfarm animals and investigated in the thread.

When pg_receivewal starts the replication, it sets the last replayed LSN to
the beginning of the segment, which is older than what
ReplicationSlotReserveWal() set for the slot.  A similar situation can happen
to pg_basebackup.  When standby reconnects to the primary, it sends the last
replayed LSN, which might be older than the last confirmed flush LSN.  In
both these situations, a concurrent checkpoint may trigger an assert trap.

Based on ideas from Vitaly Davydov <v.davydov@postgrespro.ru>,
Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>,
Vignesh C <vignesh21@gmail.com>,
Amit Kapila <amit.kapila16@gmail.com>.

Reported-by: Vignesh C <vignesh21@gmail.com>
Reported-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CALDaNm3s-jpQTe1MshsvQ8GO%3DTLj233JCdkQ7uZ6pwqRVpxAdw%40mail.gmail.com
Reviewed-by: Vignesh C <vignesh21@gmail.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
2025-06-23 21:27:42 +03:00
..
access Fix possible Assert failure in verify_compact_attribute() 2025-06-17 10:49:36 +12:00
archive Update copyright for 2025 2025-01-01 11:21:55 -05:00
backup Use XLOG_CONTROL_FILE macro consistently for control file name. 2025-04-07 09:27:33 +09:00
bootstrap Remove unnecessary (char *) casts [mem] 2025-02-12 08:50:13 +01:00
catalog doc: Mention GIN indexes support parallel builds. 2025-06-19 09:12:34 +09:00
commands Use SnapshotDirty when checking for conflicting index names. 2025-06-20 13:41:11 -04:00
executor Improve comments for TidRangeEval 2025-06-14 17:18:31 +12:00
foreign Track the number of presorted outer pathkeys in MergePath 2025-05-08 18:21:32 +09:00
jit doc: Fix wording in JIT README 2025-05-26 13:30:01 +02:00
lib Update copyright for 2025 2025-01-01 11:21:55 -05:00
libpq Don't reduce output request size on non-Unix-socket connections. 2025-06-10 18:39:34 -04:00
main Use thread-safe strftime_l() instead of strftime(). 2025-03-28 07:13:43 +01:00
nodes Fix squashing algorithm for query texts 2025-06-12 14:21:21 +02:00
optimizer Remove planner's have_dangerous_phv() join-order restriction. 2025-06-20 15:55:12 -04:00
parser Fix squashing algorithm for query texts 2025-06-12 14:21:21 +02:00
partitioning Fix bug in cbc127917 to handle nested Append correctly 2025-02-25 09:24:42 +09:00
po Translation updates 2025-05-05 12:04:49 +02:00
port Give up on running with NetBSD/OpenBSD's default semaphore settings. 2025-04-29 17:27:52 -04:00
postmaster Ensure we have a snapshot when updating various system catalogs. 2025-05-30 15:17:28 -05:00
regex Another unintentional behavior change in commit e9931bfb75. 2025-04-16 16:49:42 -07:00
replication Remove excess assert from InvalidatePossiblyObsoleteSlot() 2025-06-23 21:27:42 +03:00
rewrite Change internal queryid type from uint64 to int64 2025-05-30 22:59:39 +12:00
snowball Use PG_MODULE_MAGIC_EXT in our installable shared libraries. 2025-03-26 11:11:02 -04:00
statistics Fix recently introduced typos 2025-04-11 22:17:12 +02:00
storage aio: Add missing memory barrier when waiting for IO handle 2025-06-16 12:36:01 -04:00
tcop Change internal plan ID type from uint64 to int64 2025-05-31 09:40:45 +09:00
tsearch Clear errno before calling strtol() in spell.c. 2025-03-08 11:24:25 -05:00
utils Doc: improve documentation about width_bucket(). 2025-06-21 12:52:37 -04:00
.gitignore
common.mk Blind attempt to fix LLVM dependency in the backend 2022-09-15 10:53:48 +07:00
Makefile aio: Add liburing dependency 2025-03-26 19:45:32 -04:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00
nls.mk Return yyparse() result not via global variable 2025-01-24 06:55:39 +01:00