forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitcd312ad
committed
Prevent inconsistent use of stats entry for replication slots
Concurrent activity around replication slot creation and drop couldcause a replication slot to use a stats entry it should not have usedwhen created, triggering an assertion failure when retrieving aninconsistent 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 theentry related to the object dropped, pgstat_request_entry_refs_gc()should be called. AtEOXact_PgStat_DroppedStats() and surroundingroutines dropping stats entries already do that.This is documented in pgstat_internal.h, but let's add a comment at thetop of pgstat_drop_entry() as that can be easy to miss.Reported-by: Alexander LakhinAuthor: Floris Van NeeAnalyzed-by: Andres FreundDiscussion:https://postgr.es/m/17947-b9554521ad963c9c@postgresql.orgBackpatch-through: 151 parent8111e80 commitcd312ad
2 files changed
+14
-2
lines changedLines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
157 | 157 |
| |
158 | 158 |
| |
159 | 159 |
| |
160 |
| - | |
161 |
| - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
162 | 163 |
| |
163 | 164 |
| |
164 | 165 |
| |
|
Lines changed: 11 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
855 | 855 |
| |
856 | 856 |
| |
857 | 857 |
| |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
858 | 869 |
| |
859 | 870 |
| |
860 | 871 |
| |
|
0 commit comments
Comments
(0)