Skip to content

Commit 5597dd9

Browse files
committed
Fix relcache invalidation
1 parent 87af48e commit 5597dd9

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

pglogical_relcache.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,16 @@ pglogical_relcache_invalidate_callback(Datum arg, Oid reloid)
148148

149149
if (reloid != InvalidOid)
150150
{
151-
/* invalidate one entry */
152-
entry = (PGLogicalRelation *) hash_search(PGLogicalRelationHash,
153-
(void*) &reloid, HASH_FIND, NULL);
151+
HASH_SEQ_STATUS status;
154152

155-
if (entry != NULL)
156-
entry->reloid = InvalidOid;
153+
hash_seq_init(&status, PGLogicalRelationHash);
154+
155+
/* TODO, use inverse lookup hastable */
156+
while ((entry = (PGLogicalRelation *) hash_seq_search(&status)) != NULL)
157+
{
158+
if (entry->reloid == reloid)
159+
entry->reloid = InvalidOid;
160+
}
157161
}
158162
else
159163
{

0 commit comments

Comments
 (0)