Re: system views for walsender activity

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: system views for walsender activity
Date: 2011-01-11 10:28:50
Message-ID: AANLkTi=hb+WKBiytnNxv_EqmMUGDdCEAoJ7nk4YXjj6U@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jan 11, 2011 at 02:24, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Mon, Jan 10, 2011 at 10:41 AM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
>>> >>> I think we need a status enum. ('BACKUP', 'CATCHUP', 'STREAM') for the 3
>>> >>> phases of replication.
>>> >>
>>> >> That seems reasonable. But if we keep BACKUP in there, should we
>>> >> really have it called pg_stat_replication? (yeah, I know, I'm not
>>> >> giving up :P)
>>> >>
>>> >> (You'd need a 4th mode for WAITING or so, to indicate it's waiting for
>>> >> a command)
>>> >
>>> > That's something different.
>>> >
>>> > The 3 phases are more concrete.
>>> >
>>> > BACKUP -->  CATCHUP<--->  STREAM
>>> >
>>> > When you connect you either do BACKUP or CATCHUP. Once in CATCHUP mode
>>> > you never issue a BACKUP. Once we have caught up we move to STREAM. That
>>> > has nothing to do with idle/active.
>>>
>>> So how does a walsender that's waiting for a command from the client
>>> show up? Surely it's not in "catchup" mode yet?
>>
>> There is a trivial state between connect and first command. If you think
>> that is worth publishing, feel free. STARTING?
>
> I think it's worth publishing.  STARTING would be OK, or maybe STARTUP
> to parallel the other two -UP states.

Here's a patch for this. I chose IDLE, because that's what we call
other backends that are waiting for commands...

Does this seem correct?

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

Attachment Content-Type Size
walsender_state.patch text/x-patch 8.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-01-11 11:14:37 Re: LOCK for non-tables
Previous Message Koichi Suzuki 2011-01-11 10:00:46 Re: LOCK for non-tables