All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: Ian Jackson <ian.jackson@eu.citrix.com>, xen-devel@lists.xenproject.org
Subject: Re: [OSSTEST PATCH 1/2] Executive DB: Eliminate SQL locking for read-only transactions
Date: Fri, 11 Dec 2015 16:35:21 +0000	[thread overview]
Message-ID: <1449851721.30975.64.camel@citrix.com> (raw)
In-Reply-To: <1449850984-21651-1-git-send-email-ian.jackson@eu.citrix.com>

On Fri, 2015-12-11 at 16:23 +0000, Ian Jackson wrote:
> Our transactions generally run with
>   SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
> (which, incidentally, does not mean that the transactions are
> necessarily serialisable!)
> 
> In SQL in general it is possible for a read-only transaction to fail
> and need to be retried because some writer has updated things.
> 
> However, in PostgreSQL this is not possible because Postgres uses
> multi-version concurrency control: it retains the old version of the
> data while the read transaction is open:
>   http://www.postgresql.org/docs/8.3/static/transaction-iso.html
> 
> (And, of course, SQLite uses MVCC too, and all transactions in SQLite
> are fully serialisable.)
> 
> So it is not necessary for these read-only operations to take out
> locks.  When they do so they can unnecessarily block other important
> work for long periods of time.
> 
> With this change, we go further from the ability to support databases
> other than PostgreSQL and SQLite.  However, such support was very
> distant anyway because of differences in SQL syntax and semantics, our
> reliance in Executive mode on sql's command line utilities, and so on.
> 
> We retain the db_retry framing because (a) although the retry loop is
> not necessary in these cases, the transaction framing is (b) it will
> make it slightly easier to reverse this decision in the future if we
> ever decide to do so (c) it is less code churn.
> 
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

(I haven't actually checked that everywhere you have changed is actually
r/o, nor whether you have found every r/o operation).


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  parent reply	other threads:[~2015-12-11 16:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-11 16:23 [OSSTEST PATCH 1/2] Executive DB: Eliminate SQL locking for read-only transactions Ian Jackson
2015-12-11 16:23 ` [OSSTEST PATCH 2/2] Executive DB: Reduce strength of DB locks Ian Jackson
2015-12-11 16:37   ` Ian Campbell
2015-12-11 16:53     ` Ian Jackson
2015-12-11 16:35 ` Ian Campbell [this message]
2015-12-11 16:52   ` [OSSTEST PATCH 1/2] Executive DB: Eliminate SQL locking for read-only transactions Ian Jackson

Reply instructions:

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

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

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1449851721.30975.64.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.