Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 115caab

Browse files
knizhnikkelvich
authored andcommitted
Lock relation in pglogical_apply: fix possible source of #1582
1 parent 4381788 commit 115caab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pglogical_apply.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,13 +744,14 @@ read_rel(StringInfo s, LOCKMODE mode)
744744
old_context = MemoryContextSwitchTo(TopMemoryContext);
745745
pglogical_relid_map_put(remote_relid, local_relid);
746746
MemoryContextSwitchTo(old_context);
747+
return heap_open(local_relid, NoLock);
747748
} else {
748749
nspnamelen = pq_getmsgbyte(s);
749750
s->cursor += nspnamelen;
750751
relnamelen = pq_getmsgbyte(s);
751752
s->cursor += relnamelen;
753+
return heap_open(local_relid, mode);
752754
}
753-
return heap_open(local_relid, NoLock);
754755
}
755756

756757
static void

0 commit comments

Comments
 (0)