Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bHHnJ-0007SL-48 for pgsql-hackers@arkaria.postgresql.org; Sun, 26 Jun 2016 21:40:45 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bHHnI-0002OA-Md for pgsql-hackers@arkaria.postgresql.org; Sun, 26 Jun 2016 21:40:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bHHlv-0000mo-0j for pgsql-hackers@postgresql.org; Sun, 26 Jun 2016 21:39:19 +0000 Received: from mail-pf0-x22a.google.com ([2607:f8b0:400e:c00::22a]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bHHlq-0004Iq-Qd for pgsql-hackers@postgresql.org; Sun, 26 Jun 2016 21:39:18 +0000 Received: by mail-pf0-x22a.google.com with SMTP id i123so55108732pfg.0 for ; Sun, 26 Jun 2016 14:39:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=SSfPZBECZCOay8oRVPP+/L7/222sI1ZVWWkb+rEr3KA=; b=A+GquNtwogmqCpvK4LYAi8YsmvRKeHMtWum9rVcsJRIaV34J3R/zOhiGXvOy99pJN/ gFmQ4oBLw0bf+9UvUcEQNH9/tO60X+vBiJe+207VE5DbcgO8bWuFXUJYAPYeVTKW6hB3 4GEOker7FaYr5eXCjXH2cwfbp7kzctlg+M0DI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=SSfPZBECZCOay8oRVPP+/L7/222sI1ZVWWkb+rEr3KA=; b=Do+ZItJ7h605lwmrhH5Hsl+govQF/vHWFBGbZKY1nXVT/nKkYVl+olB+R78PBpwx2U lIg5MMirqrld3RbVRWPyhnCvz3VOBgYwH4R/INmOqviKtlC2rKOCPYuRSzqAVC7+tGwU a9VUChUwkxHTFKq95hzGwcH0N9kZ2vY1Ki5E0YiWVlJQtHrFEeyy+SkauohN6eUk/kPS inE6zilT5d8hra5XRwcV6xWG99SKKrj4YZB7+QrUMTOqwFUUOgBUAaTxn2QLXBYjrpwW ptIa++0eTxSuVcZ+ZFMsIH6Rr21bPIvaXlpfFKvO4mO1v9/Y+pNGZevlF6HzOAlTpgO8 D2eg== X-Gm-Message-State: ALyK8tJlzofTTsI5BDcO0GadfFLuOTMNKScTi6HEuswEPX/a5Tkfx9+6Se44NNyEtHAkZQ== X-Received: by 10.98.5.2 with SMTP id 2mr27846826pff.58.1466977151997; Sun, 26 Jun 2016 14:39:11 -0700 (PDT) Received: from tornado.leadboat.com (c-98-248-47-228.hsd1.ca.comcast.net. [98.248.47.228]) by smtp.gmail.com with ESMTPSA id t4sm1664009paf.39.2016.06.26.14.39.10 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 26 Jun 2016 14:39:10 -0700 (PDT) Date: Sun, 26 Jun 2016 17:39:08 -0400 From: Noah Misch To: Thomas Munro Cc: Robert Haas , Alvaro Herrera , Andres Freund , Amit Kapila , Stephen Frost , Michael Paquier , Masahiko Sawada , "pgsql-hackers@postgresql.org" Subject: Re: Reviewing freeze map code Message-ID: <20160626213908.GA1317196@tornado.leadboat.com> References: <20160617033628.GA1062555@tornado.leadboat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On Tue, Jun 21, 2016 at 10:59:25AM +1200, Thomas Munro wrote: > On Fri, Jun 17, 2016 at 3:36 PM, Noah Misch wrote: > > I agree the non-atomic, unlogged change is a problem. A related threat > > doesn't require a torn page: > > > > AssignTransactionId() xid=123 > > heapam.c:3931 HeapTupleHeaderSetXmax(oldtup.t_data, 123); > > some ERROR before heap_update() finishes > > rollback; -- xid=123 > > some backend flushes the modified page > > immediate shutdown > > AssignTransactionId() xid=123 > > commit; -- xid=123 > > > > If nothing wrote an xlog record that witnesses xid 123, the cluster can > > reassign it after recovery. The failed update is now considered a successful > > update, and the row improperly becomes dead. That's important. > > I wonder if that was originally supposed to be handled with the > HEAP_XMAX_UNLOGGED flag which was removed in 11919160. A comment in > the heap WAL logging commit f2bfe8a2 said that tqual routines would > see the HEAP_XMAX_UNLOGGED flag in the event of a crash before logging > (though I'm not sure if the tqual routines ever actually did that). HEAP_XMAX_UNLOGGED does appear to have originated in contemplation of this same hazard. Looking at the three commits in "git log -S HEAP_XMAX_UNLOGGED" (f2bfe8a b58c041 1191916), nothing ever completed the implementation by testing for that flag. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers