forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitbc49d93
committed
Fix rare startup failure induced by MVCC-catalog-scans patch.
While a new backend nominally participates in sinval signaling startingfrom the SharedInvalBackendInit call near the top of InitPostgres, itcannot recognize sinval messages for unshared catalogs of its databaseuntil it has set up MyDatabaseId. This is not problematic for the catcacheor relcache, which by definition won't have loaded any data from or aboutsuch catalogs before that point. However, commit568d413introduced a mechanism for re-using MVCC snapshots for catalog scans, andmade invalidation of those depend on recognizing relevant sinval messages.So it's possible to establish a catalog snapshot to read pg_authid andpg_database, then before we set MyDatabaseId, receive sinval messages thatshould result in invalidating that snapshot --- but do not, because wedon't realize they are for our database. This mechanism explains theintermittent buildfarm failures we've seen since commit31eae60.That commit was not itself at fault, but it introduced a new regressiontest that does reconnections concurrently with the "vacuum full pg_am"command in vacuum.sql. This allowed the pre-existing error to be exposed,given just the right timing, because we'd fail to update our informationabout how to access pg_am. In principle any VACUUM FULL on a systemcatalog could have created a similar hazard for concurrent incomingconnections. Perhaps there are more subtle failure cases as well.To fix, force invalidation of the catalog snapshot as soon as we'veset MyDatabaseId.Back-patch to 9.4 where the error was introduced.1 parent5e3d289 commitbc49d93
1 file changed
+8
-0
lines changedLines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
852 | 852 |
| |
853 | 853 |
| |
854 | 854 |
| |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
855 | 863 |
| |
856 | 864 |
| |
857 | 865 |
| |
|
0 commit comments
Comments
(0)