UnsetMetadataSyncedForAll: use CatalogTupleUpdateWithInfo

pull/3067/head
Philip Dubé 2019-10-10 22:44:04 +00:00 committed by Philip Dubé
parent 2a969fe4bb
commit b2f084d7f5
1 changed files with 6 additions and 1 deletions

View File

@ -1754,6 +1754,7 @@ UnsetMetadataSyncedForAll(void)
bool indexOK = false; bool indexOK = false;
HeapTuple heapTuple = NULL; HeapTuple heapTuple = NULL;
TupleDesc tupleDescriptor = NULL; TupleDesc tupleDescriptor = NULL;
CatalogIndexState indstate;
/* /*
* Concurrent master_update_node() calls might iterate and try to update * Concurrent master_update_node() calls might iterate and try to update
@ -1767,6 +1768,8 @@ UnsetMetadataSyncedForAll(void)
ScanKeyInit(&scanKey[1], Anum_pg_dist_node_metadatasynced, ScanKeyInit(&scanKey[1], Anum_pg_dist_node_metadatasynced,
BTEqualStrategyNumber, F_BOOLEQ, BoolGetDatum(true)); BTEqualStrategyNumber, F_BOOLEQ, BoolGetDatum(true));
indstate = CatalogOpenIndexes(relation);
scanDescriptor = systable_beginscan(relation, scanDescriptor = systable_beginscan(relation,
InvalidOid, indexOK, InvalidOid, indexOK,
NULL, scanKeyCount, scanKey); NULL, scanKeyCount, scanKey);
@ -1794,7 +1797,8 @@ UnsetMetadataSyncedForAll(void)
newHeapTuple = heap_modify_tuple(heapTuple, tupleDescriptor, values, isnull, newHeapTuple = heap_modify_tuple(heapTuple, tupleDescriptor, values, isnull,
replace); replace);
CatalogTupleUpdate(relation, &newHeapTuple->t_self, newHeapTuple); CatalogTupleUpdateWithInfo(relation, &newHeapTuple->t_self, newHeapTuple,
indstate);
CommandCounterIncrement(); CommandCounterIncrement();
@ -1804,6 +1808,7 @@ UnsetMetadataSyncedForAll(void)
} }
systable_endscan(scanDescriptor); systable_endscan(scanDescriptor);
CatalogCloseIndexes(indstate);
heap_close(relation, NoLock); heap_close(relation, NoLock);
return updatedAtLeastOne; return updatedAtLeastOne;