- Notifications
You must be signed in to change notification settings - Fork5
Commit491dd4a
committed
Fix relcache reload mechanism to be more robust in the face of errors
occurring during a reload, such as query-cancel. Instead of zeroing outan existing relcache entry and rebuilding it in place, build a new relcacheentry, then swap its contents with the old one, then free the new entry.This avoids problems with code believing that a previously obtained pointerto a cache entry must still reference a valid entry, as seen in recentfailures on buildfarm member jaguar. (jaguar is using CLOBBER_CACHE_ALWAYSwhich raises the probability of failure substantially, but the problemcould occur in the field without that.) The previous design was okaywhen it was made, but subtransactions and the ResourceOwner mechanismmake it unsafe now.Also, make more use of the already existing rd_isvalid flag, so that weremember that the entry requires rebuilding even if the first attempt fails.Back-patch as far as 8.2. Prior versions have enough issues around relcachereload anyway (due to inadequate locking) that fixing this one doesn't seemworthwhile.1 parentb81d033 commit491dd4a
1 file changed
+178
-121
lines changed0 commit comments
Comments
(0)