Re: BUGFIX: standby disconnect can corrupt serialized reorder buffers

From: Petr Jelinek <petr(dot)jelinek(at)2ndquadrant(dot)com>
To: Craig Ringer <craig(at)2ndquadrant(dot)com>, David Steele <david(at)pgmasters(dot)net>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: BUGFIX: standby disconnect can corrupt serialized reorder buffers
Date: 2018-03-06 13:12:04
Message-ID: 65453ced-5ddd-b1f4-9ffa-c474c0449afd@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 06/03/18 09:37, Craig Ringer wrote:
>
> Revised patch attached.
>
> I have _not_ rewritten to use sscanf yet. I'll do that next, so you
> can choose the fewer-changes patch for backpatching if desired. 
>
>
> ... and I'm not convinced it's really an improvement.
>
>         uint32 xid, lsn_high, lsn_low;
>
>         if (sscanf(spill_de->d_name, REORDERBUFFER_TXN_FILENAME_FORMAT,
>                xid, lsn_high, lsn_low) == 3)
>         {
>
> since we don't use the scanned-out information.
>
> I guess my answer to causing problems if you create a file named
> "xidfoo" in a slot directory is yeah, don't do that.
>
> Note that this patch changes the PANIC to ERROR. This will promote to
> FATAL during the startup process, which I think is fine. Objections?
>
You mean because PG_exception_stack is not initialized for startup
process? That deserves comment I think.

Other than that if I am very nitpicky, I'd call the new function
ReorderBufferCleanupSerializedTXNs.

--
Petr Jelinek http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Sergei Kornilov 2018-03-06 13:12:31 Re: using index or check in ALTER TABLE SET NOT NULL
Previous Message Darafei Komяpa Praliaskouski 2018-03-06 13:07:45 Re: All Taxi Services need Index Clustered Heap Append