You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudberry.apache.org by ma...@apache.org on 2025/03/03 07:50:44 UTC

(cloudberry) 02/02: Fix flaky test in insert_root_partition_truncate_deadlock

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

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

commit 517794184fa282b0a80abbc4ba9f09ae9668c9b2
Author: wenru yan <yw...@vmware.com>
AuthorDate: Wed Aug 10 04:38:12 2022 +0000

    Fix flaky test in insert_root_partition_truncate_deadlock
    
    The injected fault 'func_init_plan_end' is set only triggered once, and it's
    possible that the fault can be triggered by dtx recovery process before than
    insert statement. So in this case, the insert statement is not blocked which
    causes the pipeline failed.
    
    Inject the fault 'func_init_plan_end' in the same session as the insert, and
    specify the current sessionid, so that the fault can't be triggered by other
    sessions.
    
    The test insert_root_partition_truncate_deadlock with gdd have the same problem.
---
 .../isolation2/expected/gdd/insert_root_partition_truncate_deadlock.out | 2 +-
 .../expected/insert_root_partition_truncate_deadlock_without_gdd.out    | 2 +-
 src/test/isolation2/sql/gdd/insert_root_partition_truncate_deadlock.sql | 2 +-
 .../sql/insert_root_partition_truncate_deadlock_without_gdd.sql         | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/test/isolation2/expected/gdd/insert_root_partition_truncate_deadlock.out b/src/test/isolation2/expected/gdd/insert_root_partition_truncate_deadlock.out
index 73a86b95af..bf78325fe9 100644
--- a/src/test/isolation2/expected/gdd/insert_root_partition_truncate_deadlock.out
+++ b/src/test/isolation2/expected/gdd/insert_root_partition_truncate_deadlock.out
@@ -13,7 +13,7 @@
 create table rank_13652 (id int, year int) partition by range (year) (start (2006) end (2009) every (1));
 CREATE
 
-select gp_inject_fault('func_init_plan_end', 'suspend', dbid) from gp_segment_configuration where content = 0 and role = 'p';
+1: select gp_inject_fault('func_init_plan_end', 'suspend', dbid, current_setting('gp_session_id')::int) from gp_segment_configuration where content = 0 and role = 'p';
  gp_inject_fault 
 -----------------
  Success:        
diff --git a/src/test/isolation2/expected/insert_root_partition_truncate_deadlock_without_gdd.out b/src/test/isolation2/expected/insert_root_partition_truncate_deadlock_without_gdd.out
index a97b96e69d..4724a9cf7e 100644
--- a/src/test/isolation2/expected/insert_root_partition_truncate_deadlock_without_gdd.out
+++ b/src/test/isolation2/expected/insert_root_partition_truncate_deadlock_without_gdd.out
@@ -13,7 +13,7 @@
 create table rank_13652 (id int, year int) partition by range (year) (start (2006) end (2009) every (1));
 CREATE
 
-select gp_inject_fault('func_init_plan_end', 'suspend', dbid) from gp_segment_configuration where content = 0 and role = 'p';
+1: select gp_inject_fault('func_init_plan_end', 'suspend', dbid, current_setting('gp_session_id')::int) from gp_segment_configuration where content = 0 and role = 'p';
  gp_inject_fault 
 -----------------
  Success:        
diff --git a/src/test/isolation2/sql/gdd/insert_root_partition_truncate_deadlock.sql b/src/test/isolation2/sql/gdd/insert_root_partition_truncate_deadlock.sql
index d0eda8120d..1faac3c1a4 100644
--- a/src/test/isolation2/sql/gdd/insert_root_partition_truncate_deadlock.sql
+++ b/src/test/isolation2/sql/gdd/insert_root_partition_truncate_deadlock.sql
@@ -14,7 +14,7 @@ create table rank_13652 (id int, year int)
 partition by range (year)
 (start (2006) end (2009) every (1));
 
-select gp_inject_fault('func_init_plan_end', 'suspend', dbid) from gp_segment_configuration where content = 0 and role = 'p';
+1: select gp_inject_fault('func_init_plan_end', 'suspend', dbid, current_setting('gp_session_id')::int) from gp_segment_configuration where content = 0 and role = 'p';
 
 1&: insert into rank_13652 select i,i%3+2006 from generate_series(1, 30)i;
 select gp_wait_until_triggered_fault('func_init_plan_end', 1, dbid) from gp_segment_configuration where content = 0 and role = 'p';
diff --git a/src/test/isolation2/sql/insert_root_partition_truncate_deadlock_without_gdd.sql b/src/test/isolation2/sql/insert_root_partition_truncate_deadlock_without_gdd.sql
index d0eda8120d..1faac3c1a4 100644
--- a/src/test/isolation2/sql/insert_root_partition_truncate_deadlock_without_gdd.sql
+++ b/src/test/isolation2/sql/insert_root_partition_truncate_deadlock_without_gdd.sql
@@ -14,7 +14,7 @@ create table rank_13652 (id int, year int)
 partition by range (year)
 (start (2006) end (2009) every (1));
 
-select gp_inject_fault('func_init_plan_end', 'suspend', dbid) from gp_segment_configuration where content = 0 and role = 'p';
+1: select gp_inject_fault('func_init_plan_end', 'suspend', dbid, current_setting('gp_session_id')::int) from gp_segment_configuration where content = 0 and role = 'p';
 
 1&: insert into rank_13652 select i,i%3+2006 from generate_series(1, 30)i;
 select gp_wait_until_triggered_fault('func_init_plan_end', 1, dbid) from gp_segment_configuration where content = 0 and role = 'p';


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