Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux-HA: Dev

Patch: pgsql streaming replication

 

 

Linux-HA dev RSS feed   Index | Next | Previous | View Threaded


sergeyfd at gmail

Mar 18, 2012, 9:02 AM

Post #1 of 11 (981 views)
Permalink
Patch: pgsql streaming replication

Hello -

Attached is a patch for pgsql that adds support streaming replication
developed by Mr. Takatoshi MATSUO. It's a huge overhaul for the current
version of the script though it's backward compatible and doesn't change
existing functionality. However I'd like to ask everybody who currently
uses pgsql RA to give this version of RA a thorough test before putting it
into production.

This version support synchronous and asynchronous version of streaming
replication but requires PostgreSQL 9.1 at least. Due some limits on how
replication is implemented in PostgreSQL currently there is no way to
demote current master into a slave to the new master so it always stops
PostgreSQL on demote and it's administrator responsibility to resync
stopped node the new master. Same is true for the failed master, before
putting it back administrator has to sync it to the new master.


--
Serge Dubrouski.
Attachments: pgsql.patch (46.7 KB)


dejan at suse

Mar 19, 2012, 3:09 AM

Post #2 of 11 (968 views)
Permalink
Re: Patch: pgsql streaming replication [In reply to]

Hi Serge,

On Sun, Mar 18, 2012 at 10:02:39AM -0600, Serge Dubrouski wrote:
> Hello -
>
> Attached is a patch for pgsql that adds support streaming replication
> developed by Mr. Takatoshi MATSUO. It's a huge overhaul for the current
> version of the script though it's backward compatible and doesn't change
> existing functionality. However I'd like to ask everybody who currently
> uses pgsql RA to give this version of RA a thorough test before putting it
> into production.
>
> This version support synchronous and asynchronous version of streaming
> replication but requires PostgreSQL 9.1 at least. Due some limits on how
> replication is implemented in PostgreSQL currently there is no way to
> demote current master into a slave to the new master so it always stops
> PostgreSQL on demote and it's administrator responsibility to resync
> stopped node the new master. Same is true for the failed master, before
> putting it back administrator has to sync it to the new master.
>
>
> --
> Serge Dubrouski.

> diff --git a/heartbeat/pgsql b/heartbeat/pgsql
> index 8b6ea10..b75e525 100755
> --- a/heartbeat/pgsql
> +++ b/heartbeat/pgsql
> @@ -1,12 +1,13 @@
> -#!/bin/sh
> +#!/bin/bash

Our policy is not to change shell. Is that absolutely necessary?

Cheers,

Dejan
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


lmb at suse

Mar 19, 2012, 1:24 PM

Post #3 of 11 (959 views)
Permalink
Re: Patch: pgsql streaming replication [In reply to]

On 2012-03-19T11:09:16, Dejan Muhamedagic <dejan [at] suse> wrote:

> > --- a/heartbeat/pgsql
> > +++ b/heartbeat/pgsql
> > @@ -1,12 +1,13 @@
> > -#!/bin/sh
> > +#!/bin/bash
> Our policy is not to change shell. Is that absolutely necessary?

He sends in many patches. bash is a <1MB install. I can't believe that
in 2012 we're still having this discussion ;-)



Regards,
Lars

--
Architect Storage/HA
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 21284 (AG Nürnberg)
"Experience is the name everyone gives to their mistakes." -- Oscar Wilde

_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


msoffen at iso-ne

Mar 19, 2012, 1:29 PM

Post #4 of 11 (965 views)
Permalink
Re: Patch: pgsql streaming replication [In reply to]

I believe that the reason for not using #bash is that it is it NOT part of the default install on non Linux systems.


Matthew Soffen
Principal Software Testing Coordinator
ISO New England - http://www.iso-ne.com/



-----Original Message-----
From: linux-ha-dev-bounces [at] lists [mailto:linux-ha-dev-bounces [at] lists] On Behalf Of Lars Marowsky-Bree
Sent: Monday, March 19, 2012 4:24 PM
To: High-Availability Linux Development List
Subject: Re: [Linux-ha-dev] Patch: pgsql streaming replication

On 2012-03-19T11:09:16, Dejan Muhamedagic <dejan [at] suse> wrote:

> > --- a/heartbeat/pgsql
> > +++ b/heartbeat/pgsql
> > @@ -1,12 +1,13 @@
> > -#!/bin/sh
> > +#!/bin/bash
> Our policy is not to change shell. Is that absolutely necessary?

He sends in many patches. bash is a <1MB install. I can't believe that in 2012 we're still having this discussion ;-)



Regards,
Lars

