Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb82c877

Browse files
committed
Fix refreshing physical relfilenumber on shared index
Buildfarm member 'prion', which is configured with-DRELCACHE_FORCE_RELEASE -DCATCACHE_FORCE_RELEASE, failed with errorslike this: ERROR: could not read blocks 0..0 in file "global/2672": read only 0 of 8192 byteswhile running a parallel test group that includes VACUUM FULL on somecatalog tables among other things. I was not able to reproduce thatjust by running the tests with -DRELCACHE_FORCE_RELEASE-DCATCACHE_FORCE_RELEASE, even though 'prion' hit it on first runafter commit2b9b8eb, so there might be something else that makesit more susceptible to the race. However, I was able to reproduce itby adding another test to the same test group that runs "vacuum fullpg_database" repeatedly.The problem is that RelationReloadIndexInfo() no longer callsRelationInitPhysicalAddr() on a nailed, shared index, when aninvalidation happens early during backend startup, before the criticalrelcaches have been built. Before commit2b9b8eb, that was done byRelationReloadNailed(), but it went missing from that path. Add itback as an explicit step.Broken by commit2b9b8eb, which refactored these functions.Discussion:https://www.postgresql.org/message-id/db876575-8f5b-4193-a538-df7e1f92d47a%40iki.fi
1 parentfb7e27a commitb82c877

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

‎src/backend/utils/cache/relcache.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2253,11 +2253,14 @@ RelationReloadIndexInfo(Relation relation)
22532253
* If it's a shared index, we might be called before backend startup has
22542254
* finished selecting a database, in which case we have no way to read
22552255
* pg_class yet. However, a shared index can never have any significant
2256-
* schema updates, so it's okay to ignore the invalidation signal. Just
2257-
* mark it valid and return without doing anything more.
2256+
* schema updates, so it's okay to mostly ignore the invalidation signal.
2257+
* Its physical relfilenumber might've changed, but that's all. Update
2258+
* the physical relfilenumber, mark it valid and return without doing
2259+
* anything more.
22582260
*/
22592261
if (relation->rd_rel->relisshared&& !criticalRelcachesBuilt)
22602262
{
2263+
RelationInitPhysicalAddr(relation);
22612264
relation->rd_isvalid= true;
22622265
return;
22632266
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp