From 5effed3466ebae18c42a46afcc0827ea0879348c Mon Sep 17 00:00:00 2001 From: Vignesh C Date: Thu, 16 Jul 2026 07:47:08 +0530 Subject: [PATCH] Test: avoid redundant REFRESH SEQUENCES in 036_sequences The TAP test issued ALTER SUBSCRIPTION ... REFRESH SEQUENCES after verifying the "insufficient privileges" error. However, since the failed sequence has not yet reached the READY state, the apply worker automatically restarts the sequence synchronization worker. As a result, the explicit REFRESH SEQUENCES can race with the restarted worker and fail with: ERROR: cannot execute ALTER SUBSCRIPTION ... REFRESH SEQUENCES while a sequence synchronization worker is running Remove the unnecessary REFRESH SEQUENCES command. --- src/test/subscription/t/036_sequences.pl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/test/subscription/t/036_sequences.pl b/src/test/subscription/t/036_sequences.pl index 8b02b24a7e9..42386b18f07 100644 --- a/src/test/subscription/t/036_sequences.pl +++ b/src/test/subscription/t/036_sequences.pl @@ -274,9 +274,8 @@ $node_publisher->safe_psql('postgres', qq(DROP SEQUENCE regress_s2;)); $log_offset = -s $node_subscriber->logfile; -$node_subscriber->safe_psql('postgres', - "ALTER SUBSCRIPTION regress_seq_sub REFRESH SEQUENCES"); - +# No need to issue REFRESH SEQUENCES. The sequence synchronization worker is +# restarted automatically because regress_s2 is not yet in the READY state. $node_subscriber->wait_for_log( qr/WARNING: ( [A-Z0-9]+:)? missing sequence on publisher \("public.regress_s2"\)/, $log_offset); -- 2.50.1 (Apple Git-155)