--
Architect Storage/HA
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 21284 (AG Nürnberg) "Experience is the name everyone gives to their mistakes." -- Oscar Wilde

_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


sergeyfd at gmail

Mar 19, 2012, 2:13 PM

Post #5 of 11 (959 views)
Permalink
Re: Patch: pgsql streaming replication [In reply to]

Sorry, we'll rework the patch.
On Mar 19, 2012 2:39 PM, "Soffen, Matthew" <msoffen [at] iso-ne> wrote:

> I believe that the reason for not using #bash is that it is it NOT part of
> the default install on non Linux systems.
>
>
> Matthew Soffen
> Principal Software Testing Coordinator
> ISO New England - http://www.iso-ne.com/
>
>
>
> -----Original Message-----
> From: linux-ha-dev-bounces [at] lists [mailto:
> linux-ha-dev-bounces [at] lists] On Behalf Of Lars Marowsky-Bree
> Sent: Monday, March 19, 2012 4:24 PM
> To: High-Availability Linux Development List
> Subject: Re: [Linux-ha-dev] Patch: pgsql streaming replication
>
> On 2012-03-19T11:09:16, Dejan Muhamedagic <dejan [at] suse> wrote:
>
> > > --- a/heartbeat/pgsql
> > > +++ b/heartbeat/pgsql
> > > @@ -1,12 +1,13 @@
> > > -#!/bin/sh
> > > +#!/bin/bash
> > Our policy is not to change shell. Is that absolutely necessary?
>
> He sends in many patches. bash is a <1MB install. I can't believe that in
> 2012 we're still having this discussion ;-)
>
>
>
> Regards,
> Lars
>
> --
> Architect Storage/HA
> SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix
> Imendörffer, HRB 21284 (AG Nürnberg) "Experience is the name everyone gives
> to their mistakes." -- Oscar Wilde
>
> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev [at] lists
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev [at] lists
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
>


matsuo.tak at gmail

Mar 19, 2012, 11:53 PM

Post #6 of 11 (963 views)
Permalink
Re: Patch: pgsql streaming replication [In reply to]

There is a report that it dosen't work on debian's dash,
because it uses "echo -e" to treat line break.

We'll use "printf" instead of "echo -e ".

2012/3/20 Serge Dubrouski <sergeyfd [at] gmail>:
> Sorry, we'll rework the patch.
>
> On Mar 19, 2012 2:39 PM, "Soffen, Matthew" <msoffen [at] iso-ne> wrote:
>>
>> I believe that the reason for not using #bash is that it is it NOT part of
>> the default install on non Linux systems.
>>
>>
>> Matthew Soffen
>> Principal Software Testing Coordinator
>> ISO New England - http://www.iso-ne.com/
>>
>>
>>
>> -----Original Message-----
>> From: linux-ha-dev-bounces [at] lists
>> [mailto:linux-ha-dev-bounces [at] lists] On Behalf Of Lars
>> Marowsky-Bree
>> Sent: Monday, March 19, 2012 4:24 PM
>> To: High-Availability Linux Development List
>> Subject: Re: [Linux-ha-dev] Patch: pgsql streaming replication
>>
>> On 2012-03-19T11:09:16, Dejan Muhamedagic <dejan [at] suse> wrote:
>>
>> > > --- a/heartbeat/pgsql
>> > > +++ b/heartbeat/pgsql
>> > > @@ -1,12 +1,13 @@
>> > > -#!/bin/sh
>> > > +#!/bin/bash
>> > Our policy is not to change shell. Is that absolutely necessary?
>>
>> He sends in many patches. bash is a <1MB install. I can't believe that in
>> 2012 we're still having this discussion ;-)
>>
>>
>>
>> Regards,
>>    Lars
>>
>> --
>> Architect Storage/HA
>> SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix
>> Imendörffer, HRB 21284 (AG Nürnberg) "Experience is the name everyone gives
>> to their mistakes." -- Oscar Wilde
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


lmb at suse

Mar 20, 2012, 2:40 AM

Post #7 of 11 (960 views)
Permalink
Re: Patch: pgsql streaming replication [In reply to]

On 2012-03-19T16:29:23, "Soffen, Matthew" <msoffen [at] iso-ne> wrote:

> I believe that the reason for not using #bash is that it is it NOT part of the default install on non Linux systems.

That is what package dependencies are for.

--
Architect Storage/HA
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 21284 (AG Nürnberg)
"Experience is the name everyone gives to their mistakes." -- Oscar Wilde

_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


alanr at unix

Mar 26, 2012, 1:22 PM

Post #8 of 11 (940 views)
Permalink
Re: Patch: pgsql streaming replication [In reply to]

On 03/20/2012 03:40 AM, Lars Marowsky-Bree wrote:
> On 2012-03-19T16:29:23, "Soffen, Matthew"<msoffen [at] iso-ne> wrote:
>
>> I believe that the reason for not using #bash is that it is it NOT part of the default install on non Linux systems.
> That is what package dependencies are for.
Matt's point is simple: Avoiding dependencies is far better than
declaring them.

There is nothing in bash which cannot be easily done in the standard
POSIX shell.

We have avoided these things in most of our RAs - and there is no reason
to change that.

--
Alan Robertson<alanr [at] unix> - @OSSAlanR

"Openness is the foundation and preservative of friendship... Let me claim from you at all times your undisguised opinions." - William Wilberforce
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


matsuo.tak at gmail

Mar 26, 2012, 10:15 PM

Post #9 of 11 (955 views)
Permalink
Re: Patch: pgsql streaming replication [In reply to]

Hello

I fixed it.
It works well with dash.

If you need a sample setting, please see
https://github.com/t-matsuo/resource-agents/wiki/Resource-Agent-for-PostgreSQL-9.1-streaming-replication
(See "sample setting of crm" section)

Regards,
Takatoshi MATSUO

2012/3/27 Alan Robertson <alanr [at] unix>:
> On 03/20/2012 03:40 AM, Lars Marowsky-Bree wrote:
>> On 2012-03-19T16:29:23, "Soffen, Matthew"<msoffen [at] iso-ne>  wrote:
>>
>>> I believe that the reason for not using #bash is that it is it NOT part of the default install on non Linux systems.
>> That is what package dependencies are for.
> Matt's point is simple:  Avoiding dependencies is far better than
> declaring them.
>
> There is nothing in bash which cannot be easily done in the standard
> POSIX shell.
>
> We have avoided these things in most of our RAs - and there is no reason
> to change that.
>
> --
>     Alan Robertson<alanr [at] unix>  - @OSSAlanR
>
> "Openness is the foundation and preservative of friendship...  Let me claim from you at all times your undisguised opinions." - William Wilberforce
> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev [at] lists
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
Attachments: pgsql-replication.patch (46.5 KB)


sergeyfd at gmail

Mar 27, 2012, 2:37 PM

Post #10 of 11 (936 views)
Permalink
Re: Patch: pgsql streaming replication [In reply to]

Actually it doesn't matter what bash can or cannot do. The main point is
that we can't change shell for RA that's been around for 6 years for the
reasons of backward compatibility. It was completely my mistake that I
didn't notice it.

Attached is the fixed patch.

Takatoshi, I also replace $HOSTNAME with $NODENAME to avoid confusion with
embedded bash variable and make checkbashism script happy.

On Mon, Mar 26, 2012 at 2:22 PM, Alan Robertson <alanr [at] unix> wrote:

> On 03/20/2012 03:40 AM, Lars Marowsky-Bree wrote:
> > On 2012-03-19T16:29:23, "Soffen, Matthew"<msoffen [at] iso-ne> wrote:
> >
> >> I believe that the reason for not using #bash is that it is it NOT part
> of the default install on non Linux systems.
> > That is what package dependencies are for.
> Matt's point is simple: Avoiding dependencies is far better than
> declaring them.
>
> There is nothing in bash which cannot be easily done in the standard
> POSIX shell.
>
> We have avoided these things in most of our RAs - and there is no reason
> to change that.
>
> --
> Alan Robertson<alanr [at] unix> - @OSSAlanR
>
> "Openness is the foundation and preservative of friendship... Let me
> claim from you at all times your undisguised opinions." - William
> Wilberforce
> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev [at] lists
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
>



--
Serge Dubrouski.
Attachments: pgsql.patch (46.5 KB)


matsuo.tak at gmail

Mar 28, 2012, 5:59 PM

Post #11 of 11 (927 views)
Permalink
Re: Patch: pgsql streaming replication [In reply to]

Hi Serge

2012/3/28 Serge Dubrouski <sergeyfd [at] gmail>:
> Actually it doesn't matter what bash can or cannot do. The main point is
> that we can't change shell for RA that's been around for 6 years for the
> reasons of backward compatibility. It was completely my mistake that I
> didn't notice it.
>
> Attached is the fixed patch.
>
> Takatoshi, I also replace $HOSTNAME with $NODENAME to avoid confusion with
> embedded bash variable and make checkbashism script happy.

Thanks.
I applied it to my repository.

Please consider this patch too.
https://github.com/t-matsuo/resource-agents/commit/c279b83d3590b8f9bd6c6e1c150008da1121a760

Regards,
Takatoshi MATSUO
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Linux-HA dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.