[HACKERS] May cause infinite loop when initializing rel-cache containspartitioned table - Mailing list pgsql-hackers

From 甄明洋
Subject [HACKERS] May cause infinite loop when initializing rel-cache containspartitioned table
Date
Msg-id 57bd1e1.1886.15bd7b79cee.Coremail.18612389267@yeah.net
Whole thread Raw
Responses Re: [HACKERS] May cause infinite loop when initializing rel-cachecontains partitioned table  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
List pgsql-hackers
The function of  initializing rel-cache is RelationCacheInitializePhase3 and in src/backend/utils/cache/relcache.c file.
When initializing the partition description information, we forget to check if partition key or descriptor is NULL. 
Therefore, after the loop restarts, the partition information will be initialized again, resulting in an infinite loop.
Code:
/*
* Reload partition key and descriptor for a partitioned table.
*/
if (relation->rd_rel->relkind == RELKIND_PARTITIONED_TABLE)
{
RelationBuildPartitionKey(relation);
Assert(relation->rd_partkey != NULL);

RelationBuildPartitionDesc(relation);
Assert(relation->rd_partdesc != NULL);

restart = true;
}



 

pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: [HACKERS] Error message on missing SCRAM authentication witholder clients
Next
From: Pavan Deolasee
Date:
Subject: Re: [HACKERS] logical replication and PANIC during shutdowncheckpoint in publisher