Implementing pg_receivewal --no-sync

Started by Michael Paquierover 8 years ago8 messageshackers
Jump to latest
#1Michael Paquier
michael@paquier.xyz

Hi all,

After thinking a bit on the subject, I have decided to submit a patch
to do $subject. This makes pg_receivewal more consistent with
pg_basebackup. This option is mainly useful for testing, something
that becomes way more doable since support for --endpos has been
added.

Unsurprisingly, --synchronous and --no-sync are incompatible options.
Thanks,
--
Michael

Attachments:

pg_receivewal_nosync.patchapplication/octet-stream; name=pg_receivewal_nosync.patchDownload+42-3
#2Kuntal Ghosh
kuntalghosh.2007@gmail.com
In reply to: Michael Paquier (#1)
Re: Implementing pg_receivewal --no-sync

On Wed, Oct 25, 2017 at 6:07 AM, Michael Paquier
<michael.paquier@gmail.com> wrote:

Hi all,

After thinking a bit on the subject, I have decided to submit a patch
to do $subject. This makes pg_receivewal more consistent with
pg_basebackup. This option is mainly useful for testing, something
that becomes way more doable since support for --endpos has been
added.

Unsurprisingly, --synchronous and --no-sync are incompatible options.

+       <para>
+        By default, <command>pg_receivewal</command> flushes a WAL segment's
+        contents each time a feedback message is sent to the server depending
+        on the interval of time defined by
+        <literal>--status-interval</literal>.
IMHO, it's okay to remove the part 'depending on
the.....<literal>--status-interval</literal>'.
+        This option causes
+        <command>pg_receivewal</command> to not issue such flushes waiting,
Did you mean 'to not issue such flush waitings'?
+ [ 'pg_receivewal', '-D', $stream_dir, '--synchronous', '--no-sync' ],
+ 'failure if --synchronous specified without --no-sync');
s/without/with

--
Thanks & Regards,
Kuntal Ghosh
EnterpriseDB: http://www.enterprisedb.com

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Michael Paquier
michael@paquier.xyz
In reply to: Kuntal Ghosh (#2)
Re: Implementing pg_receivewal --no-sync

On Tue, Oct 24, 2017 at 11:05 PM, Kuntal Ghosh
<kuntalghosh.2007@gmail.com> wrote:

+       <para>
+        By default, <command>pg_receivewal</command> flushes a WAL segment's
+        contents each time a feedback message is sent to the server depending
+        on the interval of time defined by
+        <literal>--status-interval</literal>.
IMHO, it's okay to remove the part 'depending on
the.....<literal>--status-interval</literal>'.

This sentence is actually wrong, a feedback message is never sent with
the feedback message. You need to use either --synchronous or --slot
for that, and the docs are already clear on the matter.

+        This option causes
+        <command>pg_receivewal</command> to not issue such flushes waiting,
Did you mean 'to not issue such flush waitings'?

By reading again the patch, "waiting" should not be here. I have
reworded the documentation completely anyway. Hopefully it is more
simple now.

+ [ 'pg_receivewal', '-D', $stream_dir, '--synchronous', '--no-sync' ],
+ 'failure if --synchronous specified without --no-sync');
s/without/with

Right.
--
Michael

Attachments:

pg_receivewal_nosync_v2.patchapplication/octet-stream; name=pg_receivewal_nosync_v2.patchDownload+38-3
#4Robert Haas
robertmhaas@gmail.com
In reply to: Michael Paquier (#3)
Re: Implementing pg_receivewal --no-sync

On Wed, Oct 25, 2017 at 10:03 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:

This sentence is actually wrong, a feedback message is never sent with
the feedback message.

Eh?

I think this looks basically fine, though I'd omit the short option
for it. There are only so many letters in the alphabet, so let's not
use them up for developer-convenience options.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#5Michael Paquier
michael@paquier.xyz
In reply to: Robert Haas (#4)
Re: Implementing pg_receivewal --no-sync

On Thu, Oct 26, 2017 at 10:46 PM, Robert Haas <robertmhaas@gmail.com> wrote:

On Wed, Oct 25, 2017 at 10:03 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:

This sentence is actually wrong, a feedback message is never sent with
the feedback message.

Eh?

"A feedback message is never sent depending on the status interval".

I think this looks basically fine, though I'd omit the short option
for it. There are only so many letters in the alphabet, so let's not
use them up for developer-convenience options.

No objections to that.
--
Michael

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#6Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#5)
Re: Implementing pg_receivewal --no-sync

On Fri, Oct 27, 2017 at 12:03 AM, Michael Paquier
<michael.paquier@gmail.com> wrote:

On Thu, Oct 26, 2017 at 10:46 PM, Robert Haas <robertmhaas@gmail.com> wrote:

On Wed, Oct 25, 2017 at 10:03 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:

This sentence is actually wrong, a feedback message is never sent with
the feedback message.

Eh?

"A feedback message is never sent depending on the status interval".

I think this looks basically fine, though I'd omit the short option
for it. There are only so many letters in the alphabet, so let's not
use them up for developer-convenience options.

No objections to that.

Okay. Here is an updated patch incorporating those comments.
--
Michael

Attachments:

pg_receivewal_nosync_v3.patchapplication/octet-stream; name=pg_receivewal_nosync_v3.patchDownload+36-2
#7Robert Haas
robertmhaas@gmail.com
In reply to: Michael Paquier (#6)
Re: Implementing pg_receivewal --no-sync

On Sun, Oct 29, 2017 at 3:42 AM, Michael Paquier
<michael.paquier@gmail.com> wrote:

Okay. Here is an updated patch incorporating those comments.

Committed with a little wordsmithing on the documentation.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#8Michael Paquier
michael@paquier.xyz
In reply to: Robert Haas (#7)
Re: Implementing pg_receivewal --no-sync

On Sun, Oct 29, 2017 at 12:31 AM, Robert Haas <robertmhaas@gmail.com> wrote:

On Sun, Oct 29, 2017 at 3:42 AM, Michael Paquier
<michael.paquier@gmail.com> wrote:

Okay. Here is an updated patch incorporating those comments.

Committed with a little wordsmithing on the documentation.

Thanks all.
--
Michael

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers