From: | Selena Deckelmann <selena(at)chesnok(dot)com> |
---|---|
To: | Magnus Hagander <magnus(at)hagander(dot)net> |
Cc: | Jaime Casanova <jaime(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: streaming header too small |
Date: | 2013-02-20 00:11:23 |
Message-ID: | CAN1EF+wsF3TRFjji0QmTYZe7g3FRCn47Ux2KcLyFMafe+5S0tg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Mon, Jan 9, 2012 at 9:11 AM, Magnus Hagander <magnus(at)hagander(dot)net> wrote:
> On Mon, Jan 9, 2012 at 12:00, Magnus Hagander <magnus(at)hagander(dot)net> wrote:
> > On Mon, Jan 9, 2012 at 11:09, Magnus Hagander <magnus(at)hagander(dot)net>
> wrote:
> >> On Mon, Jan 9, 2012 at 07:34, Jaime Casanova <jaime(at)2ndquadrant(dot)com>
> wrote:
> >>> Hi,
> >>>
> >>> I was trying pg_basebackup on head, i used this command:
> >>> """
> >>> postgres(at)jaime:/usr/local/pgsql/9.2$ bin/pg_basebackup -D $PWD/data2
> >>> -x stream -P -p 54392
> >>> """
> >>>
> >>> i got this error
> >>> """
> >>> 19093/19093 kB (100%), 1/1 tablespace
> >>> pg_basebackup: streaming header too small: 17
> >>> pg_basebackup: child process exited with error 1
> >>> """
> >>>
> >>> now, this streaming header size is defined in
> >>> src/bin/pg_basebackup/receivelog.c as "#define STREAMING_HEADER_SIZE
> >>> (1+8+8+8)", so WTF is this?
> >>> what are these numbers? shouldn't be at least a comment explaining
> >>> those? more important it's seems obvious something broke that, unless
> >>
> >> Those numbers are the size of WalDataMessageHeader - a struct which is
> >> not available in the frontend, or at least wasn't at the time.
> >>
> >>> i misunderstood something which is completely possible, and that the
> >>> way is do it it will broke again in the future if the header change
> >>
> >> Without looking at the details, I'm pretty sure it's the keepalive
> >> message patch (64233902d22ba42846397cb7551894217522fad4).That one does
> >> introduce a new message that's exactly that size.
> >>
> >> pg_basebackup assumes the only kind of messages that can arrive are
> >> the data messages, and this is no longer true. But if you check the
> >> code for pg_basebackup, you'll see it checks the size of the message
> >> *before* it checks the type of the message, which is why you get a
> >> misleading error.
> >>
> >> I'll dig into the details later - but you could try backing out that
> >> patch to confirm if that's the problem.
> >
> > Confirmed that is it, and attached are two patches to fix it. The
> > first one I intend to backport to 9.1, since it just fixes the error
> > message. The other one is for 9.2. I'll also look at a better way to
> > get that structure size. comments?
>
> Patch applied.
>
> Realized there is no need to backpatch, because this code didn't even
> exist in 9.1. The streaming mode of pg_basebackup (which is the only
> affected one) didn't exist then...
>
So, I just ran into a similar issue backing up a 9.2.1 server using
pg_basebackup version 9.2.3:
pg_basebackup: starting background WAL receiver
pg_basebackup: streaming header too small: 25
I've had it happen two times in a row. I'm going to try again...
But -- what would be helpful here? I can recompile pg_basebackup with more
debugging...
-selena
From | Date | Subject | |
---|---|---|---|
Next Message | Noah Misch | 2013-02-20 02:58:19 | Re: [PATCH 0/3] Work around icc miscompilation |
Previous Message | Josh Berkus | 2013-02-20 00:07:08 | Re: Materialized views WIP patch |