All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Grittner <kgrittn@gmail.com>
To: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: xen-devel@lists.xenproject.org,
	"pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Subject: Re: [HACKERS] [OSSTEST PATCH 0/1] PostgreSQL db: Retry on constraint violation
Date: Mon, 12 Dec 2016 15:47:44 -0600	[thread overview]
Message-ID: <CACjxUsM3SbYPwPi8K5YJ+w016-GV2RT3mDFHqKAz8Ris+x2vCw__37315.1890853935$1481579336$gmane$org@mail.gmail.com> (raw)
In-Reply-To: <CACjxUsNKtNVhX6EoxY9FjS7N1aJ=inopGT0EqV_yKF6oup0p_g@mail.gmail.com>

On Mon, Dec 12, 2016 at 1:06 PM, Kevin Grittner <kgrittn@gmail.com> wrote:
> On Mon, Dec 12, 2016 at 12:32 PM, Kevin Grittner <kgrittn@gmail.com> wrote:
>
>> As you can see, this generated a serialization failure.
>
> That was on 9.6.  On earlier versions it does indeed allow the
> transaction on connection 2 to commit, yielding a non-serializable
> result.  This makes a pretty strong case for back-patching this
> commit:
>
> https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=fcff8a575198478023ada8a48e13b50f70054766

I have confirmed that this patch applies cleanly to all supported
branches (with some offsets), that the bug is manifest without the
patch, and that it is fixed with this patch in all supported
branches.  This patch has been in the development code base for
about 8 months and in production with the 9.6 release, so it has
been in active production for 3 months with no sign of trouble.  If
you ignore the code comment, doc changes, and new regression tests
it consists of adding one line of code to nbtinsert.c.  What it
does is that when a "unique_violation" error is about to fire, it
adds a check to see whether the conditions for a serialization
failure also exist; if so, it fires that error instead.

This was not initially back-patched, in spite of numerous requests
to do so, because it was a behavior change and not clearly a bug --
it has a least some minimal chance of changing behavior someone
might be relying on; however, Ian has constructed a use-case where
without this patch we clearly allow a serialization anomaly which
is not allowed with the patch, so this patch should, IMO, be
considered a bug fix on that basis.

Barring objections I will back-patch to 9.2 through 9.5 tomorrow.
(9.1 is out of support and the fix is already in 9.6 and forward.)

