Обсуждение: Ticket 128: Hot Standby and Streaming Replication

Поиск
Список
Период
Сортировка

Ticket 128: Hot Standby and Streaming Replication

От
Guillaume Lelarge
Дата:
Hi,

I tried both of them yesterday night and tonight to have a look at what
could be done on pgAdmin for these features. AFAICT, not a lot.

Actually, I have a really small patch that adds some informations in the
server panel. This information is quite simple. It tells the user if the
selected server is in recovery mode and the last xlog replay location.
I'm not sure we can do more. Streaming Replication can be detected if
max_wal_senders is greater than zero, but I'm not sure we really need to
add this kind of information on the server panel.

If we want to got a bit further, the only idea I had was to allow the
user to see objects' properties but deny to change them. We can also
deny the use of the maintenance window and the restore one. As we don't
already do that when a user doesn't have the priviledge to do so, I
suppose we won't do that. At least for this release. I'm really
interested to implement this in a future release.

Any comments? on the patch and on this "idea".


--
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com

Вложения

Re: Ticket 128: Hot Standby and Streaming Replication

От
Magnus Hagander
Дата:
On Wed, Feb 3, 2010 at 00:11, Guillaume Lelarge <guillaume@lelarge.info> wrote:
> Hi,
>
> I tried both of them yesterday night and tonight to have a look at what
> could be done on pgAdmin for these features. AFAICT, not a lot.
>
> Actually, I have a really small patch that adds some informations in the
> server panel. This information is quite simple. It tells the user if the
> selected server is in recovery mode and the last xlog replay location.
> I'm not sure we can do more. Streaming Replication can be detected if
> max_wal_senders is greater than zero, but I'm not sure we really need to
> add this kind of information on the server panel.

It would be interesting to know *which* slaves are connected to a master, no?


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

Re: Ticket 128: Hot Standby and Streaming Replication

От
Guillaume Lelarge
Дата:
Le 03/02/2010 21:04, Magnus Hagander a écrit :
> On Wed, Feb 3, 2010 at 00:11, Guillaume Lelarge <guillaume@lelarge.info> wrote:
>> Hi,
>>
>> I tried both of them yesterday night and tonight to have a look at what
>> could be done on pgAdmin for these features. AFAICT, not a lot.
>>
>> Actually, I have a really small patch that adds some informations in the
>> server panel. This information is quite simple. It tells the user if the
>> selected server is in recovery mode and the last xlog replay location.
>> I'm not sure we can do more. Streaming Replication can be detected if
>> max_wal_senders is greater than zero, but I'm not sure we really need to
>> add this kind of information on the server panel.
>
> It would be interesting to know *which* slaves are connected to a master, no?
>

AFAICT, there is no way to know that automatically in Hot Standby and in
Streaming Replication. If you know some way to get that, I'm really
interested. At first, I had hoped I could at least get the conninfo
string on the slave, but recovery parameters are not available via show.


--
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com

Re: Ticket 128: Hot Standby and Streaming Replication

От
Magnus Hagander
Дата:
On Wed, Feb 3, 2010 at 21:22, Guillaume Lelarge <guillaume@lelarge.info> wrote:
> Le 03/02/2010 21:04, Magnus Hagander a écrit :
>> On Wed, Feb 3, 2010 at 00:11, Guillaume Lelarge <guillaume@lelarge.info> wrote:
>>> Hi,
>>>
>>> I tried both of them yesterday night and tonight to have a look at what
>>> could be done on pgAdmin for these features. AFAICT, not a lot.
>>>
>>> Actually, I have a really small patch that adds some informations in the
>>> server panel. This information is quite simple. It tells the user if the
>>> selected server is in recovery mode and the last xlog replay location.
>>> I'm not sure we can do more. Streaming Replication can be detected if
>>> max_wal_senders is greater than zero, but I'm not sure we really need to
>>> add this kind of information on the server panel.
>>
>> It would be interesting to know *which* slaves are connected to a master, no?
>>
>
> AFAICT, there is no way to know that automatically in Hot Standby and in
> Streaming Replication. If you know some way to get that, I'm really
> interested. At first, I had hoped I could at least get the conninfo
> string on the slave, but recovery parameters are not available via show.

Hmm. In that case, a way to do it should perhaps be created :-)

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

Re: Ticket 128: Hot Standby and Streaming Replication

