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:11 UTC

(cloudberry) 06/07: Unify todos and fixmes in pg_upgrade code.

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 b59b0d567e35ed41b1f8614e4e7ad16406f8eae3
Author: Brent Doil <bd...@vmware.com>
AuthorDate: Tue Jan 16 18:08:34 2024 -0500

    Unify todos and fixmes in pg_upgrade code.
    
    Replace all of the XXX, TODO, FIXME etc. in the
    pg_upgrade code with GPDB_UPGRADE_FIXME to make
    it easier to keep track of them.
---
 src/bin/pg_upgrade/Makefile               | 6 ++++++
 src/bin/pg_upgrade/greenplum/aotable.c    | 2 +-
 src/bin/pg_upgrade/greenplum/check_gp.c   | 6 +++---
 src/bin/pg_upgrade/greenplum/version_gp.c | 2 +-
 src/bin/pg_upgrade/info.c                 | 2 +-
 src/bin/pg_upgrade/pg_upgrade.c           | 6 +++---
 src/bin/pg_upgrade/relfilenode.c          | 2 +-
 src/bin/pg_upgrade/test_gpdb.sh           | 8 ++++----
 src/bin/pg_upgrade/test_gpdb_pre.sql      | 2 +-
 9 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/src/bin/pg_upgrade/Makefile b/src/bin/pg_upgrade/Makefile
index a4c6d0ed23..54781916d8 100644
--- a/src/bin/pg_upgrade/Makefile
+++ b/src/bin/pg_upgrade/Makefile
@@ -57,6 +57,12 @@ clean distclean maintainer-clean:
 greenplum/aomd_filehandler.c: $(top_srcdir)/src/backend/access/appendonly/aomd_filehandler.c
 	rm -f $@ && cd greenplum && $(LN_S) ../$< aomd_filehandler.c
 
+# GPDB_UPGRADE_FIXME:
+# GPDB want to run installcheck of pg_upgrade in the end of installcheck-world
+# let installcheck be a no-op, so "make -C src/bin/ installcheck" does nothing on
+# src/bin/pg_upgrade, the real test of pg_upgrade will be triggered by
+# "make check" in the end of installcheck-world, see GNUmakefile.in
+
 # When $(MAKE) is present, make automatically infers that this is a
 # recursive make. which is not actually what we want here, as that
 # e.g. prevents output synchronization from working (as make thinks
diff --git a/src/bin/pg_upgrade/greenplum/aotable.c b/src/bin/pg_upgrade/greenplum/aotable.c
index 2d5b81ed82..d295b08609 100644
--- a/src/bin/pg_upgrade/greenplum/aotable.c
+++ b/src/bin/pg_upgrade/greenplum/aotable.c
@@ -83,7 +83,7 @@ restore_aosegment_table(PGconn *conn, RelInfo *rel)
 
 	res = executeQueryOrDie(conn, "%s", query->data);
 
