Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WtOyL-0005yR-FZ for pgsql-bugs@arkaria.postgresql.org; Sat, 07 Jun 2014 22:20:21 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WtOyK-0000CB-Az for pgsql-bugs@arkaria.postgresql.org; Sat, 07 Jun 2014 22:20:20 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1WtOyI-0000Az-91 for pgsql-bugs@postgresql.org; Sat, 07 Jun 2014 22:20:18 +0000 Received: from nm17-vm6.bullet.mail.ne1.yahoo.com ([98.138.91.110]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1WtOy9-0004Ao-9w for pgsql-bugs@postgresql.org; Sat, 07 Jun 2014 22:20:15 +0000 Received: from [98.138.100.115] by nm17.bullet.mail.ne1.yahoo.com with NNFMP; 07 Jun 2014 22:20:08 -0000 Received: from [98.138.101.178] by tm106.bullet.mail.ne1.yahoo.com with NNFMP; 07 Jun 2014 22:20:07 -0000 Received: from [127.0.0.1] by omp1089.mail.ne1.yahoo.com with NNFMP; 07 Jun 2014 22:20:07 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 980250.70272.bm@omp1089.mail.ne1.yahoo.com Received: (qmail 31706 invoked by uid 60001); 7 Jun 2014 22:20:07 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymail.com; s=s1024; t=1402179607; bh=D+EDD70DYZ3WmYnyvQTnWMj4/g+05aO4yj3IXZFRKcc=; h=References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=qhwHGLK35fjf/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ocket-MIMEInfo: 002.001, VG9tIExhbmUgPHRnbEBzc3MucGdoLnBhLnVzPiB3cm90ZToKPiBLZXZpbiBHcml0dG5lciA8a2dyaXR0bkB5bWFpbC5jb20.IHdyaXRlczoKPj4gSGF2ZSB3ZSByZWFsbHkgcGlubmVkIGRvd24gdGhlIHNlbWFudGljcyBvZiB0aGUgdGhlIHJldHVybiB2YWx1ZXMKPj4gZm9yIEhlYXBUdXBsZVNhdGlzZmllc1ZhY3V1bSgpIGF0IHRoaXMgcG9pbnQ_Cj4KPiBXZWxsLCBub3cgdGhhdCBBbmRyZXMgdW5pbGF0ZXJhbGx5IHJlZGVmaW5lZCBIRUFQVFVQTEVfSU5TRVJUX0lOX1BST0dSRVNTCj4gYXMgbWVhbmluZyABMAEBAQE- X-Mailer: YahooMailWebService/0.8.190.668 References: <20140530143150.GA11051@localhost> <20140531132841.GC1220@awork2.anarazel.de> <1402176440.76325.YahooMailNeo@web122301.mail.ne1.yahoo.com> <29094.1402177752@sss.pgh.pa.us> Message-ID: <1402179607.72015.YahooMailNeo@web122302.mail.ne1.yahoo.com> Date: Sat, 7 Jun 2014 15:20:07 -0700 (PDT) From: Kevin Grittner Reply-To: Kevin Grittner Subject: Re: uninterruptable loop: concurrent delete in progress within table To: Tom Lane Cc: Andres Freund , Alvaro Herrera , "pgsql-bugs@postgresql.org" , Sandro Santilli In-Reply-To: <29094.1402177752@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -2.0 (--) 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 Tom Lane wrote: > Kevin Grittner writes: >> Have we really pinned down the semantics of the the return values >> for HeapTupleSatisfiesVacuum() at this point? > > Well, now that Andres unilaterally redefined HEAPTUPLE_INSERT_IN_PROGRESS > as meaning whatever the heck was easiest, I'd say no ;-). That's kinda what I was afraid of. > But we have to > think about what we do want from it.=A0 I'm not sure that we can positive= ly > guarantee to distinguish all the possible states of an update-in-progress > tuple from outside the updating backend, and it likely would not be worth > the trouble to try since the answer could change at any instant anyway. That sounds like way more than SSI needs anyway. > For the statistical purposes I was on about in the other thread, I would > be satisfied if we could distinguish "will be live if all relevant > transactions commit" from "will be dead if all relevant transactions > commit". If I'm understanding you, and if HEAPTUPLE_LIVE and HEAPTUPLE_DEAD are clear-cut "nothing is in progress" cases, I think that might be enough.=A0 We know coming in whether the tuple is visible to our own transaction; the question is whether its existence has been or is potentially being changed by a top level transaction whose work we can't see.=A0 Ideally we would ignore the effects of a subtransaction underneath such a top level transaction if that subtransaction has rolled back, but it would only compromise efficiency (not correctness) if we didn't ignore the work of subtransactions which have already been rolled back on an uncommitted top-level transaction. >> What the code in predicate.c is using this for is to determine, for >> a given tuple which the calling process is reading, whether it is >> visible to the calling process but has been deleted by another >> transaction (whose work this snapshot can't see), or is not visible >> to the calling process and has been inserted by another transaction >> (whose work this transaction can't see). > > I'm not sure why you'd need HeapTupleSatisfiesVacuum for that at all > --- it sounds like a plain visible-according-to-query-snapshot test. That is *one* of the things we need, and it is passed in as a bool parameter.=A0 We also need to know whether another transaction has committed, or might commit, something which would delete a visible tuple or insert a tuple which is not visible to us (but which has been read on a scan).=A0 In other words, would the results of this scan be different if run again after commit of the other transaction?=A0 We're talking about the CheckForSerializableConflictOut() function, in case my description here isn't clear; perhaps the function comments and/or code will clarify things. http://git.postgresql.org/gitweb/?p=3Dpostgresql.git;a=3Dblob;f=3Dsrc/backe= nd/storage/lmgr/predicate.c;h=3D7c8d53e6a5a44e8bbbda453c730bb5073f8a3842;hb= =3Dmaster#l3850 > Certainly HTSV is unconcerned with visibility as such, so it can't > satisfy this requirement by itself. Right. -- Kevin Grittner EDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs