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

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

commit fd247d855b1bf2bcb1ed006ce0545a49bad53c17
Author: Huansong Fu <fuhuans...@gmail.com>
AuthorDate: Wed May 31 11:23:12 2023 -0700

    Fix an issue with vacuum in TAP test
    
    VACUUM maintains an `OldestXmin` which helps check if a dead tuple can be
    safely vacuumed if it was deleted before the `OldestXmin`. The function
    GetOldestXmin() provides that value and it also checks the distributed 
oldest
    xmin because we want to make sure that we don't clean up some tuples that
    are still visible to a running DTX.
    
    It is a well-thought decision that even in utility mode we maintain the
    above behavior (see commit b3f300b94573) for correctness. But that makes
    a TAP test fails because VACUUM couldn't work.
    
    However, in TAP test where we launch the cluster in coordinator mode, we
    should be able to ignore the distributed oldest xmin because there won't be
    any DTX. The GUC maintainance_mode has been used to do that in the past (see
    commit 4eb48055dda2). Now set the GUC to ON for all TAP tests which should
    fix the issue.
---
 src/bin/pg_rewind/t/102_bitmaptest.pl | 15 +++++++--------
 src/test/perl/PostgresNode.pm         |  2 +-
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/src/bin/pg_rewind/t/102_bitmaptest.pl 
b/src/bin/pg_rewind/t/102_bitmaptest.pl
index a08f6093d8..9629251bed 100644
--- a/src/bin/pg_rewind/t/102_bitmaptest.pl
+++ b/src/bin/pg_rewind/t/102_bitmaptest.pl
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use TestLib;
-use Test::More tests => 11;
+use Test::More tests => 13;
 
 use FindBin;
 use lib $FindBin::RealBin;
@@ -37,13 +37,12 @@ sub run_test
        # To create hole for generating UPDATE_WORD and UPDATE_WORDS wal
        # records.
        primary_psql("VACUUM verbose tb1");
-       # make sure vacuum worked GPDB_12_MERGE_FIXME: not sure why vacuum
-       # is not working here. Investigate and fix it.
-#      check_query(
-#              'SET gp_select_invisible to on; SELECT COUNT(*) FROM tb1',
-#              qq(64
-# ),
-#              'table content after vacuum');
+       # make sure vacuum worked
+       check_query(
+               'SET gp_select_invisible to on; SELECT COUNT(*) FROM tb1',
+               qq(64
+),
+               'table content after vacuum');
 
        # each insert serves the purpose to generate the specific wal record
        # type for bitmap.
diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm
index 9a258c1f30..86e4d8c207 100644
--- a/src/test/perl/PostgresNode.pm
+++ b/src/test/perl/PostgresNode.pm
@@ -872,7 +872,7 @@ sub start
                # Note: We set the cluster_name here, not in postgresql.conf (in
                # sub init) so that it does not get copied to standbys.
                $ret = TestLib::system_log('pg_ctl', '-D', $self->data_dir, 
'-l',
-               $self->logfile, '-o', "--cluster-name=$name -c gp_role=utility 
--gp_dbid=$self->{_dbid} --gp_contentid=0",
+               $self->logfile, '-o', "--cluster-name=$name -c gp_role=utility 
--gp_dbid=$self->{_dbid} --gp_contentid=0 -c maintenance_mode=on",
                        'start');
        }
 


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

Reply via email to