You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudberry.apache.org by le...@apache.org on 2026/10/08 10:22:07 UTC

(cloudberry) 04/08: Disable tasks created to test schedule syntax

This is an automated email from the ASF dual-hosted git repository.

leborchuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit 57d30f9b1387979fa99dfb5c3ec0dde79af4e498
Author: Dianjin Wang <wa...@gmail.com>
AuthorDate: Thu Sep 17 11:08:10 2026 +0800

    Disable tasks created to test schedule syntax
    
    These tasks only check that valid schedules are accepted.
    Deactivate them after creation to avoid background runs interfering
    with cleanup and the oid_wraparound test.
    
    Assisted-by: Claude Code
    Backpatch-through: REL_2_STABLE
---
 contrib/pax_storage/src/test/regress/expected/task.out | 16 ++++++++++++++++
 contrib/pax_storage/src/test/regress/sql/task.sql      | 16 ++++++++++++++++
 src/test/regress/expected/task.out                     | 16 ++++++++++++++++
 src/test/regress/sql/task.sql                          | 16 ++++++++++++++++
 4 files changed, 64 insertions(+)

diff --git a/contrib/pax_storage/src/test/regress/expected/task.out b/contrib/pax_storage/src/test/regress/expected/task.out
index 2f052fdad1a..05eb27defda 100644
--- a/contrib/pax_storage/src/test/regress/expected/task.out
+++ b/contrib/pax_storage/src/test/regress/expected/task.out
@@ -69,10 +69,26 @@ ERROR:  User task_cron does not have CONNECT privilege on task_dbno
 alter task vacuum_db user hopedoesnotexist;
 ERROR:  role "hopedoesnotexist" does not exist
 -- valid interval tasks
+--
+-- These four only exercise the schedule parser, they are never meant to run.
+-- Create and deactivate them in one transaction so the scheduler only sees
+-- inactive tasks. While a second-based task stays active, the scheduler keeps
+-- firing it, and every run draws a run id from the
+-- cluster-wide Oid counter (NextRunId -> GetNewOidWithIndex).  A task still
+-- firing later in the same regression run shifts the counter that
+-- oid_wraparound hardcodes, and DROP TASK, which also deletes the task's
+-- pg_task_run_history rows, fails with "tuple concurrently updated" when it
+-- races the run the scheduler is in the middle of recording.
+begin;
 create task valid_task_1 schedule '1 second' as 'select 1';
+alter task valid_task_1 not active;
 create task valid_task_2 schedule ' 30 sEcOnDs ' as 'select 1';
+alter task valid_task_2 not active;
 create task valid_task_3 schedule '59 seconds' as 'select 1';
+alter task valid_task_3 not active;
 create task valid_task_4 schedule '17  seconds ' as 'select 1';
+alter task valid_task_4 not active;
+commit;
 -- task in function
 DO $$
 BEGIN
diff --git a/contrib/pax_storage/src/test/regress/sql/task.sql b/contrib/pax_storage/src/test/regress/sql/task.sql
index bf12909c761..75df80f058d 100644
--- a/contrib/pax_storage/src/test/regress/sql/task.sql
+++ b/contrib/pax_storage/src/test/regress/sql/task.sql
@@ -49,10 +49,26 @@ alter task vacuum_db database task_dbno user task_cron;
 alter task vacuum_db user hopedoesnotexist;
 
 -- valid interval tasks
+--
+-- These four only exercise the schedule parser, they are never meant to run.
+-- Create and deactivate them in one transaction so the scheduler only sees
+-- inactive tasks. While a second-based task stays active, the scheduler keeps
+-- firing it, and every run draws a run id from the
+-- cluster-wide Oid counter (NextRunId -> GetNewOidWithIndex).  A task still
+-- firing later in the same regression run shifts the counter that
+-- oid_wraparound hardcodes, and DROP TASK, which also deletes the task's
+-- pg_task_run_history rows, fails with "tuple concurrently updated" when it
+-- races the run the scheduler is in the middle of recording.
+begin;
 create task valid_task_1 schedule '1 second' as 'select 1';
+alter task valid_task_1 not active;
 create task valid_task_2 schedule ' 30 sEcOnDs ' as 'select 1';
+alter task valid_task_2 not active;
 create task valid_task_3 schedule '59 seconds' as 'select 1';
+alter task valid_task_3 not active;
 create task valid_task_4 schedule '17  seconds ' as 'select 1';
+alter task valid_task_4 not active;
+commit;
 
 -- task in function
 DO $$
diff --git a/src/test/regress/expected/task.out b/src/test/regress/expected/task.out
index 2f052fdad1a..05eb27defda 100644
--- a/src/test/regress/expected/task.out
+++ b/src/test/regress/expected/task.out
@@ -69,10 +69,26 @@ ERROR:  User task_cron does not have CONNECT privilege on task_dbno
 alter task vacuum_db user hopedoesnotexist;
 ERROR:  role "hopedoesnotexist" does not exist
 -- valid interval tasks
+--
+-- These four only exercise the schedule parser, they are never meant to run.
+-- Create and deactivate them in one transaction so the scheduler only sees
+-- inactive tasks. While a second-based task stays active, the scheduler keeps
+-- firing it, and every run draws a run id from the
+-- cluster-wide Oid counter (NextRunId -> GetNewOidWithIndex).  A task still
+-- firing later in the same regression run shifts the counter that
+-- oid_wraparound hardcodes, and DROP TASK, which also deletes the task's
+-- pg_task_run_history rows, fails with "tuple concurrently updated" when it
+-- races the run the scheduler is in the middle of recording.
+begin;
 create task valid_task_1 schedule '1 second' as 'select 1';
+alter task valid_task_1 not active;
 create task valid_task_2 schedule ' 30 sEcOnDs ' as 'select 1';
+alter task valid_task_2 not active;
 create task valid_task_3 schedule '59 seconds' as 'select 1';
+alter task valid_task_3 not active;
 create task valid_task_4 schedule '17  seconds ' as 'select 1';
+alter task valid_task_4 not active;
+commit;
 -- task in function
 DO $$
 BEGIN
diff --git a/src/test/regress/sql/task.sql b/src/test/regress/sql/task.sql
index bf12909c761..75df80f058d 100644
--- a/src/test/regress/sql/task.sql
+++ b/src/test/regress/sql/task.sql
@@ -49,10 +49,26 @@ alter task vacuum_db database task_dbno user task_cron;
 alter task vacuum_db user hopedoesnotexist;
 
 -- valid interval tasks
+--
+-- These four only exercise the schedule parser, they are never meant to run.
+-- Create and deactivate them in one transaction so the scheduler only sees
+-- inactive tasks. While a second-based task stays active, the scheduler keeps
+-- firing it, and every run draws a run id from the
+-- cluster-wide Oid counter (NextRunId -> GetNewOidWithIndex).  A task still
+-- firing later in the same regression run shifts the counter that
+-- oid_wraparound hardcodes, and DROP TASK, which also deletes the task's
+-- pg_task_run_history rows, fails with "tuple concurrently updated" when it
+-- races the run the scheduler is in the middle of recording.
+begin;
 create task valid_task_1 schedule '1 second' as 'select 1';
+alter task valid_task_1 not active;
 create task valid_task_2 schedule ' 30 sEcOnDs ' as 'select 1';
+alter task valid_task_2 not active;
 create task valid_task_3 schedule '59 seconds' as 'select 1';
+alter task valid_task_3 not active;
 create task valid_task_4 schedule '17  seconds ' as 'select 1';
+alter task valid_task_4 not active;
+commit;
 
 -- task in function
 DO $$


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org