Basebackups reported as idle

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Basebackups reported as idle
Date: 2017-12-19 09:56:33
Message-ID: CABUevEwX4g8y=gmgfPzxFKS7gqjSYNR949Xc96OQm=YXJmh_Og@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

AFAICT, base backups running on the replication protocol are always
reported as "idle" in pg_stat_activity. This seems to have been an
oversight in the "include walsender backends in pg_stat_activity" in 10,
which does include it for walsenders in general, just not for the ones
sending base backups. (and was then improved on later with the "include all
non-standard backends" patch).

Unlike the regular walsender it also has to set it back to IDLE, since you
can actually finish a base backup without disconnecting.

PFA a patch that fixes this. I think this is bugfix-for-backpatch, I don't
think it has a large risk of breaking things. Thoughts?

Also, in setting this, there is no real way to differentiate between a
regular walsender and a basebackup walsender, other than looking at the
wait events. They're both listed as walsenders. Should there be? (That
might not be as easily backpatchable, so keeping that as a separate one)

--
Magnus Hagander
Me: https://www.hagander.net/ <http://www.hagander.net/>
Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/>

Attachment Content-Type Size
base_backup_running.patch text/x-patch 623 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Oleksandr Shulgin 2017-12-19 10:00:01 Re: Estimate maintenance_work_mem for CREATE INDEX
Previous Message Oleksandr Shulgin 2017-12-19 09:47:12 Estimate maintenance_work_mem for CREATE INDEX