@@ -3863,7 +3863,7 @@ apply_worker_exit(void)
3863
3863
* subscription is still active, and so that we won't leak that hash table
3864
3864
* entry if it isn't.
3865
3865
*/
3866
- if (! am_tablesync_worker ())
3866
+ if (am_leader_apply_worker ())
3867
3867
ApplyLauncherForgetWorkerStartTime (MyLogicalRepWorker -> subid );
3868
3868
3869
3869
proc_exit (0 );
@@ -3906,8 +3906,9 @@ maybe_reread_subscription(void)
3906
3906
MySubscription -> name )));
3907
3907
3908
3908
/* Ensure we remove no-longer-useful entry for worker's start time */
3909
- if (! am_tablesync_worker () && ! am_parallel_apply_worker ())
3909
+ if (am_leader_apply_worker ())
3910
3910
ApplyLauncherForgetWorkerStartTime (MyLogicalRepWorker -> subid );
3911
+
3911
3912
proc_exit (0 );
3912
3913
}
3913
3914
@@ -4589,8 +4590,9 @@ InitializeLogRepWorker(void)
4589
4590
MyLogicalRepWorker -> subid )));
4590
4591
4591
4592
/* Ensure we remove no-longer-useful entry for worker's start time */
4592
- if (! am_tablesync_worker () && ! am_parallel_apply_worker ())
4593
+ if (am_leader_apply_worker ())
4593
4594
ApplyLauncherForgetWorkerStartTime (MyLogicalRepWorker -> subid );
4595
+
4594
4596
proc_exit (0 );
4595
4597
}
4596
4598
@@ -4715,7 +4717,7 @@ DisableSubscriptionAndExit(void)
4715
4717
CommitTransactionCommand ();
4716
4718
4717
4719
/* Ensure we remove no-longer-useful entry for worker's start time */
4718
- if (! am_tablesync_worker () && ! am_parallel_apply_worker ())
4720
+ if (am_leader_apply_worker ())
4719
4721
ApplyLauncherForgetWorkerStartTime (MyLogicalRepWorker -> subid );
4720
4722
4721
4723
/* Notify the subscription has been disabled and exit */
0 commit comments