Re: Basebackups reported as idle

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: David Steele <david(at)pgmasters(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Basebackups reported as idle
Date: 2017-12-20 11:50:52
Message-ID: CAB7nPqQEX1t3UnGOqkztqUNaNr-FwfFWNHW=ed945_sdjDBa8Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 20, 2017 at 6:07 PM, Magnus Hagander <magnus(at)hagander(dot)net> wrote:
> What about the attached?

The new positions look good to me, still aren't you missing the case
where a SQL command is found and exec_replication_command returns
false? This should be switched to idle as well.

+ /* Report to pgstat that this process is running */
+ pgstat_report_activity(STATE_RUNNING, NULL);
Bonus points if cmd_string is used instead of string? This way, you
can know what is the replication command running ;)

> Also, I noticed that the docs for exec_replication_command() says " *
> Returns true if the cmd_string was recognized as WalSender command, false
> * if not.". But it doesn't actually do that, it ereport(ERROR):s if it's
> not. There is one "return false", but it's after an ERROR.

WAL senders can connect to a specific database, and if a WAL sender
command is not used in this case this goes through the normal query
processing.

> It's still quite a bit weird that we call this process "walsender" when it
> does other things as well. But the ship sailed on that many years ago,
> changing that completely now would not be worth the breakage.

ps shows walsender as well, that's a reason why "walsender" has been decided.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2017-12-20 11:51:47 Re: [HACKERS] Partition-wise join for join between (declaratively) partitioned tables
Previous Message Marina Polyakova 2017-12-20 11:25:01 Re: WIP Patch: Pgbench Serialization and deadlock errors