Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id CFBFC9552D6 for ; Tue, 28 Feb 2012 18:42:26 -0400 (AST) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S2VkW-0007tI-79 for pgsql-bugs@postgresql.org; Tue, 28 Feb 2012 22:42:25 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id q1SMgAsA029381; Tue, 28 Feb 2012 17:42:10 -0500 (EST) To: "Kevin Grittner" cc: rlowe@pablowe.net, pgsql-bugs@postgresql.org Subject: Re: BUG #6497: Error sent to client, but data written anyway In-reply-to: <4F4CFA640200002500045CAC@gw.wicourts.gov> References: <23519.1330465109@sss.pgh.pa.us> <4F4CFA640200002500045CAC@gw.wicourts.gov> Comments: In-reply-to "Kevin Grittner" message dated "Tue, 28 Feb 2012 16:01:40 -0600" Date: Tue, 28 Feb 2012 17:42:10 -0500 Message-ID: <29380.1330468930@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201202/206 X-Sequence-Number: 32549 "Kevin Grittner" writes: > Tom Lane wrote: >> Huh? If the backend dumped core before you sent it the commit, >> the data will certainly not be committed. It might be physically >> present on disk, but it won't be considered valid. > I suppose that there is a window of time between the commit becoming > effective and the return to the application which, from a user > perspective, would be hard to distinguish from what the OP > described. I don't really see how that can be avoided, though, > short of a transaction manager using 2PC. Any time the server > crashes while a COMMIT is pending, one must check to see whether it > "took". Yeah, a post-commit crash leaves you in doubt about whether the commit "took", but you get into byzantine-generals issues as soon as you try to design that out. Consider the possibility that the commit went fine but the network eats the reply packet saying so. Really, any application that is constructed to reconnect and retry has got to have logic to test whether the commit occurred, not just assume that it did or didn't. (2PC is hardly a magic bullet for this, either.) regards, tom lane