From: Ravi Krishna <srkrishna1@aol.com>
To: Vijaykumar Jain <vjain@opentable.com>
Cc: bhargavpostgres@gmail.com
Cc: andres@anarazel.de
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Slot issues
Date: Sun, 14 Oct 2018 17:49:30 -0400
Message-ID: <36CCE7FA-BD81-409F-AE79-224C1FB68053@aol.com> (raw)
In-Reply-To: <CAE7uO5hamDSdBrN7Dgwz=8NRyV9XbASMVpARoK3yi5KnvqxW0w@mail.gmail.com>
References: <CADCf-WNXHaLEz+nJqkr4TWNgfiGV13jACrZD60HRf1CSU+8+Ng@mail.gmail.com>
<20181014202042.gi6o3kitjvczc5ym@alap3.anarazel.de>
<CADCf-WPFr7JbVjjbTdqisdWbBVKg8QUx1=c=Mpa20OyraDwUXQ@mail.gmail.com>
<20181014211054.wxsekk3lqmdlacos@alap3.anarazel.de>
<CADCf-WMtfReVtYPs_P3hpT5WibTy7Bm9oTSWAKq6VCiHufzZWw@mail.gmail.com>
<CAE7uO5hamDSdBrN7Dgwz=8NRyV9XbASMVpARoK3yi5KnvqxW0w@mail.gmail.com>
When I read all such posts related to replication I realize how backward is PG's replication architecture
specially when compared to DB2.
This is how it is done in Db2 to set up replication.
1. take a full backup on the primary.
2. restore the backup on the other machine (aka standby)
3. start the instance on the standby machine as a standby and point to primary as the master
4. that's it. Db2 will fetch the relevant WAL (active) logs and start applying the logs to catch up.
5. Once it has caught up with the primary, it is in PEER mode.
To failover from master to slave
On the standby issue db2 takeover database dbname
that's it. it will flip master and standby and reverse their roles.
[ I am aware that why it is impossible in PG to reverse roles like this ]
Long time back I use to work in SQL Server and the setup of mirroring was as simple as DB2.
Negative of db2 replication: In DB2 replication, lot of restriction on standby to be used as a read-only.
One DDL statement or stats collection in the primary will put the standby in replay only mode where
it will kick out all sessions on standby until DDL/stats is applied on standby also.
Note: My knowledge of db2 replication is bit dated as I have not worked on it since 2014.
I love PG, but definitely replication management can be better.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: srkrishna1@aol.com, vjain@opentable.com, bhargavpostgres@gmail.com, andres@anarazel.de
Subject: Re: Slot issues
In-Reply-To: <36CCE7FA-BD81-409F-AE79-224C1FB68053@aol.com>
References: <CADCf-WNXHaLEz+nJqkr4TWNgfiGV13jACrZD60HRf1CSU+8+Ng@mail.gmail.com> <20181014202042.gi6o3kitjvczc5ym@alap3.anarazel.de> <CADCf-WPFr7JbVjjbTdqisdWbBVKg8QUx1=c=Mpa20OyraDwUXQ@mail.gmail.com> <20181014211054.wxsekk3lqmdlacos@alap3.anarazel.de> <CADCf-WMtfReVtYPs_P3hpT5WibTy7Bm9oTSWAKq6VCiHufzZWw@mail.gmail.com> <CAE7uO5hamDSdBrN7Dgwz=8NRyV9XbASMVpARoK3yi5KnvqxW0w@mail.gmail.com> <36CCE7FA-BD81-409F-AE79-224C1FB68053@aol.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox