@@ -74,7 +74,7 @@ SELECT pg_ls_dir('./pg_tblspc/' || oid) = get_tablespace_version_directory_name(
7474FROM pg_tablespace WHERE spcname = 'testspace';
7575 has_version_dir
7676-----------------
77- f
77+ t
7878(1 row)
7979
8080-- Ensure mirrors have applied filesystem changes
@@ -84,6 +84,15 @@ SELECT force_mirrors_to_catch_up();
8484
8585(1 row)
8686
87+ \! ls $PG_ABS_SRCDIR/testtablespace
88+ 1
89+ 2
90+ 3
91+ 4
92+ 5
93+ 6
94+ 7
95+ 8
8796-- Test moving AO/AOCO tables from one tablespace to another.
8897CREATE TABLE ao_ts_table (id int4, t text) with (appendonly=true, orientation=row) distributed by (id);
8998CREATE TABLE aoco_ts_table (id int4, t text) with (appendonly=true, orientation=column) distributed by (id);
@@ -382,9 +391,8 @@ SELECT * FROM
382391WHERE a.versiondirs != get_tablespace_version_directory_name();
383392 versiondirs
384393-------------------
385- GPDB_2_302512051
386394 GPDB_99_399999991
387- (2 rows )
395+ (1 row )
388396
389397SELECT count(*) FROM
390398 (SELECT pg_ls_dir('pg_tblspc/' || oid) AS versiondirs
@@ -394,7 +402,7 @@ SELECT count(*) FROM
394402WHERE a.versiondirs = get_tablespace_version_directory_name();
395403 count
396404-------
397- 0
405+ 1
398406(1 row)
399407
400408-- Do not drop the dbid directory, nor the existing version directory if you
@@ -407,7 +415,31 @@ SELECT force_mirrors_to_catch_up();
407415
408416(1 row)
409417
410- -- Test alter tablespace: PG does not seem to test these.
418+ \! ls $PG_ABS_SRCDIR/testtablespace_existing_version_dir/*
419+ /home/gpadmin/cloudberry/src/test/regress/testtablespace_existing_version_dir/1:
420+ GPDB_99_399999991
421+
422+ /home/gpadmin/cloudberry/src/test/regress/testtablespace_existing_version_dir/2:
423+ GPDB_99_399999991
424+
425+ /home/gpadmin/cloudberry/src/test/regress/testtablespace_existing_version_dir/3:
426+ GPDB_99_399999991
427+
428+ /home/gpadmin/cloudberry/src/test/regress/testtablespace_existing_version_dir/4:
429+ GPDB_99_399999991
430+
431+ /home/gpadmin/cloudberry/src/test/regress/testtablespace_existing_version_dir/5:
432+ GPDB_99_399999991
433+
434+ /home/gpadmin/cloudberry/src/test/regress/testtablespace_existing_version_dir/6:
435+ GPDB_99_399999991
436+
437+ /home/gpadmin/cloudberry/src/test/regress/testtablespace_existing_version_dir/7:
438+ GPDB_99_399999991
439+
440+ /home/gpadmin/cloudberry/src/test/regress/testtablespace_existing_version_dir/8:
441+ GPDB_99_399999991
442+ -- Test alter tablespace: PG does not seem to test these.
411443-- test SET & OWNER
412444ALTER TABLESPACE testspace_otherloc SET (random_page_cost=20.0);
413445SELECT spcoptions FROM pg_tablespace WHERE spcname = 'testspace_otherloc';
@@ -457,5 +489,6 @@ DROP TABLE tblspc_otherloc_heap;
457489DROP TABLESPACE testspace_otherloc;
458490CREATE TABLESPACE testspace_dir_empty LOCATION :'testtablespace';
459491CREATE TABLE t_dir_empty(a int);
492+ \! rm -rf $PG_ABS_SRCDIR/testtablespace
460493DROP TABLE IF EXISTS t_dir_empty;
461494DROP TABLESPACE testspace_dir_empty;
0 commit comments