Skip to content

Commit

Permalink
Fix local_directory_table_mixed test cases will make standby start fa…
Browse files Browse the repository at this point in the history
…iled

In the test case `local_directory_table_mixed`, created the tablespace
`directory_tblspc` which depends on the local dir `@testtablespace@`.
But in the end of test, we will remove the local dir `@testtablespace@`,
This will cause an error when replaying the WAL log in standby.

Also we should not use the `@testtablespace@`, but with a subdir in this
dir.
  • Loading branch information
jiaqizho authored and my-ship-it committed Aug 19, 2024
1 parent edd15ba commit 1542162
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
7 changes: 3 additions & 4 deletions src/test/isolation2/input/local_directory_table_mixed.source
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
-- Mixed test for local directory table
-- setup for temp tablespace
! rm -rf '@testtablespace@';
! mkdir -p '@testtablespace@';
! rm -rf '@testtablespace@/local_directory_table_mixed/';
! mkdir -p '@testtablespace@/local_directory_table_mixed/';
DROP TABLESPACE IF EXISTS directory_tblspc;
CREATE TABLESPACE directory_tblspc LOCATION '@testtablespace@';
CREATE TABLESPACE directory_tblspc LOCATION '@testtablespace@/local_directory_table_mixed/';

CREATE EXTENSION IF NOT EXISTS gp_inject_fault;

Expand Down Expand Up @@ -128,7 +128,6 @@ CREATE EXTENSION IF NOT EXISTS gp_inject_fault;
1: COMMIT;
2: COMMIT;

! rm -rf '@testtablespace@';
DROP TABLESPACE directory_tblspc;
DROP DIRECTORY TABLE dir_table1;
DROP DIRECTORY TABLE dir_table2;
Expand Down
8 changes: 3 additions & 5 deletions src/test/isolation2/output/local_directory_table_mixed.source
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
-- Mixed test for local directory table
-- setup for temp tablespace
! rm -rf '@testtablespace@';
! rm -rf '@testtablespace@/local_directory_table_mixed/';

! mkdir -p '@testtablespace@';
! mkdir -p '@testtablespace@/local_directory_table_mixed/';

DROP TABLESPACE IF EXISTS directory_tblspc;
DROP
CREATE TABLESPACE directory_tblspc LOCATION '@testtablespace@';
CREATE TABLESPACE directory_tblspc LOCATION '@testtablespace@/local_directory_table_mixed/';
CREATE

CREATE EXTENSION IF NOT EXISTS gp_inject_fault;
Expand Down Expand Up @@ -370,8 +370,6 @@ COMMIT
2: COMMIT;
COMMIT

! rm -rf '@testtablespace@';

DROP TABLESPACE directory_tblspc;
ERROR: tablespace "directory_tblspc" cannot be dropped because some objects depend on it
DETAIL: tablespace for directory table dir_table1
Expand Down

0 comments on commit 1542162

Please sign in to comment.