Re: buildfarm: could not read block 3 in file "base/16384/2662": read only 0 of 8192 bytes
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>, Peter Geoghegan <pg@bowt.ie>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2018-08-29T18:00:12Z
Lists: pgsql-hackers
Andres Freund <andres@anarazel.de> writes: > A bit of food, a coke and a talk later, here's a first draft *prototype* > of how this could be solved. ... > Obviously this is far from clean enough, but what do you think about the > basic approach? It does, in my limited testing, indeed solve the "could > not read block" issue. A couple thoughts after reading and reflecting for awhile: 1. I don't much like the pending_rebuilds list, mainly because of this consideration: what happens if we hit an OOM error trying to add an entry to that list? As you've drafted the patch, we don't even mark the relevant relcache entry rd_invalid before that fails, so that's surely bad. Now, I'm not sure how bulletproof relcache inval is in general with respect to OOM failures, but let's not add more hazards. 2. I think we may need to address the same order-of-operations hazards as RelationCacheInvalidate() worries about. Alternatively, maybe we could simplify that function by making it use the same delayed-revalidation logic as we're going to develop for this. 3. I don't at all like the ProcessPendingRelcacheRebuilds call you added to ProcessInvalidationMessages. That's effectively assuming that the "func" *must* be LocalExecuteInvalidationMessage and not anything else; likewise, the lack of such a call inside ProcessInvalidationMessagesMulti presumes that that one is never called to actually execute invalidations. (While those are true statements, it's a horrible violation of modularity for these two functions to know it.) Probably better to put this into the callers, which will know what the actual semantics are. 4. The call added to the middle of ReceiveSharedInvalidMessages doesn't seem all that safe either; the problem is its relationship to the "catchup" processing. We are caught up at the moment we exit the loop, but are we sure we still would be after doing assorted work for relcache rebuild? Swapping the order of the two steps might help, but then we have to consider what happens if we error out from SICleanupQueue. (In general, the hard part of all this stuff is being sure that sane things happen if you error out part way through ...) regards, tom lane
Commits
-
Limit depth of forced recursion for CLOBBER_CACHE_RECURSIVELY.
- f112d4088c29 9.3.25 landed
- 35e39610a3f8 9.4.20 landed
- cc4e99546ede 9.5.15 landed
- 2ef5c12ad5b6 9.6.11 landed
- adfc156d356a 10.6 landed
- 90fd3bfd1707 11.0 landed
- f510412df351 12.0 landed
-
Fix longstanding recursion hazard in sinval message processing.
- 395f310b04c5 9.6.11 landed
- 9e6f4fbdd0cf 10.6 landed
- 2569ca0dc8a2 11.0 landed
- f868a8143a98 12.0 landed
- bf919387ecc6 9.4.20 landed
- 95e9f928ce5e 9.3.25 landed
- 66321ae61baf 9.5.15 landed
-
Fix bugs in vacuum of shared rels, by keeping their relcache entries current.
- a54e1f158779 11.0 cited