forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd7b16ee
committed
Improve relcache invalidation handling of currently invisible relations.
The corner case where a relcache invalidation tried to rebuild theentry for a referenced relation but couldn't find it in the catalogwasn't correct.The code tried to RelationCacheDelete/RelationDestroyRelation theentry. That didn't work when assertions are enabled because the lattercontains an assertion ensuring the refcount is zero. It's also moregenerally a bad idea, because by virtue of being referenced somebodymight actually look at the entry, which is possible if the error istrapped and handled via a subtransaction abort.Instead just error out, without deleting the entry. As the entry ismarked invalid, the worst that can happen is that the invalid (and atsome point unused) entry lingers in the relcache.Discussion: 22459.1418656530@sss.pgh.pa.usThere should be no way to hit this case < 9.4 where logical decodingintroduced a bug that can hit this. But since the code for handlingthe corner case is there it should do something halfway sane, sobackpatch all the the way back. The logical decoding bug will behandled in a separate commit.1 parent97f8a24 commitd7b16ee
1 file changed
+7
-3
lines changedLines changed: 7 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1952 | 1952 |
| |
1953 | 1953 |
| |
1954 | 1954 |
| |
1955 |
| - | |
1956 |
| - | |
1957 |
| - | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
1958 | 1962 |
| |
1959 | 1963 |
| |
1960 | 1964 |
| |
|
0 commit comments
Comments
(0)