From 4eb2c33f3851d71b0ff92a898253b7a83455bec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Sat, 28 Mar 2020 05:37:39 +0000 Subject: [PATCH] multi_copy.c: remove tableMetadata --- src/backend/distributed/commands/multi_copy.c | 8 +++----- src/include/distributed/commands/multi_copy.h | 3 --- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/backend/distributed/commands/multi_copy.c b/src/backend/distributed/commands/multi_copy.c index 0c17a32e4..23d144e52 100644 --- a/src/backend/distributed/commands/multi_copy.c +++ b/src/backend/distributed/commands/multi_copy.c @@ -2133,9 +2133,6 @@ CitusCopyDestReceiverStartup(DestReceiver *dest, int operation, */ SerializeNonCommutativeWrites(shardIntervalList, RowExclusiveLock); - /* keep the table metadata to avoid looking it up for every tuple */ - copyDest->tableMetadata = cacheEntry; - UseCoordinatedTransaction(); 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 * shard. */ - ShardInterval *shardInterval = FindShardInterval(partitionColumnValue, - copyDest->tableMetadata); + CitusTableCacheEntry *cacheEntry = + GetCitusTableCacheEntry(copyDest->distributedRelationId); + ShardInterval *shardInterval = FindShardInterval(partitionColumnValue, cacheEntry); if (shardInterval == NULL) { ereport(ERROR, (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), diff --git a/src/include/distributed/commands/multi_copy.h b/src/include/distributed/commands/multi_copy.h index 9ec8f280b..0029d5396 100644 --- a/src/include/distributed/commands/multi_copy.h +++ b/src/include/distributed/commands/multi_copy.h @@ -88,9 +88,6 @@ typedef struct CitusCopyDestReceiver List *columnNameList; int partitionColumnIndex; - /* distributed table metadata */ - CitusTableCacheEntry *tableMetadata; - /* open relation handle */ Relation distributedRelation;