Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X2O4d-00041Y-5S for pgsql-bugs@arkaria.postgresql.org; Wed, 02 Jul 2014 17:11:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1X2O4c-0004zD-M0 for pgsql-bugs@arkaria.postgresql.org; Wed, 02 Jul 2014 17:11:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X2O4c-0004z5-20 for pgsql-bugs@postgresql.org; Wed, 02 Jul 2014 17:11:58 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1X2O4Y-0001Wl-FS for pgsql-bugs@postgresql.org; Wed, 02 Jul 2014 17:11:57 +0000 Received: from bruce by momjian.us with local (Exim 4.72) (envelope-from ) id 1X2O4V-0003EK-I5; Wed, 02 Jul 2014 13:11:51 -0400 Date: Wed, 2 Jul 2014 13:11:51 -0400 From: Bruce Momjian To: Alvaro Herrera Cc: Andres Freund , PostgreSQL Bugs Subject: Re: pg_upgrade < 9.3 -> >=9.3 misses a step around multixacts Message-ID: <20140702171151.GA20463@momjian.us> References: <20140619020633.GA20469@momjian.us> <20140619015205.GD3806@momjian.us> <20140619014034.GC3806@momjian.us> <20140619220425.GQ18688@eldon.alvh.no-ip.org> <20140620010653.GS18688@eldon.alvh.no-ip.org> <20140620180725.GD29143@momjian.us> <20140624201346.GB17110@momjian.us> <20140627210520.GP7340@eldon.alvh.no-ip.org> <20140701014917.GA21190@momjian.us> <20140702155634.GD7340@eldon.alvh.no-ip.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ikeVEW9yuYc//A+q" Content-Disposition: inline In-Reply-To: <20140702155634.GD7340@eldon.alvh.no-ip.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org --ikeVEW9yuYc//A+q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Jul 2, 2014 at 11:56:34AM -0400, Alvaro Herrera wrote: > > How are we not creating a gap in members files by setting the members > > value? Why will that not cause problems? > > We're not setting the offset and member value here; we're setting the > "nextMulti" and "oldestMulti" values. Both affect the offsets counter, > not the members counter. The members counter is kept at zero, so the > next multi to be allocated will create members starting from the first > members position in page zero. initdb of the new cluster created the > first members page, which corresponds to the first members value that > will be used. > > Note pg_resetxlog --help says: > > -m MXID,MXID set next and oldest multitransaction ID > > I think you're confusing the fact that we pass two values here (next and > oldest, both apply to offset counters) with offsets vs. members. > > To affect the members counter you would use this other pg_resetxlog switch: > -O OFFSET set next multitransaction offset > which, AFAICS, we only use when upgrading from a 9.3+ cluster to a newer > 9.3+ cluster (and we also copy the files from old cluster to the new > one). OK, thanks for the analysis. Attached patch applied back through 9.3. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + Everyone has their own god. + --ikeVEW9yuYc//A+q Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="pg_upgrade.diff" diff --git a/contrib/pg_upgrade/pg_upgrade.c b/contrib/pg_upgrade/pg_upgrade.c new file mode 100644 index b32d81e..5e715fc *** a/contrib/pg_upgrade/pg_upgrade.c --- b/contrib/pg_upgrade/pg_upgrade.c *************** copy_clog_xlog_xid(void) *** 451,461 **** else if (new_cluster.controldata.cat_ver >= MULTIXACT_FORMATCHANGE_CAT_VER) { /* ! * Remove files created by initdb that no longer match the ! * new multi-xid value. */ remove_new_subdir("pg_multixact/offsets", false); - remove_new_subdir("pg_multixact/members", false); prep_status("Setting oldest multixact ID on new cluster"); --- 451,461 ---- else if (new_cluster.controldata.cat_ver >= MULTIXACT_FORMATCHANGE_CAT_VER) { /* ! * Remove offsets/0000 file created by initdb that no longer matches ! * the new multi-xid value. "members" starts at zero so no need to ! * remove it. */ remove_new_subdir("pg_multixact/offsets", false); prep_status("Setting oldest multixact ID on new cluster"); --ikeVEW9yuYc//A+q Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs --ikeVEW9yuYc//A+q--