mirror of https://github.com/citusdata/citus.git
Merge pull request #3670 from citusdata/avoid-stale-metadata
multi_copy.c: remove tableMetadatapull/3676/head
commit
ae1e92e337
|
@ -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),
|
||||
|
|
|
@ -88,9 +88,6 @@ typedef struct CitusCopyDestReceiver
|
|||
List *columnNameList;
|
||||
int partitionColumnIndex;
|
||||
|
||||
/* distributed table metadata */
|
||||
CitusTableCacheEntry *tableMetadata;
|
||||
|
||||
/* open relation handle */
|
||||
Relation distributedRelation;
|
||||
|
||||
|
|
Loading…
Reference in New Issue