-	/* XXX We should really find an aosegments table here */
+	/* GPDB_UPGRADE_FIXME We should really find an aosegments table here */
 	if (PQntuples(res) == 0)
 	{
 		PQclear(res);
diff --git a/src/bin/pg_upgrade/greenplum/check_gp.c b/src/bin/pg_upgrade/greenplum/check_gp.c
index f2c7e09931..87e1e52824 100644
--- a/src/bin/pg_upgrade/greenplum/check_gp.c
+++ b/src/bin/pg_upgrade/greenplum/check_gp.c
@@ -143,7 +143,7 @@ check_external_partition(void)
 	/*
 	 * This was only a problem with GPDB 6 and below.
 	 *
-	 * GPDB_12_MERGE_FIXME: Could we support upgrading these to GPDB 7,
+	 * GPDB_UPGRADE_FIXME: Could we support upgrading these to GPDB 7,
 	 * even though it wasn't possible before? The upstream syntax used in
 	 * GPDB 7 to recreate the partition hierarchy is more flexible, and
 	 * could possibly handle this. If so, we could remove this check
@@ -404,7 +404,7 @@ check_partition_indexes(void)
 	/*
 	 * This was only a problem with GPDB 6 and below.
 	 *
-	 * GPDB_12_MERGE_FIXME: Could we support upgrading these to GPDB 7,
+	 * GPDB_UPGRADE_FIXME: Could we support upgrading these to GPDB 7,
 	 * even though it wasn't possible before? The upstream syntax used in
 	 * GPDB 7 to recreate the partition hierarchy is more flexible, and
 	 * could possibly handle this. If so, we could remove this check
@@ -656,7 +656,7 @@ check_for_array_of_partition_table_types(ClusterInfo *cluster)
 	/*
 	 * This was only a problem with GPDB 6 and below.
 	 *
-	 * GPDB_12_MERGE_FIXME: Could we support upgrading these to GPDB 7,
+	 * GPDB_UPGRADE_FIXME: Could we support upgrading these to GPDB 7,
 	 * even though it wasn't possible before? The upstream syntax used in
 	 * GPDB 7 to recreate the partition hierarchy is more flexible, and
 	 * could possibly handle this. If so, we could remove this check
diff --git a/src/bin/pg_upgrade/greenplum/version_gp.c b/src/bin/pg_upgrade/greenplum/version_gp.c
index f9296041ce..9736b68cb8 100644
--- a/src/bin/pg_upgrade/greenplum/version_gp.c
+++ b/src/bin/pg_upgrade/greenplum/version_gp.c
@@ -255,7 +255,7 @@ old_GPDB6_check_for_unsupported_sha256_password_hashes(void)
 /*
  * new_gpdb_invalidate_bitmap_indexes()
  *
- * TODO: We are currently missing the support to migrate over bitmap indexes.
+ * GPDB_UPGRADE_FIXME: We are currently missing the support to migrate over bitmap indexes.
  * Hence, mark all bitmap indexes as invalid.
  */
 void
diff --git a/src/bin/pg_upgrade/info.c b/src/bin/pg_upgrade/info.c
index 3170ceaf19..8c6cc45d8a 100644
--- a/src/bin/pg_upgrade/info.c
+++ b/src/bin/pg_upgrade/info.c
@@ -145,7 +145,7 @@ gen_db_file_maps(DbInfo *old_db, DbInfo *new_db,
 			continue;
 		}
 
-		/* XXX Why are we doing this here and not in get_rel_infos()? */
+		/* GPDB_UPGRADE_FIXME Why are we doing this here and not in get_rel_infos()? */
 		if (old_rel->aosegments != NULL)
 			old_rel->reltype = AO;
 		else if (old_rel->aocssegments != NULL)
diff --git a/src/bin/pg_upgrade/pg_upgrade.c b/src/bin/pg_upgrade/pg_upgrade.c
index 87ad454f9e..236dac3fca 100644
--- a/src/bin/pg_upgrade/pg_upgrade.c
+++ b/src/bin/pg_upgrade/pg_upgrade.c
@@ -212,7 +212,7 @@ main(int argc, char **argv)
 	check_ok();
 
 	/*
-	 * In upgrading from GPDB4, copy the pg_distributedlog over in vanilla.
+	 * GPDB_UPGRADE_FIXME: Copy the pg_distributedlog over in vanilla.
 	 * The assumption that this works needs to be verified
 	 */
 	copy_subdir_files("pg_distributedlog", "pg_distributedlog");
@@ -687,7 +687,7 @@ create_new_objects(void)
 	/* update new_cluster info now that we have objects in the databases */
 	get_db_and_rel_infos(&new_cluster);
 
-	/* TODO: Bitmap indexes are not supported, so mark them as invalid. */
+	/* Bitmap indexes are not currently supported, so mark them as invalid. */
 	new_gpdb_invalidate_bitmap_indexes();
 }
 
