forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitf2c922f
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 parentda565f3 commitf2c922f
2 files changed
+14
-2
lines changed| 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 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
854 | 854 | | |
855 | 855 | | |
856 | 856 | | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
857 | 868 | | |
858 | 869 | | |
859 | 870 | | |
| |||
0 commit comments
Comments
(0)