PATCH: Add 'pid' column to pg_replication_slots - Mailing list pgsql-hackers

From Craig Ringer
Subject PATCH: Add 'pid' column to pg_replication_slots
Date
Msg-id CAMsr+YFKgZca5_7_ouaMWxA5PneJC9LNViPzpDHusaPhU9pA7g@mail.gmail.com
Whole thread Raw
Responses Re: PATCH: Add 'pid' column to pg_replication_slots
Re: PATCH: Add 'pid' column to pg_replication_slots
List pgsql-hackers
The attached patch adds a 'pid' column to pg_replication_slots, so it's possible to associate an active slot with the pg_stat_replication entry that describes the walsender using the slot.

If a user backend (or bgworker) is using the slot over the SQL interface, the 'pid' column will correspond to the pg_stat_activity entry for that backend instead. After all, both it and pg_stat_replication are views over pg_stat_get_activity() anyway.

Detailed rationale in patch.

Please consider this for 9.5. It's a pretty light patch, and it'd be good to have it in place to ease monitoring of slot-based replication.

Note that logical replication walsenders are broken in HEAD so testing this using the test_decoding module and pg_recvlogical will crash the walsender. This is a pre-existing bug; see http://www.postgresql.org/message-id/CAB7nPqQSdx7coHk0D6G=mkJntGYjXPDw+PWisKKSsAeZFTskvg@mail.gmail.com and  http://www.postgresql.org/message-id/CAMsr+YEh50r70+hP+w=rCzEuenoQRCNMDA7PmRSK06Ro9r=9sA@mail.gmail.com)

--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services
Attachment

pgsql-hackers by date:

Previous
From: Sawada Masahiko
Date:
Subject: Re: Proposal : REINDEX xxx VERBOSE
Next
From: Craig Ringer
Date:
Subject: Row security violation error is misleading