Re: [HACKERS] Restrict concurrent update/delete with UPDATE of partition key

From: amul sul <sulamul(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Restrict concurrent update/delete with UPDATE of partition key
Date: 2018-02-13 07:11:26
Message-ID: CAAJ_b95GpE7Qh+17zY-d5p5xPfqcTSY5ppEiYyeGTmoPaw=zXQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Feb 13, 2018 at 11:32 AM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> On Wed, Feb 7, 2018 at 6:13 PM, amul sul <sulamul(at)gmail(dot)com> wrote:
>> On Tue, Feb 6, 2018 at 7:05 PM, amul sul <sulamul(at)gmail(dot)com> wrote:
>>> On Sun, Feb 4, 2018 at 10:47 AM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>>>
>>> Yes, you are correct standby stopped with a following error:
>>>
>>> FATAL: inconsistent page found, rel 1663/13260/16390, forknum 0, blkno 0
>>> CONTEXT: WAL redo at 0/3002510 for Heap/DELETE: off 6 KEYS_UPDATED
>>> LOG: startup process (PID 22791) exited with exit code 1
>>> LOG: terminating any other active server processes
>>> LOG: database system is shut down
>>>
>>> I have tested warm standby replication setup using attached script. Without
>>> wal_consistency_checking setting, it works fine & data from master to standby is
>>> replicated as expected, if this guaranty is enough then I think could skip this
>>> error from wal consistent check for such deleted tuple (I guess option
>>> b that you have suggested), thoughts?
>>
>> I tried to mask ctid.ip_blkid if it is set to InvalidBlockId with
>> following change in heap_mask:
>>
>
> Your change appears fine to me. I think one can set both block number
> and offset as we do for HeapTupleHeaderIsSpeculative, but the way you
> have done it looks good to me. Kindly include it in the next version
> of your patch by adding the missing comment.
>

Thanks for the confirmation, updated patch attached.

Regards,
Amul

Attachment Content-Type Size
0001-Invalidate-ip_blkid-v5.patch application/octet-stream 13.6 KB
0002-isolation-tests-v4.patch application/octet-stream 9.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2018-02-13 07:58:13 Re: ALTER TABLE ADD COLUMN fast default
Previous Message Rafia Sabih 2018-02-13 07:07:58 Re: [HACKERS] Partition-wise aggregation/grouping