Re: BUGFIX: standby disconnect can corrupt serialized reorder buffers

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Craig Ringer <craig(at)2ndquadrant(dot)com>
Cc: 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-01-05 19:28:29
Message-ID: 20180105192829.wiwqjv2nmrryoco3@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I think this should use ReadDirExtended with an elevel less than ERROR,
and do nothing.

Why have strcmp(.) and strcmp(..)? These are going to be skipped by the
comparison to "xid" prefix anyway. Looks like strcmp processing power waste.

Please don't use bare sprintf() -- upgrade to snprintf.

With this coding, if I put a root-owned file "xidfoo" in a replslot
directory, it will PANIC the server. Is that okay? Why not read the
file name with sscanf(), since we know the precise format it has? Then
we don't need to bother with random crap left around. Maybe a good time
to put the "xid-%u-lsn-%X-%X.snap" literal in a macro? I guess the
rationale is that if you let random people put "xidfoo" files in your
replication slot dirs, you deserve a PANIC anyway, but I'm not sure.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2018-01-05 19:31:36 Re: [HACKERS] Pluggable storage
Previous Message Bruce Momjian 2018-01-05 19:24:54 Re: pgsql: pg_upgrade: simplify code layout in a few places