Re: In-place updates and serializable transactions

From: Kevin Grittner <kgrittn(at)gmail(dot)com>
To: kuntalghosh(dot)2007(at)gmail(dot)com
Cc: joshua(dot)yanovski(at)gmail(dot)com, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, hlinnaka(at)iki(dot)fi, Jeff Davis <pgsql(at)j-davis(dot)com>, joe(dot)conway(at)crunchydata(dot)com
Subject: Re: In-place updates and serializable transactions
Date: 2018-11-15 22:36:49
Message-ID: CACjxUsO0W0ZapmFRUs9AyJ-pE9P7k2B-oFs4Q1dwgkApPL_UYg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 15, 2018 at 3:03 AM Kuntal Ghosh <kuntalghosh(dot)2007(at)gmail(dot)com> wrote:

> The test multiple-row-versions is failing because of the
> above-discussed scenario. I've attached the regression diff file and
> the result output file for the same. Here is a brief summary of the
> test w.r.t. heap:
>
> Step 1: T1-> BEGIN; Read FROM t where id=1000000;
> Step 2: T2-> BEGIN; UPDATE t where id=1000000; COMMIT; (creates T1->T2)
> Step 3: T3-> BEGIN; UPDATE t where id=1000000; Read FROM t where id=500000;
> Step 4: T4-> BEGIN; UPDATE t where id= 500000; Read FROM t where id=1;
> COMMIT; (creates T3->T4)
> Step 5: T3-> COMMIT;
> Step 6: T1-> UPDATE t where id=1; COMMIT; (creates T4->T1,)
>
> At step 6, when the update statement is executed, T1 is rolled back
> because of T3->T4->T1.
>
> But for zheap, step 3 also creates a dependency T1->T3 because of
> in-place update. When T4 commits in step 4, it marks T3 as doomed
> because of T1 --> T3 --> T4. Hence, in step 5, T3 is rolled back.

If I understand this, no permutation (order of execution of the
statements in a set of concurrent transactions vulnerable to
serialization anomalies) which have succeeded with the old storage
engine now fail with zheap; what we have with zheap is an earlier
failure in one case. More importantly, zheap doesn't create any false
negatives (cases where a serialization anomaly is missed).

I would say this should be considered a resounding success. We should
probably add an alternative result file to cover this case, but
otherwise I don't see anything which requires action.

Congratulations on making this work so well!

--
Kevin Grittner
VMware vCenter Server
https://www.vmware.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2018-11-15 22:39:59 pg11.1 jit segv
Previous Message Peter Eisentraut 2018-11-15 22:22:59 Re: A small tweak to some comments for PartitionKeyData