提交 686874e9 编写于 作者: S Soumyadeep Chakraborty

Fix test flakiness in ALTER DATABASE SET TABLESPACE setup

Previously, we did not wait for the mirrors to apply the filesystem
changes involved in a CREATE DATABASE command before 'stat'ing
relfilenodes in all the database instances (including mirrors) in the
test setup. This flakiness was introduced in PR #7792.
Co-authored-by: NDavid Kimura <dkimura@pivotal.io>
上级 402d85f2
......@@ -203,6 +203,9 @@ CREATE TABLESPACE adst_destination_tablespace LOCATION :'adst_destination_tables
-- And we create a database in the source tablespace
CREATE DATABASE alter_db TABLESPACE adst_source_tablespace;
-- And we ensure that the mirrors have applied the filesystem changes for CREATE DATABASE
SELECT force_mirrors_to_catch_up();
-- And we record the filesystem state for the database in the source tablespace
CREATE TEMPORARY TABLE before_alter AS SELECT * FROM stat_db_objects('alter_db', 'adst_source_tablespace');
......@@ -257,6 +260,9 @@ CREATE TABLESPACE adst_destination_tablespace LOCATION :'adst_destination_tables
-- And we create a database in the source tablespace
CREATE DATABASE alter_db TABLESPACE adst_source_tablespace;
-- And we ensure that the mirrors have applied the filesystem changes for CREATE DATABASE
SELECT force_mirrors_to_catch_up();
-- And we record the filesystem state for the database in the source tablespace
CREATE TEMPORARY TABLE before_alter AS SELECT * FROM stat_db_objects('alter_db', 'adst_source_tablespace');
......@@ -317,6 +323,9 @@ CREATE TABLESPACE adst_destination_tablespace LOCATION :'adst_destination_tables
-- And we create a database in the source tablespace
CREATE DATABASE alter_db TABLESPACE adst_source_tablespace;
-- And we ensure that the mirrors have applied the filesystem changes for CREATE DATABASE
SELECT force_mirrors_to_catch_up();
-- And we record the filesystem state for the database in the source tablespace
CREATE TEMPORARY TABLE before_alter AS SELECT * FROM stat_db_objects('alter_db', 'adst_source_tablespace');
......@@ -377,6 +386,9 @@ CREATE TABLESPACE adst_destination_tablespace LOCATION :'adst_destination_tables
-- And we create a database in the source tablespace
CREATE DATABASE alter_db TABLESPACE adst_source_tablespace;
-- And we ensure that the mirrors have applied the filesystem changes for CREATE DATABASE
SELECT force_mirrors_to_catch_up();
-- And we record the filesystem state for the database in the source tablespace
CREATE TEMPORARY TABLE before_alter AS SELECT * FROM stat_db_objects('alter_db', 'adst_source_tablespace');
......@@ -439,6 +451,9 @@ CREATE TABLESPACE adst_destination_tablespace LOCATION :'adst_destination_tables
-- And we create a database in the source tablespace
CREATE DATABASE alter_db TABLESPACE adst_source_tablespace;
-- And we ensure that the mirrors have applied the filesystem changes for CREATE DATABASE
SELECT force_mirrors_to_catch_up();
-- And we record the filesystem state for the database in the source tablespace
CREATE TEMPORARY TABLE before_alter AS SELECT * FROM stat_db_objects('alter_db', 'adst_source_tablespace');
......@@ -499,6 +514,9 @@ CREATE TABLESPACE adst_destination_tablespace LOCATION :'adst_destination_tables
-- And we create a database in the source tablespace
CREATE DATABASE alter_db TABLESPACE adst_source_tablespace;
-- And we ensure that the mirrors have applied the filesystem changes for CREATE DATABASE
SELECT force_mirrors_to_catch_up();
-- And we record the filesystem state for the database in the source tablespace
CREATE TEMPORARY TABLE before_alter AS SELECT * FROM stat_db_objects('alter_db', 'adst_source_tablespace');
......@@ -561,6 +579,9 @@ CREATE TABLESPACE adst_destination_tablespace LOCATION :'adst_destination_tables
-- And we create a database in the source tablespace
CREATE DATABASE alter_db TABLESPACE adst_source_tablespace;
-- And we ensure that the mirrors have applied the filesystem changes for CREATE DATABASE
SELECT force_mirrors_to_catch_up();
-- And we record the filesystem state for the database in the source tablespace
CREATE TEMPORARY TABLE before_alter AS SELECT * FROM stat_db_objects('alter_db', 'adst_source_tablespace');
......@@ -620,6 +641,9 @@ CREATE TABLESPACE adst_destination_tablespace LOCATION :'adst_destination_tables
-- And we create a database in the source tablespace
CREATE DATABASE alter_db TABLESPACE adst_source_tablespace;
-- And we ensure that the mirrors have applied the filesystem changes for CREATE DATABASE
SELECT force_mirrors_to_catch_up();
-- And we record the filesystem state for the database in the source tablespace
-- Note: We can't use a temporary table as PANICS wipe them out
CREATE TABLE before_alter AS SELECT * FROM stat_db_objects('alter_db', 'adst_source_tablespace');
......@@ -683,6 +707,9 @@ CREATE TABLESPACE adst_destination_tablespace LOCATION :'adst_destination_tables
-- And we create a database in the source tablespace
CREATE DATABASE alter_db TABLESPACE adst_source_tablespace;
-- And we ensure that the mirrors have applied the filesystem changes for CREATE DATABASE
SELECT force_mirrors_to_catch_up();
-- And we record the filesystem state for the database in the source tablespace
CREATE TABLE before_alter AS SELECT * FROM stat_db_objects('alter_db', 'adst_source_tablespace');
......
......@@ -182,6 +182,13 @@ CREATE TABLESPACE adst_source_tablespace LOCATION :'adst_source_tablespace_locat
CREATE TABLESPACE adst_destination_tablespace LOCATION :'adst_destination_tablespace_location';
-- And we create a database in the source tablespace
CREATE DATABASE alter_db TABLESPACE adst_source_tablespace;
-- And we ensure that the mirrors have applied the filesystem changes for CREATE DATABASE
SELECT force_mirrors_to_catch_up();
force_mirrors_to_catch_up
---------------------------
(1 row)
-- And we record the filesystem state for the database in the source tablespace
CREATE TEMPORARY TABLE before_alter AS SELECT * FROM stat_db_objects('alter_db', 'adst_source_tablespace');
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause. Creating a NULL policy entry.
......@@ -292,6 +299,13 @@ CREATE TABLESPACE adst_source_tablespace LOCATION :'adst_source_tablespace_locat
CREATE TABLESPACE adst_destination_tablespace LOCATION :'adst_destination_tablespace_location';
-- And we create a database in the source tablespace
CREATE DATABASE alter_db TABLESPACE adst_source_tablespace;
-- And we ensure that the mirrors have applied the filesystem changes for CREATE DATABASE
SELECT force_mirrors_to_catch_up();
force_mirrors_to_catch_up
---------------------------
(1 row)
-- And we record the filesystem state for the database in the source tablespace
CREATE TEMPORARY TABLE before_alter AS SELECT * FROM stat_db_objects('alter_db', 'adst_source_tablespace');
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause. Creating a NULL policy entry.
......@@ -407,6 +421,13 @@ CREATE TABLESPACE adst_source_tablespace LOCATION :'adst_source_tablespace_locat
CREATE TABLESPACE adst_destination_tablespace LOCATION :'adst_destination_tablespace_location';
-- And we create a database in the source tablespace
CREATE DATABASE alter_db TABLESPACE adst_source_tablespace;
-- And we ensure that the mirrors have applied the filesystem changes for CREATE DATABASE
SELECT force_mirrors_to_catch_up();
force_mirrors_to_catch_up
---------------------------
(1 row)
-- And we record the filesystem state for the database in the source tablespace
CREATE TEMPORARY TABLE before_alter AS SELECT * FROM stat_db_objects('alter_db', 'adst_source_tablespace');
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause. Creating a NULL policy entry.
......@@ -528,6 +549,13 @@ CREATE TABLESPACE adst_source_tablespace LOCATION :'adst_source_tablespace_locat
CREATE TABLESPACE adst_destination_tablespace LOCATION :'adst_destination_tablespace_location';
-- And we create a database in the source tablespace
CREATE DATABASE alter_db TABLESPACE adst_source_tablespace;
-- And we ensure that the mirrors have applied the filesystem changes for CREATE DATABASE
SELECT force_mirrors_to_catch_up();
force_mirrors_to_catch_up
---------------------------
(1 row)
-- And we record the filesystem state for the database in the source tablespace
CREATE TEMPORARY TABLE before_alter AS SELECT * FROM stat_db_objects('alter_db', 'adst_source_tablespace');
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause. Creating a NULL policy entry.
......@@ -656,6 +684,13 @@ CREATE TABLESPACE adst_source_tablespace LOCATION :'adst_source_tablespace_locat
CREATE TABLESPACE adst_destination_tablespace LOCATION :'adst_destination_tablespace_location';
-- And we create a database in the source tablespace
CREATE DATABASE alter_db TABLESPACE adst_source_tablespace;
-- And we ensure that the mirrors have applied the filesystem changes for CREATE DATABASE
SELECT force_mirrors_to_catch_up();
force_mirrors_to_catch_up
---------------------------
(1 row)
-- And we record the filesystem state for the database in the source tablespace
CREATE TEMPORARY TABLE before_alter AS SELECT * FROM stat_db_objects('alter_db', 'adst_source_tablespace');
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause. Creating a NULL policy entry.
......@@ -777,6 +812,13 @@ CREATE TABLESPACE adst_source_tablespace LOCATION :'adst_source_tablespace_locat
CREATE TABLESPACE adst_destination_tablespace LOCATION :'adst_destination_tablespace_location';
-- And we create a database in the source tablespace
CREATE DATABASE alter_db TABLESPACE adst_source_tablespace;
-- And we ensure that the mirrors have applied the filesystem changes for CREATE DATABASE
SELECT force_mirrors_to_catch_up();
force_mirrors_to_catch_up
---------------------------
(1 row)
-- And we record the filesystem state for the database in the source tablespace
CREATE TEMPORARY TABLE before_alter AS SELECT * FROM stat_db_objects('alter_db', 'adst_source_tablespace');
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause. Creating a NULL policy entry.
......@@ -905,6 +947,13 @@ CREATE TABLESPACE adst_source_tablespace LOCATION :'adst_source_tablespace_locat
CREATE TABLESPACE adst_destination_tablespace LOCATION :'adst_destination_tablespace_location';
-- And we create a database in the source tablespace
CREATE DATABASE alter_db TABLESPACE adst_source_tablespace;
-- And we ensure that the mirrors have applied the filesystem changes for CREATE DATABASE
SELECT force_mirrors_to_catch_up();
force_mirrors_to_catch_up
---------------------------
(1 row)
-- And we record the filesystem state for the database in the source tablespace
CREATE TEMPORARY TABLE before_alter AS SELECT * FROM stat_db_objects('alter_db', 'adst_source_tablespace');
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause. Creating a NULL policy entry.
......@@ -1025,6 +1074,13 @@ CREATE TABLESPACE adst_source_tablespace LOCATION :'adst_source_tablespace_locat
CREATE TABLESPACE adst_destination_tablespace LOCATION :'adst_destination_tablespace_location';
-- And we create a database in the source tablespace
CREATE DATABASE alter_db TABLESPACE adst_source_tablespace;
-- And we ensure that the mirrors have applied the filesystem changes for CREATE DATABASE
SELECT force_mirrors_to_catch_up();
force_mirrors_to_catch_up
---------------------------
(1 row)
-- And we record the filesystem state for the database in the source tablespace
-- Note: We can't use a temporary table as PANICS wipe them out
CREATE TABLE before_alter AS SELECT * FROM stat_db_objects('alter_db', 'adst_source_tablespace');
......@@ -1146,6 +1202,13 @@ CREATE TABLESPACE adst_source_tablespace LOCATION :'adst_source_tablespace_locat
CREATE TABLESPACE adst_destination_tablespace LOCATION :'adst_destination_tablespace_location';
-- And we create a database in the source tablespace
CREATE DATABASE alter_db TABLESPACE adst_source_tablespace;
-- And we ensure that the mirrors have applied the filesystem changes for CREATE DATABASE
SELECT force_mirrors_to_catch_up();
force_mirrors_to_catch_up
---------------------------
(1 row)
-- And we record the filesystem state for the database in the source tablespace
CREATE TABLE before_alter AS SELECT * FROM stat_db_objects('alter_db', 'adst_source_tablespace');
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause. Creating a NULL policy entry.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册