From b2f084d7f5204c33422e24206b771cffd5c35633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Thu, 10 Oct 2019 22:44:04 +0000 Subject: [PATCH] UnsetMetadataSyncedForAll: use CatalogTupleUpdateWithInfo --- src/backend/distributed/utils/node_metadata.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/backend/distributed/utils/node_metadata.c b/src/backend/distributed/utils/node_metadata.c index 3662309ce..049a517d8 100644 --- a/src/backend/distributed/utils/node_metadata.c +++ b/src/backend/distributed/utils/node_metadata.c @@ -1754,6 +1754,7 @@ UnsetMetadataSyncedForAll(void) bool indexOK = false; HeapTuple heapTuple = NULL; TupleDesc tupleDescriptor = NULL; + CatalogIndexState indstate; /* * 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, BTEqualStrategyNumber, F_BOOLEQ, BoolGetDatum(true)); + indstate = CatalogOpenIndexes(relation); + scanDescriptor = systable_beginscan(relation, InvalidOid, indexOK, NULL, scanKeyCount, scanKey); @@ -1794,7 +1797,8 @@ UnsetMetadataSyncedForAll(void) newHeapTuple = heap_modify_tuple(heapTuple, tupleDescriptor, values, isnull, replace); - CatalogTupleUpdate(relation, &newHeapTuple->t_self, newHeapTuple); + CatalogTupleUpdateWithInfo(relation, &newHeapTuple->t_self, newHeapTuple, + indstate); CommandCounterIncrement(); @@ -1804,6 +1808,7 @@ UnsetMetadataSyncedForAll(void) } systable_endscan(scanDescriptor); + CatalogCloseIndexes(indstate); heap_close(relation, NoLock); return updatedAtLeastOne;