От
Guillaume Lelarge
Дата:
Le 03/02/2010 21:26, Magnus Hagander a écrit :
> On Wed, Feb 3, 2010 at 21:22, Guillaume Lelarge <guillaume@lelarge.info> wrote:
>> Le 03/02/2010 21:04, Magnus Hagander a écrit :
>>> On Wed, Feb 3, 2010 at 00:11, Guillaume Lelarge <guillaume@lelarge.info> wrote:
>>>> Hi,
>>>>
>>>> I tried both of them yesterday night and tonight to have a look at what
>>>> could be done on pgAdmin for these features. AFAICT, not a lot.
>>>>
>>>> Actually, I have a really small patch that adds some informations in the
>>>> server panel. This information is quite simple. It tells the user if the
>>>> selected server is in recovery mode and the last xlog replay location.
>>>> I'm not sure we can do more. Streaming Replication can be detected if
>>>> max_wal_senders is greater than zero, but I'm not sure we really need to
>>>> add this kind of information on the server panel.
>>>
>>> It would be interesting to know *which* slaves are connected to a master, no?
>>>
>>
>> AFAICT, there is no way to know that automatically in Hot Standby and in
>> Streaming Replication. If you know some way to get that, I'm really
>> interested. At first, I had hoped I could at least get the conninfo
>> string on the slave, but recovery parameters are not available via show.
>
> Hmm. In that case, a way to do it should perhaps be created :-)
>

This means working on patch for the Streaming Replication. Could be
interesting, but not something I can do right now.


--
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com

Re: Ticket 128: Hot Standby and Streaming Replication

От
Guillaume Lelarge
Дата:
Le 03/02/2010 22:00, Guillaume Lelarge a écrit :
> Le 03/02/2010 21:26, Magnus Hagander a écrit :
>> On Wed, Feb 3, 2010 at 21:22, Guillaume Lelarge <guillaume@lelarge.info> wrote:
>>> Le 03/02/2010 21:04, Magnus Hagander a écrit :
>>>> On Wed, Feb 3, 2010 at 00:11, Guillaume Lelarge <guillaume@lelarge.info> wrote:
>>>>> Hi,
>>>>>
>>>>> I tried both of them yesterday night and tonight to have a look at what
>>>>> could be done on pgAdmin for these features. AFAICT, not a lot.
>>>>>
>>>>> Actually, I have a really small patch that adds some informations in the
>>>>> server panel. This information is quite simple. It tells the user if the
>>>>> selected server is in recovery mode and the last xlog replay location.
>>>>> I'm not sure we can do more. Streaming Replication can be detected if
>>>>> max_wal_senders is greater than zero, but I'm not sure we really need to
>>>>> add this kind of information on the server panel.
>>>>
>>>> It would be interesting to know *which* slaves are connected to a master, no?
>>>>
>>>
>>> AFAICT, there is no way to know that automatically in Hot Standby and in
>>> Streaming Replication. If you know some way to get that, I'm really
>>> interested. At first, I had hoped I could at least get the conninfo
>>> string on the slave, but recovery parameters are not available via show.
>>
>> Hmm. In that case, a way to do it should perhaps be created :-)
>>
>
> This means working on patch for the Streaming Replication. Could be
> interesting, but not something I can do right now.
>

This new version of the patch adds support for
pg_last_xlog_receive_location().

During FOSDEM, I discussed with Heikki about some interesting (at least
for us) informations: mainly knowing who the master is and knowing who
the slaves are.

He confirmed me there is actually no way to get that information.
There's also no way to have the contents of recovery.conf available as
all other GUCs. We found that we could at least read the recovery.conf
file in the master with pg_file_read, which will give us the master host
(via the primary_conninfo parameter) for people using the adminpack
module contrib. Is it something interesting enough that I put some time
to code this? or do we stop here, commit what I already have and see
later what's coming next? (the "what's coming next" could be something I
would code for next release)


--
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com

Вложения

Re: Ticket 128: Hot Standby and Streaming Replication

