diff options
author | Michael Paquier <michael@paquier.xyz> | 2024-06-06 08:47:40 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2024-06-06 08:47:40 +0900 |
commit | cd312adc561a0de056bbc0b0087d275bd3e9f282 (patch) | |
tree | 6cae986dfe08f5465c1cc2ae9d09ed735571cd8a /contrib/postgres_fdw/postgres_fdw.c | |
parent | 8111e80c5d39451c0cbff91d5a6b69fd87c3928c (diff) | |
download | postgresql-cd312adc561a0de056bbc0b0087d275bd3e9f282.tar.gz postgresql-cd312adc561a0de056bbc0b0087d275bd3e9f282.zip |
Prevent inconsistent use of stats entry for replication slots
Concurrent activity around replication slot creation and drop could
cause a replication slot to use a stats entry it should not have used
when created, triggering an assertion failure when retrieving an
inconsistent entry from the dshash table used by the stats facility.
The issue is that pgstat_drop_replslot() calls pgstat_drop_entry()
without checking the result. If pgstat_drop_entry() cannot free the
entry related to the object dropped, pgstat_request_entry_refs_gc()
should be called. AtEOXact_PgStat_DroppedStats() and surrounding
routines dropping stats entries already do that.
This is documented in pgstat_internal.h, but let's add a comment at the
top of pgstat_drop_entry() as that can be easy to miss.
Reported-by: Alexander Lakhin
Author: Floris Van Nee
Analyzed-by: Andres Freund
Discussion: https://postgr.es/m/17947-b9554521ad963c9c@postgresql.org
Backpatch-through: 15
Diffstat (limited to 'contrib/postgres_fdw/postgres_fdw.c')
0 files changed, 0 insertions, 0 deletions