Merge pull request #3670 from citusdata/avoid-stale-metadata

multi_copy.c: remove tableMetadata
pull/3676/head
Philip Dubé 2020-03-30 20:00:25 +00:00 committed by GitHub
commit ae1e92e337
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 8 deletions

View File

@ -2133,9 +2133,6 @@ CitusCopyDestReceiverStartup(DestReceiver *dest, int operation,
*/ */
SerializeNonCommutativeWrites(shardIntervalList, RowExclusiveLock); SerializeNonCommutativeWrites(shardIntervalList, RowExclusiveLock);
/* keep the table metadata to avoid looking it up for every tuple */
copyDest->tableMetadata = cacheEntry;
UseCoordinatedTransaction(); UseCoordinatedTransaction();
if (cacheEntry->replicationModel == REPLICATION_MODEL_2PC || if (cacheEntry->replicationModel == REPLICATION_MODEL_2PC ||
@ -2480,8 +2477,9 @@ ShardIdForTuple(CitusCopyDestReceiver *copyDest, Datum *columnValues, bool *colu
* For reference table, this function blindly returns the tables single * For reference table, this function blindly returns the tables single
* shard. * shard.
*/ */
ShardInterval *shardInterval = FindShardInterval(partitionColumnValue, CitusTableCacheEntry *cacheEntry =
copyDest->tableMetadata); GetCitusTableCacheEntry(copyDest->distributedRelationId);
ShardInterval *shardInterval = FindShardInterval(partitionColumnValue, cacheEntry);
if (shardInterval == NULL) if (shardInterval == NULL)
{ {
ereport(ERROR, (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), ereport(ERROR, (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),

View File

@ -88,9 +88,6 @@ typedef struct CitusCopyDestReceiver
List *columnNameList; List *columnNameList;
int partitionColumnIndex; int partitionColumnIndex;
/* distributed table metadata */
CitusTableCacheEntry *tableMetadata;
/* open relation handle */ /* open relation handle */
Relation distributedRelation; Relation distributedRelation;