Improve pg_upgrade commentary on multixact change
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Thu, 28 Feb 2013 19:29:17 +0000 (16:29 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Thu, 28 Feb 2013 19:29:17 +0000 (16:29 -0300)
Per gripe from Andres Freund

contrib/pg_upgrade/controldata.c
contrib/pg_upgrade/pg_upgrade.c
contrib/pg_upgrade/pg_upgrade.h

index 0d9a64c967f5ff95bd93af79f3891678aef68e26..c33c20c7c015b7ec1bc83693a02f7828924f2311 100644 (file)
@@ -470,7 +470,8 @@ get_control_data(ClusterInfo *cluster, bool live_check)
        /* verify that we got all the mandatory pg_control data */
        if (!got_xid || !got_oid ||
                !got_multi || !got_mxoff ||
-               (!got_oldestmulti && cluster->controldata.cat_ver >= MULTIXACT_FORMATCHANGE_CAT_VER) ||
+               (!got_oldestmulti &&
+                cluster->controldata.cat_ver >= MULTIXACT_FORMATCHANGE_CAT_VER) ||
                (!live_check && !got_nextxlogfile) ||
                !got_tli ||
                !got_align || !got_blocksz || !got_largesz || !got_walsz ||
@@ -493,7 +494,8 @@ get_control_data(ClusterInfo *cluster, bool live_check)
                if (!got_mxoff)
                        pg_log(PG_REPORT, "  latest checkpoint next MultiXactOffset\n");
 
-               if (!got_oldestmulti && cluster->controldata.cat_ver >= MULTIXACT_FORMATCHANGE_CAT_VER)
+               if (!got_oldestmulti &&
+                       cluster->controldata.cat_ver >= MULTIXACT_FORMATCHANGE_CAT_VER)
                        pg_log(PG_REPORT, "  latest checkpoint oldest MultiXactId\n");
 
                if (!live_check && !got_nextxlogfile)
index 75cf68bcda56baf550cd0328b928ae0d4526eaae..cd6497c220913b3827af5ee0ee1dd4985ac733a6 100644 (file)
@@ -407,11 +407,10 @@ copy_clog_xlog_xid(void)
        check_ok();
 
        /*
-        * If both new and old are after the pg_multixact change commit, copy those
-        * files too.  If the old server is before that change and the new server
-        * is after, then we don't copy anything but we need to reset pg_control so
-        * that the new server doesn't attempt to read multis older than the cutoff
-        * value.
+        * If the old server is before the MULTIXACT_FORMATCHANGE_CAT_VER change
+        * (see pg_upgrade.h) and the new server is after, then we don't copy
+        * pg_multixact files, but we need to reset pg_control so that the new
+        * server doesn't attempt to read multis older than the cutoff value.
         */
        if (old_cluster.controldata.cat_ver >= MULTIXACT_FORMATCHANGE_CAT_VER &&
                new_cluster.controldata.cat_ver >= MULTIXACT_FORMATCHANGE_CAT_VER)
index c110e45c3602a59bb00e37001bb754c477f02989..497098199f6de0fe2a469262c51d501deaac79f0 100644 (file)
@@ -109,7 +109,10 @@ extern char *output_files[];
 #define VISIBILITY_MAP_CRASHSAFE_CAT_VER 201107031
 
 /*
- * pg_multixact format changed in this catversion:
+ * pg_multixact format changed in 9.3 commit 0ac5ad5134f2769ccbaefec73844f85,
+ * ("Improve concurrency of foreign key locking") which also updated catalog
+ * version to this value.  pg_upgrade behavior depends on whether old and new
+ * server versions are both newer than this, or only the new one is.
  */
 #define MULTIXACT_FORMATCHANGE_CAT_VER 201301231