Re: [HACKERS] Support for pg_receivexlog --format=plain|tar
От | Michael Paquier |
---|---|
Тема | Re: [HACKERS] Support for pg_receivexlog --format=plain|tar |
Дата | |
Msg-id | CAB7nPqQU0=iEOeB+W7PR52Jzu7AwgR2GVCEoP_RkqAQERafhjg@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: [HACKERS] Support for pg_receivexlog --format=plain|tar (Magnus Hagander <magnus@hagander.net>) |
Ответы |
Re: [HACKERS] Support for pg_receivexlog --format=plain|tar
|
Список | pgsql-hackers |
On Fri, Jan 6, 2017 at 11:07 PM, Magnus Hagander <magnus@hagander.net> wrote: > A few further notes: Thanks for the review. > You are using the filemode to gzopen and the mode_compression variable to > set the compression level. The pre-existing code in pg_basebackup uses > gzsetparams(). Is there a particular reason you didn't do it the same way? > > Small comment: > - if (pad_to_size) > + if (pad_to_size && dir_data->compression == 0) > { > /* Always pre-pad on regular files */ > > > That "always" is not true anymore. Commit-time cleanup can be done of that. > > The rest of this looks good to me, but please comment on the gzopen part > before we proceed to commit :) Yes using gzsetparams() looks cleaner. I actually thought about using the same logic as pg_dump. Attached is an updated patch. There is something I forgot. With this patch, FindStreamingStart()@pg_receivexlog.c is actually broken. In short it forgets to consider files that have been compressed at the last run of pg_receivexlog and will try to stream changes from the beginning. I can see that gzip -l provides this information... But I have yet to find something in zlib that allows a cheap lookup as startup of streaming should be fast. Looking at how gzip -l does it may be faster than looking at the docs. -- Michael -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Вложения
В списке pgsql-hackers по дате отправления: