Re: system views for walsender activity

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Robert Haas <robertmhaas(at)gmail(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 11:23:08
Message-ID: 1294744988.12610.5902.camel@ebony
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 2011-01-11 at 11:28 +0100, Magnus Hagander wrote:
> >>> >>
> >>> >> (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?

No

You can be "idle" yet in STREAMING mode. What mode we are in has nothing
to do with idle/active. Either STARTING/STARTUP/NULL but not IDLE.

If you want that as well, then we need a second column, but personally
it's too much information and its too hard to say what it actually
means. For example, with sync rep, the WALSender might be idle, yet
there might yet be backends waiting for a reply.

--
Simon Riggs http://www.2ndQuadrant.com/books/
PostgreSQL Development, 24x7 Support, Training and Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2011-01-11 11:31:44 Re: LOCK for non-tables
Previous Message Robert Haas 2011-01-11 11:22:03 Re: Error code for "terminating connection due to conflict with recovery"