File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
src/backend/replication/logical Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -2740,14 +2740,14 @@ stream_cleanup_files(Oid subid, TransactionId xid)
2740
2740
{
2741
2741
char path [MAXPGPATH ];
2742
2742
StreamXidHash * ent ;
2743
+ bool found = false;
2743
2744
2744
- /* Remove the xid entry from the stream xid hash */
2745
+ /* By this time we must have created the transaction entry */
2745
2746
ent = (StreamXidHash * ) hash_search (xidhash ,
2746
2747
(void * ) & xid ,
2747
- HASH_REMOVE ,
2748
- NULL );
2749
- /* By this time we must have created the transaction entry */
2750
- Assert (ent != NULL );
2748
+ HASH_FIND ,
2749
+ & found );
2750
+ Assert (found );
2751
2751
2752
2752
/* Delete the change file and release the stream fileset memory */
2753
2753
changes_filename (path , subid , xid );
@@ -2763,6 +2763,9 @@ stream_cleanup_files(Oid subid, TransactionId xid)
2763
2763
pfree (ent -> subxact_fileset );
2764
2764
ent -> subxact_fileset = NULL ;
2765
2765
}
2766
+
2767
+ /* Remove the xid entry from the stream xid hash */
2768
+ hash_search (xidhash , (void * ) & xid , HASH_REMOVE , NULL );
2766
2769
}
2767
2770
2768
2771
/*
You can’t perform that action at this time.
0 commit comments