@@ -741,7 +741,7 @@ static void
 copy_xact_xlog_xid(void)
 {
 	/*
-	 * FIXME: Definitely need more work to make pre-gp7 to gp7 upgrade
+	 * GPDB_UPGRADE_FIXME: Definitely need more work to make pre-gp7 to gp7 upgrade
 	 * work for the 64bit gxid work.
 	 */
 	/* set the next distributed transaction id of the new cluster */
diff --git a/src/bin/pg_upgrade/relfilenode.c b/src/bin/pg_upgrade/relfilenode.c
index f0640fc88f..d4751f535d 100644
--- a/src/bin/pg_upgrade/relfilenode.c
+++ b/src/bin/pg_upgrade/relfilenode.c
@@ -218,7 +218,7 @@ transfer_relfile(FileNameMap *map, const char *type_suffix, bool vm_must_add_fro
  * file (the one without an extent suffix) for a relation is also fatal, since
  * we expect that to exist for both heap and AO tables in any case.
  *
- * TODO: verify that AO tables must always have a segment zero.
+ * GPDB_UPGRADE_FIXME: verify that AO tables must always have a segment zero.
  */
 static bool
 transfer_relfile_segment(int segno, FileNameMap *map,
diff --git a/src/bin/pg_upgrade/test_gpdb.sh b/src/bin/pg_upgrade/test_gpdb.sh
index bba7d40d99..5c770240aa 100755
--- a/src/bin/pg_upgrade/test_gpdb.sh
+++ b/src/bin/pg_upgrade/test_gpdb.sh
@@ -62,7 +62,7 @@ retain_tempdir=0
 
 # For performance testing, we want to skip everything other than what we need
 # to upgrade to the new cluster.  This tests the nominal production use case.
-# TODO: what about the pg_upgrade precheck for upgrade?
+# GPDB_UPGRADE_FIXME: what about the pg_upgrade precheck for upgrade?
 perf_test=0
 
 # Not all platforms have a realpath binary in PATH, most notably macOS doesn't,
@@ -132,7 +132,7 @@ check_vacuum_worked()
         return 0;
     fi
 
-	# GPDB_94_MERGE_FIXME: This test doesn't work in 9.4 anymore, because
+	# GPDB_UPGRADE_FIXME: This test doesn't work in 9.4 anymore, because
 	# freezing no longer resets 'xmin', it just sets a new flag in the
 	# tuple header to indicate that the row is frozen. See upstream commit
 	# 37484ad2aa. Need to find a new way to verify this.
@@ -202,7 +202,7 @@ upgrade_segment()
 	fi
 	popd
 
-	# TODO: run check_vacuum_worked on each segment, too, once we have a good
+	# GPDB_UPGRADE_FIXME: run check_vacuum_worked on each segment, too, once we have a good
 	# candidate catalog table (gp_segment_configuration doesn't exist on
 	# segments).
 }
@@ -276,7 +276,7 @@ diff_and_exit() {
 	# shouldn't be a cause of difference in the files but it is. Partitioning info
 	# is generated via backend functionality in the cluster being dumped, and not
 	# in pg_dump, so whitespace changes can trip up the diff.
-	# FIXME: Maybe we should not use '-w' in the future since it is too aggressive.
+	# GPDB_UPGRADE_FIXME: Maybe we should not use '-w' in the future since it is too aggressive.
 	if ! diff -w "$temp_root/dump1.sql" "$temp_root/dump2.sql" >/dev/null; then
 		# To aid debugging in pipelines, print the diff to stdout. Ignore
 		# whitespace, as above, to avoid misdirecting the troubleshooter.
diff --git a/src/bin/pg_upgrade/test_gpdb_pre.sql b/src/bin/pg_upgrade/test_gpdb_pre.sql
index 9327c97746..95a0194ab4 100644
--- a/src/bin/pg_upgrade/test_gpdb_pre.sql
+++ b/src/bin/pg_upgrade/test_gpdb_pre.sql
@@ -16,7 +16,7 @@ DROP DATABASE IF EXISTS isolation_regression;
 -- Note: Table newpart is 'not' a partition table, and the index's referenced above are created by a check constraint.
 DROP TABLE IF EXISTS public.newpart CASCADE;
 
--- GPDB_94_STABLE_MERGE_FIXME: The patent table has NO INHERIT
+-- GPDB_UPGRADE_FIXME: The patent table has NO INHERIT
 -- constraint for this table. This is not handled for pg_upgrade and
 -- check if needs to be fixed or not. This table was newly added to
 -- alter_table.sql as part of 9.4 STABLE merge.


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