Re: Review: Row-level Locks & SERIALIZABLE transactions, postgres vs. Oracle

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Joseph Conway" <mail(at)joeconway(dot)com>
Cc: <drkp(at)csail(dot)mit(dot)edu>,<fgp(at)phlo(dot)org>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Review: Row-level Locks & SERIALIZABLE transactions, postgres vs. Oracle
Date: 2010-07-18 18:41:02
Message-ID: 4C43046E020000250003382C@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Joseph Conway <mail(at)joeconway(dot)com> wrote:
> On 7/17/10 12:09 PM, Kevin Grittner wrote:

>> I'll post a new patch tomorrow
>
> That all sounds great. I'll concentrate today on understanding the
> theory and high level design.

Well, I started today by doing a make distclean and rebuilding from
scratch, and my patch behaved OK *without* the other patch, so that
issue wasn't real -- I had just gotten into a bad build state
somehow.

I'm attaching a fresh patch, but I think the only differences are:

(1) Some minor changes to line numbers based on recent commits.

(2) Some white space adjustments I made to better comply with style
guidelines.

I've also attached a small patch which hacks pgbench to continue
when a transaction fails with SQLSTATE '40001'. Florian's test
catches these in the test function and ignores them, but with the
SSI technique, some of the failures aren't being detected until the
COMMIT attempt, so the function can't catch and ignore them, so
pgbench has to do so. I'm also attaching a very slightly modified
version of the pgbench test which Florian used for the other patch.
It did show up real problems at first, but those were fixed before
the -2 patch I recently posted. (Yes, I admit that the very first
thing I do these days when I see a test or script which demonstrates
problems with serializability is to test is with the SSI code.)

To run Florian's test, I've been putting these files one level up
from my checkout directory, running the init script through psql,
then running:

pgbench -s 10 -j 10 -c 10 -t 1000 -n -f ../fkbench.pgbench fkbench

To run the tests included in the main patch (if you have python,
twisted, etc., installed), after the make check, run make dcheck.

If you spot anything on the Serializable Wiki page which is unclear,
please feel free to fix it or let me know. I'm hoping to ultimately
draw from that for a README file.

Thanks for looking at this!

-Kevin

Attachment Content-Type Size
serializable-3.patch text/plain 192.8 KB
pgbench-hack40001.patch text/plain 416 bytes
fkbench.init.sql application/octet-stream 1.2 KB
fkbench.pgbench application/octet-stream 105 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2010-07-18 18:47:39 Re: ALTER TABLE SET STATISTICS requires AccessExclusiveLock
Previous Message Dimitri Fontaine 2010-07-18 18:39:07 Re: SHOW TABLES