Release notes for the next minor release set should probably
include a note that for those using serializable transactions a
serialization error can now occur in some situations where a unique
violation would previously have been reported.  I expect that this
will mostly be a welcome change, but it seems like something which
merits a compatibility warning.

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

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

  parent reply	other threads:[~2016-12-12 21:47 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1481307991-16971-1-git-send-email-ian.jackson@eu.citrix.com>
2016-12-09 18:26 ` [OSSTEST PATCH 1/1] PostgreSQL db: Retry transactions on constraint failures Ian Jackson
2016-12-09 22:37 ` [HACKERS] [OSSTEST PATCH 0/1] PostgreSQL db: Retry on constraint violation Kevin Grittner
     [not found] ` <CACjxUsMsHxZ_SrWw7bdCT1Kn8E9mtA1TvhAEbTt-L9AWKKZLCg@mail.gmail.com>
2016-12-12 14:45   ` Ian Jackson
     [not found]   ` <22606.47105.549023.301281@mariner.uk.xensource.com>
2016-12-12 18:32     ` Kevin Grittner
     [not found]     ` <CACjxUsMSyhmUStWshxMeAGN7r2YHp1cTSMVPSwDCeVJD-aR6ag@mail.gmail.com>
2016-12-12 19:06       ` Kevin Grittner
     [not found]       ` <CACjxUsNKtNVhX6EoxY9FjS7N1aJ=inopGT0EqV_yKF6oup0p_g@mail.gmail.com>
2016-12-12 21:47         ` Kevin Grittner [this message]
     [not found]         ` <CACjxUsM3SbYPwPi8K5YJ+w016-GV2RT3mDFHqKAz8Ris+x2vCw@mail.gmail.com>
2016-12-12 22:46           ` Thomas Munro
     [not found]           ` <CAEepm=3Su08X4tTCUMjpxWAbDWbRhKrdw-hQqSmuhTuzYrytew@mail.gmail.com>
2016-12-13 11:30             ` [HACKERS] [OSSTEST PATCH 0/1] PostgreSQL db: Retry on constraint violation [and 2 more messages] Ian Jackson
     [not found]             ` <22607.56276.807567.924144@mariner.uk.xensource.com>
2016-12-13 14:22               ` Kevin Grittner
     [not found]               ` <CACjxUsO+ztVVwxLQ9gdAapn3bqz+1x7m-D8-T8d1Z2aNs0qVfQ@mail.gmail.com>
2016-12-13 15:50                 ` Ian Jackson
     [not found]                 ` <22608.6345.97849.783099@mariner.uk.xensource.com>
2016-12-13 16:43                   ` Kevin Grittner
     [not found]                   ` <CACjxUsNaAdSDKc_p4S52L3p6r6_7F1Nb+viKaCLFVCY=tYdCTg@mail.gmail.com>
2016-12-13 18:00                     ` Ian Jackson
     [not found]                     ` <22608.14118.291149.821376@mariner.uk.xensource.com>
2016-12-13 19:19                       ` Kevin Grittner
2016-12-14  6:44                       ` Robert Haas
     [not found]                       ` <CA+TgmoZ4MH1tSLGZy7gQFpVh3udsucxqvqc0rF8zHqX8aXmRwQ@mail.gmail.com>
2016-12-14 14:05                         ` Alvaro Herrera
2016-12-14 14:26                         ` Kevin Grittner
     [not found]                         ` <20161214140539.hotxjeoshju2m7zw@alvherre.pgsql>
2016-12-14 14:27                           ` Robert Haas
     [not found]                           ` <CA+TgmoZO+N=ATeWD1fZ4rKngPSOu+EQrTGt_7vtVFMAWVogLOA@mail.gmail.com>
2016-12-14 14:40                             ` Kevin Grittner
     [not found]                             ` <CACjxUsM_GXTFwMGRhDKCUCxeSqk4jrhRM7aMt7QRoY5mPegbzg@mail.gmail.com>
2016-12-14 14:42                               ` Robert Haas
2016-12-14 16:20                             ` [HACKERS] [OSSTEST PATCH 0/1] PostgreSQL db: Retry on constraint violation [and 2 more messages] [and 1 " Ian Jackson
     [not found]                         ` <CACjxUsNum7KFyAoe0THB2_qGUMsW9AhwRZ8zANnj_Q8spD8=SA@mail.gmail.com>
2016-12-14 14:38                           ` [HACKERS] [OSSTEST PATCH 0/1] PostgreSQL db: Retry on constraint violation [and 2 " Robert Haas
     [not found]                           ` <CA+TgmoaZ2CHBVMWRUd=-M6n9iX_4xezNSxHTHGRRmsABVGi4Aw@mail.gmail.com>
2016-12-14 15:00                             ` Kevin Grittner
     [not found]                             ` <22609.29020.794032.389420@mariner.uk.xensource.com>
2016-12-14 17:01                               ` [HACKERS] [OSSTEST PATCH 0/1] PostgreSQL db: Retry on constraint violation [and 2 more messages] [and 1 " Kevin Grittner
     [not found]                               ` <CACjxUsNRtRSiEcuz5mCsYzNH+62=ZH5j-j=a-iRm6ri-mnMETQ@mail.gmail.com>
2016-12-14 17:12                                 ` Ian Jackson
     [not found]                                 ` <22609.32147.935746.463570@mariner.uk.xensource.com>
2016-12-14 21:13                                   ` Kevin Grittner
     [not found]                                   ` <CACjxUsO2cO70FV2xueUd-cP20XeYotWAxbMBUGTRFsCtO7JHGg@mail.gmail.com>
2016-12-15 12:09                                     ` Ian Jackson
     [not found]                                     ` <22610.34816.412309.196179@mariner.uk.xensource.com>
2016-12-15 14:01                                       ` Kevin Grittner
     [not found]                                       ` <CACjxUsOtSbArs+tnx2rgK37BUANBaCb4oqvdnPaFxU4Oc7FSKw@mail.gmail.com>
2016-12-15 15:53                                         ` Ian Jackson
     [not found]                                         ` <22610.48273.860663.838783@mariner.uk.xensource.com>
2016-12-15 16:35                                           ` Kevin Grittner
2016-12-16 14:24                                         ` Robert Haas
     [not found]                                         ` <CA+TgmoanO-0e=R3315+wkDw1gG3sXJFhZfG_9-3o4rp=pL-i=g@mail.gmail.com>
2016-12-16 14:39                                           ` Kevin Grittner
     [not found]                                           ` <CACjxUsM2XiWp6GH33M7B+CHEq-s6=traJ5+rr5W4rp==AwyZjg@mail.gmail.com>
2016-12-16 15:00                                             ` Robert Haas
     [not found]                                             ` <CA+TgmoaN0=pEUz_00wY2+tOGiiYOba7kR59HwG8EK0Xbr_HCCQ@mail.gmail.com>
2016-12-16 15:51                                               ` Kevin Grittner
2016-12-14 17:14                               ` Robert Haas
2016-12-14  1:44             ` [HACKERS] [OSSTEST PATCH 0/1] PostgreSQL db: Retry on constraint violation Kevin Grittner

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='CACjxUsM3SbYPwPi8K5YJ+w016-GV2RT3mDFHqKAz8Ris+x2vCw__37315.1890853935$1481579336$gmane$org@mail.gmail.com' \
    --to=kgrittn@gmail.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=pgsql-hackers@postgresql.org \
    --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.