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:58:22
Message-ID: 1294747102.12610.6070.camel@ebony
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 2011-01-11 at 12:41 +0100, Magnus Hagander wrote:

> Just to be clear, you're objecting to the *name* of the state, right,
> not how/where it's set?

Yes

> In particular, how the catchup/streaming
> things are set?

You've set it in the right places.

I would personally constrain the state transitions, so that we can't
ever make illegal changes, such as CATCHUP -> BACKUP.

I would also check the state locally before grabbing the spinlock, as is
typical in other xlog code. Continually resetting shared state to
exactly what it is already seems strange, to me. If we make the rule
that the state can only be changed by the WALSender itself, it won't
need to grab spinlock. If you don't like that, a local variable works.

Also, mixing upper camel case and uppercase for the STATe NamES looKS
weIRD. Uppercase makes them look more clearly like enum/states as used
elsewhere in similar code.

--
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 Anssi Kääriäinen 2011-01-11 12:00:49 Re: SSI patch version 8
Previous Message Florian Pflug 2011-01-11 11:49:29 Re: Compatibility GUC for serializable