Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WsxlH-00028b-Er for pgsql-bugs@arkaria.postgresql.org; Fri, 06 Jun 2014 17:17:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WsxlG-0002FL-QC for pgsql-bugs@arkaria.postgresql.org; Fri, 06 Jun 2014 17:17:02 +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 1WsxlG-0002Ds-1T for pgsql-bugs@postgresql.org; Fri, 06 Jun 2014 17:17:02 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WsxlC-0000O1-M0 for pgsql-bugs@postgresql.org; Fri, 06 Jun 2014 17:17:00 +0000 Received: from intern.anarazel.de (p5DDC7FF0.dip0.t-ipconnect.de [93.220.127.240]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id B6C484E8006; Fri, 6 Jun 2014 19:16:57 +0200 (CEST) Date: Fri, 6 Jun 2014 19:16:56 +0200 From: Andres Freund To: Tom Lane Cc: Alvaro Herrera , Serge Negodyuck , pgsql-bugs@postgresql.org Subject: Re: BUG #8673: Could not open file "pg_multixact/members/xxxx" on slave during hot_standby Message-ID: <20140606171656.GF10482@alap3.anarazel.de> References: <20131209142525.GA1123@awork2.anarazel.de> <20131209150345.GB1123@awork2.anarazel.de> <20131209182701.GD9519@awork2.anarazel.de> <20140103014616.GB7035@eldon.alvh.no-ip.org> <20140606013943.GT5146@eldon.alvh.no-ip.org> <20140606164727.GU5146@eldon.alvh.no-ip.org> <6687.1402074269@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6687.1402074269@sss.pgh.pa.us> X-Pg-Spam-Score: -2.6 (--) 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 On 2014-06-06 13:04:29 -0400, Tom Lane wrote: > Alvaro Herrera writes: > > After some simplification I think it should be clearer. Thanks Andres > > for commenting offlist. > > I find this not only unreadable but a bit scary: > > ! if (offset + MAX_MEMBERS_IN_LAST_MEMBERS_PAGE < offset) > > I'm worried whether some compilers might not decide that that's a > can't-happen situation, and optimize the test away entirely. offset is a (via typedefs) uint32 and unsigned overflow is defined in the C standard, so that shouldn't be a allowed optimization. Don't we already have a fair amount of similar tests around? Around TransactionId wraparound for exzmple: xidWrapLimit = oldest_datfrozenxid + (MaxTransactionId >> 1); if (xidWrapLimit < FirstNormalTransactionId) xidWrapLimit += FirstNormalTransactionId; and similar things. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs