Merge pull request #6170 from citusdata/marcocitus/fix-htab-leaks

pull/5860/head
Marco Slot 2022-08-15 17:50:48 +02:00 committed by GitHub
commit b491d87931
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View File

@ -1281,7 +1281,8 @@ ErrorIfUnsupportedCascadeObjects(Oid relationId)
info.keysize = sizeof(Oid); info.keysize = sizeof(Oid);
info.entrysize = sizeof(Oid); info.entrysize = sizeof(Oid);
info.hash = oid_hash; info.hash = oid_hash;
uint32 hashFlags = (HASH_ELEM | HASH_FUNCTION); info.hcxt = CurrentMemoryContext;
uint32 hashFlags = (HASH_ELEM | HASH_FUNCTION | HASH_CONTEXT);
HTAB *nodeMap = hash_create("object dependency map (oid)", 64, &info, hashFlags); HTAB *nodeMap = hash_create("object dependency map (oid)", 64, &info, hashFlags);
bool unsupportedObjectInDepGraph = bool unsupportedObjectInDepGraph =

View File

@ -2099,7 +2099,8 @@ GetDependingViews(Oid relationId)
info.keysize = sizeof(Oid); info.keysize = sizeof(Oid);
info.entrysize = sizeof(ViewDependencyNode); info.entrysize = sizeof(ViewDependencyNode);
info.hash = oid_hash; info.hash = oid_hash;
uint32 hashFlags = (HASH_ELEM | HASH_FUNCTION); info.hcxt = CurrentMemoryContext;
uint32 hashFlags = (HASH_ELEM | HASH_FUNCTION | HASH_CONTEXT);
HTAB *nodeMap = hash_create("view dependency map (oid)", 32, &info, hashFlags); HTAB *nodeMap = hash_create("view dependency map (oid)", 32, &info, hashFlags);
ViewDependencyNode *tableNode = BuildViewDependencyGraph(relationId, nodeMap); ViewDependencyNode *tableNode = BuildViewDependencyGraph(relationId, nodeMap);

View File

@ -2634,7 +2634,8 @@ ShardPlacementsListToHash(List *shardPlacementList)
info.entrysize = sizeof(ShardPlacement); info.entrysize = sizeof(ShardPlacement);
info.hash = PlacementsHashHashCode; info.hash = PlacementsHashHashCode;
info.match = PlacementsHashCompare; info.match = PlacementsHashCompare;
int hashFlags = (HASH_ELEM | HASH_FUNCTION | HASH_COMPARE); info.hcxt = CurrentMemoryContext;
int hashFlags = (HASH_ELEM | HASH_FUNCTION | HASH_COMPARE | HASH_CONTEXT);
HTAB *shardPlacementsHash = hash_create("ActivePlacements Hash", HTAB *shardPlacementsHash = hash_create("ActivePlacements Hash",
shardPlacementCount, &info, hashFlags); shardPlacementCount, &info, hashFlags);