pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Grittner <kgrittn@ymail.com>
To: Chris Pacejo <cpacejo@clearskydata.com>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: BUG #13660: serializable snapshotting hangs
Date: Wed, 7 Oct 2015 12:41:17 +0000 (UTC)
Message-ID: <1362876295.104559.1444221677453.JavaMail.yahoo@mail.yahoo.com> (raw)
In-Reply-To: <CAC8iE5isTnJ_8KHv6HyWAqW=2q37wpHTiTA3EBLhWzgLVTBJGw@mail.gmail.com>
References: <20151001185144.335.99956@wrigleys.postgresql.org>
	<1379192640.1267648.1444167495623.JavaMail.yahoo@mail.yahoo.com>
	<CAC8iE5isTnJ_8KHv6HyWAqW=2q37wpHTiTA3EBLhWzgLVTBJGw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On Tuesday, October 6, 2015 4:47 PM, Chris Pacejo <cpacejo@clearskydata.com> wrote:

> but I had no other open connections to that database.  There were
> many connections to *other* databases on that same *server*, but
> that shouldn't affect taking a snapshot on an otherwise unused
> database, correct?

Incorrect.  Like vacuum and other visibility-related operations,
long-running transactions in other databases in the same "cluster"
(in the sense of a group of backends running under a single
postmaster) will be an issue.  I seem to recall that it was
non-trivial to limit things in general to a single database, but
perhaps the DEFERRABLE feature could be enhanced to do that without
too much pain.

> Also note that once this happened to one database, it happened to
> *all* databases on the same server simultaneously.

Right; that is because the check for pending transactions is not
database-sensitive.

> It's as if the read-write transaction check is performed
> server-wide, not database-wide as I would expect.

Undoubtedly that would be nicer, but it is not how the current
implementation works.  Taking a quick look, since we currently have
no way (that I know of) to get the database associated with a
VirtualTransactionId, we would need to add the OID of the database
to the SERIALIZABLEXACT structure and add testing it to the tests
inside this loop:

http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/storage/lmgr/predicate.c;h=b...

A change like that would need to be considered an enhancement, not
a bug fix, so it would not be something we could back-patch to
stable branches (or even, at this point, version 9.5).  Given that
it is only a few straightforward lines of code, I'll see about
getting a patch into the next CommitFest so it has a shot at
getting into the release *after* 9.5.  If you're comfortable doing
your own builds from source, you might want to be an "early
adopter" of this patch, once it is written and reviewed.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (9+ messages)  latest in thread

Message-ID: <1362876295.104559.1444221677453.JavaMail.yahoo@mail.yahoo.com>
Permalink:  ../1362876295.104559.1444221677453.JavaMail.yahoo@mail.yahoo.com/
Also on:    postgresql.org/message-id/1362876295.104559.1444221677453.JavaMail.yahoo@mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: kgrittn@ymail.com, cpacejo@clearskydata.com
  Subject: Re: BUG #13660: serializable snapshotting hangs
  In-Reply-To: <1362876295.104559.1444221677453.JavaMail.yahoo@mail.yahoo.com>
  References: <20151001185144.335.99956@wrigleys.postgresql.org> <1379192640.1267648.1444167495623.JavaMail.yahoo@mail.yahoo.com> <CAC8iE5isTnJ_8KHv6HyWAqW=2q37wpHTiTA3EBLhWzgLVTBJGw@mail.gmail.com> <1362876295.104559.1444221677453.JavaMail.yahoo@mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox