forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitbfc44da
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 thisinconsistent 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 parentbb84254 commitbfc44da
2 files changed
+14
-2
lines changedLines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
153 | 153 |
| |
154 | 154 |
| |
155 | 155 |
| |
156 |
| - | |
157 |
| - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
158 | 159 |
| |
159 | 160 |
| |
160 | 161 |
| |
|
Lines changed: 11 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
850 | 850 |
| |
851 | 851 |
| |
852 | 852 |
| |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
853 | 864 |
| |
854 | 865 |
| |
855 | 866 |
| |
|
0 commit comments
Comments
(0)