От
Magnus Hagander
Дата:
2010/2/10 Guillaume Lelarge <guillaume@lelarge.info>:
> Le 03/02/2010 22:00, Guillaume Lelarge a écrit :
>> Le 03/02/2010 21:26, Magnus Hagander a écrit :
>>> On Wed, Feb 3, 2010 at 21:22, Guillaume Lelarge <guillaume@lelarge.info> wrote:
>>>> Le 03/02/2010 21:04, Magnus Hagander a écrit :
>>>>> On Wed, Feb 3, 2010 at 00:11, Guillaume Lelarge <guillaume@lelarge.info> wrote:
>>>>>> Hi,
>>>>>>
>>>>>> I tried both of them yesterday night and tonight to have a look at what
>>>>>> could be done on pgAdmin for these features. AFAICT, not a lot.
>>>>>>
>>>>>> Actually, I have a really small patch that adds some informations in the
>>>>>> server panel. This information is quite simple. It tells the user if the
>>>>>> selected server is in recovery mode and the last xlog replay location.
>>>>>> I'm not sure we can do more. Streaming Replication can be detected if
>>>>>> max_wal_senders is greater than zero, but I'm not sure we really need to
>>>>>> add this kind of information on the server panel.
>>>>>
>>>>> It would be interesting to know *which* slaves are connected to a master, no?
>>>>>
>>>>
>>>> AFAICT, there is no way to know that automatically in Hot Standby and in
>>>> Streaming Replication. If you know some way to get that, I'm really
>>>> interested. At first, I had hoped I could at least get the conninfo
>>>> string on the slave, but recovery parameters are not available via show.
>>>
>>> Hmm. In that case, a way to do it should perhaps be created :-)
>>>
>>
>> This means working on patch for the Streaming Replication. Could be
>> interesting, but not something I can do right now.
>>
>
> This new version of the patch adds support for
> pg_last_xlog_receive_location().
>
> During FOSDEM, I discussed with Heikki about some interesting (at least
> for us) informations: mainly knowing who the master is and knowing who
> the slaves are.
>
> He confirmed me there is actually no way to get that information.
> There's also no way to have the contents of recovery.conf available as
> all other GUCs. We found that we could at least read the recovery.conf
> file in the master with pg_file_read, which will give us the master host
> (via the primary_conninfo parameter) for people using the adminpack
> module contrib. Is it something interesting enough that I put some time
> to code this? or do we stop here, commit what I already have and see
> later what's coming next? (the "what's coming next" could be something I
> would code for next release)

Parsing primary_conninfo certainly seems *really* ugly. I think we put
in what you have so far, and then lobby Heikki to get better functions
already in 9.0 :-)

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

Re: Ticket 128: Hot Standby and Streaming Replication

От
Guillaume Lelarge
Дата:
Le 13/02/2010 23:32, Magnus Hagander a écrit :
> 2010/2/10 Guillaume Lelarge <guillaume@lelarge.info>:
>> Le 03/02/2010 22:00, Guillaume Lelarge a écrit :
>>> Le 03/02/2010 21:26, Magnus Hagander a écrit :
>>>> On Wed, Feb 3, 2010 at 21:22, Guillaume Lelarge <guillaume@lelarge.info> wrote:
>>>>> Le 03/02/2010 21:04, Magnus Hagander a écrit :
>>>>>> On Wed, Feb 3, 2010 at 00:11, Guillaume Lelarge <guillaume@lelarge.info> wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> I tried both of them yesterday night and tonight to have a look at what
>>>>>>> could be done on pgAdmin for these features. AFAICT, not a lot.
>>>>>>>
>>>>>>> Actually, I have a really small patch that adds some informations in the
>>>>>>> server panel. This information is quite simple. It tells the user if the
>>>>>>> selected server is in recovery mode and the last xlog replay location.
>>>>>>> I'm not sure we can do more. Streaming Replication can be detected if
>>>>>>> max_wal_senders is greater than zero, but I'm not sure we really need to
>>>>>>> add this kind of information on the server panel.
>>>>>>
>>>>>> It would be interesting to know *which* slaves are connected to a master, no?
>>>>>>
>>>>>
>>>>> AFAICT, there is no way to know that automatically in Hot Standby and in
>>>>> Streaming Replication. If you know some way to get that, I'm really
>>>>> interested. At first, I had hoped I could at least get the conninfo
>>>>> string on the slave, but recovery parameters are not available via show.
>>>>
>>>> Hmm. In that case, a way to do it should perhaps be created :-)
>>>>
>>>
>>> This means working on patch for the Streaming Replication. Could be
>>> interesting, but not something I can do right now.
>>>
>>
>> This new version of the patch adds support for
>> pg_last_xlog_receive_location().
>>
>> During FOSDEM, I discussed with Heikki about some interesting (at least
>> for us) informations: mainly knowing who the master is and knowing who
>> the slaves are.
>>
>> He confirmed me there is actually no way to get that information.
>> There's also no way to have the contents of recovery.conf available as
>> all other GUCs. We found that we could at least read the recovery.conf
>> file in the master with pg_file_read, which will give us the master host
>> (via the primary_conninfo parameter) for people using the adminpack
>> module contrib. Is it something interesting enough that I put some time
>> to code this? or do we stop here, commit what I already have and see
>> later what's coming next? (the "what's coming next" could be something I
>> would code for next release)
>
> Parsing primary_conninfo certainly seems *really* ugly. I think we put
> in what you have so far, and then lobby Heikki to get better functions
> already in 9.0 :-)
>

Commited.


--
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com