Re: [External] Slot issues

2018-10-14 Thread Andreas Kretschmer
Am 14.10.2018 um 21:02 schrieb Vijaykumar Jain: from the doc, it says defaults are 10, that's only valid for version 10, not for 9.x. Default was 0. Regards, Andreas -- 2ndQuadrant - The PostgreSQL Support Company. www.2ndQuadrant.com

Re: [External] Slot issues

2018-10-14 Thread Vijaykumar Jain
ok my bad. i just set one of the 9.6.9 versions to have max_replication_slots =2 and still i had to slots active. ostgres=# table pg_replication_slots; slot_name| plugin | slot_type | datoid | database | active | active_pid | xmin | catalog_xmin | restart_lsn |

Re: Slot issues

2018-10-14 Thread bhargav kamineni
Yeah i have used rsync , Got it now will increase the max_replication_slots to high enough , Thank you Andres Freund :-) On Mon, 15 Oct 2018 at 02:40, Andres Freund wrote: > Hi, > > Please try to quote properly. > > On 2018-10-15 01:57:53 +0530, bhargav kamineni wrote: > > I got his on standby,

Re: Slot issues

2018-10-14 Thread Andres Freund
Hi, As I just wrote: > On Mon, 15 Oct 2018 at 02:40, Andres Freund wrote: > > Please try to quote properly. On 2018-10-15 02:45:51 +0530, bhargav kamineni wrote: > Yeah i have used rsync , Got it now will increase the max_replication_slots > to high enough , Thank you Andres Freund :-) You

Re: Slot issues

2018-10-14 Thread Ravi Krishna
The best part in Db2 HADR is that when the standby is catching up with the master after a long time, it will start from the last LSN and fetch it from the primary WAL directory (active logs ). If not found, it will look for it in the archived logs and start applying from there until the current

Slot issues

2018-10-14 Thread bhargav kamineni
Hi Team, I am getting this ERROR while starting my second slave server PANIC: too many replication slots active before shutdown HINT: Increase max_replication_slots and try again. max_replication_slots on my master is 2 and one of them is already active for another slave, do i need to

Re: Slot issues

2018-10-14 Thread bhargav kamineni
I got his on standby, could you please explain in detail about --*but that *on the standby* haven't set max_replication_slots high enough* . Thanks, Bhargav On Mon, 15 Oct 2018 at 01:50, Andres Freund wrote: > Hi, > > On 2018-10-15 00:15:53 +0530, bhargav kamineni wrote: > > Hi Team, > > > >

Re: Slot issues

2018-10-14 Thread Ravi Krishna
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.

Re: Slot issues

2018-10-14 Thread bhargav kamineni
> You probably afterwards want to drop those slots from the new standby. > See the following section from the docs: > https://www.postgresql.org/docs/current/static/continuous-archiving.html#BACKUP-LOWLEVEL-BASE-BACKUP-DATA "It is often a good idea to also omit from the backup the files within

Re: Slot issues

2018-10-14 Thread Andreas Kretschmer
Am 14.10.2018 um 20:45 schrieb bhargav kamineni: I am getting this ERROR while starting my second slave server PANIC:  too many replication slots active before shutdown HINT:  Increase max_replication_slots and try again. max_replication_slots on my master is 2 and one of them is already

Re: Slot issues

2018-10-14 Thread Andres Freund
Hi, On 2018-10-15 00:15:53 +0530, bhargav kamineni wrote: > Hi Team, > > I am getting this ERROR while starting my second slave server > > PANIC: too many replication slots active before shutdown > HINT: Increase max_replication_slots and try again. > > max_replication_slots on my master is

Re: [External] Re: Slot issues

2018-10-14 Thread Vijaykumar Jain
What was the whole point of this divergence :) We use replication slots and it is for this reason we are able to scale our applications by redirecting reads and writes backed by haproxy and pgbouncer. with the health check of replication lag. It works awesome and at a much much lower cost to

Re: [External] Slot issues

2018-10-14 Thread bhargav kamineni
postgres=# select * from pg_replication_slots ; slot_name | plugin | slot_type | datoid | database | active | active_pid | xmin | catalog_xmin | restart_lsn

Re: [External] Re: Slot issues

2018-10-14 Thread Vijaykumar Jain
i guess he is trying to confirm if the value of max_replication_slot is the same on all the master and the standby nodes. also, I am trying to shoot in the dark. can you give the output of (on master) ls /var/lib/postgresql//main/pg_replslot/* also the value of max_replication_slot on the

Re: [External] Re: Slot issues

2018-10-14 Thread Vijaykumar Jain
ok wait, you data directory path may be different :) i mean wherever your pg data dir is, from there find pg_replslot folder and list the contents of it. Regards, Vijay On Mon, Oct 15, 2018 at 2:10 AM Vijaykumar Jain wrote: > i guess he is trying to confirm if the value of

Re: [External] Re: Slot issues

2018-10-14 Thread Vijaykumar Jain
Sorry Bhargav. I tried to simulate the scenarios, 3 node cluster 1primary, 2hot standby given: max_replication_slots = 2 on primary, and i try to create 2 hot standby -> runs fine. max_replication_slots = 1 on primary, and i try to create 2 hot standby -> gives PANIC, increase replication slots.

Re: [External] Re: Slot issues

2018-10-14 Thread Vijaykumar Jain
ah that explains. Thanks andres. I do not use rsync, hence was not able to reproduce i guess :) Regards, Vijay On Mon, Oct 15, 2018 at 2:46 AM bhargav kamineni wrote: > Yeah i have used rsync , Got it now will increase the > max_replication_slots to high enough , Thank you Andres Freund :-)

Re: Slot issues

2018-10-14 Thread Andres Freund
Hi, On 2018-10-15 03:18:35 +0530, bhargav kamineni wrote: > > You probably afterwards want to drop those slots from the new standby. > > See the following section from the docs: > > > > https://www.postgresql.org/docs/current/static/continuous-archiving.html#BACKUP-LOWLEVEL-BASE-BACKUP-DATA >

Re: Slot issues

2018-10-14 Thread Andres Freund
Hi, On 2018-10-14 17:52:30 -0400, Ravi Krishna wrote: > The best part in Db2 HADR is that when the standby is catching up with the > master after a long time, it will > start from the last LSN and fetch it from the primary WAL directory (active > logs ). If not found, it will look for it > in

Re: Slot issues

2018-10-14 Thread Andreas Kretschmer
Am 14.10.2018 um 21:07 schrieb bhargav kamineni: Postgres version is 9.5.14 , currently only one slot is there and it is active that's strange. Please check if this setting is active (select from pg_settings). Please check also max_wal_senders. no futher ideas at the moment :-( Regards,

Re: [External] Slot issues

2018-10-14 Thread Vijaykumar Jain
I guess max_replication_slots has to > current total slots in use. (and not >= ) https://www.postgresql.org/docs/10/static/runtime-config-replication.html https://github.com/postgres/postgres/blob/d6e98ebe375e115c29028f9bd090f0f7e07e2527/src/backend/replication/slot.c#L1506 from the doc, it

Re: [External] Re: Slot issues

2018-10-14 Thread bhargav kamineni
pg_replslot # ls -lrth total 4.0K drwx-- 2 postgres postgres 4.0K Oct 14 14:55 replication_slot On Mon, 15 Oct 2018 at 02:11, Vijaykumar Jain wrote: > ok wait, you data directory path may be different :) > i mean wherever your pg data dir is, from there find pg_replslot folder > and list

Re: Slot issues

2018-10-14 Thread Andres Freund
Hi, Please try to quote properly. On 2018-10-15 01:57:53 +0530, bhargav kamineni wrote: > I got his on standby, could you please explain in detail about > --*but that *on the standby* haven't set max_replication_slots high enough* > . What is max_replication_slots set to on the new standby?

Fwd: Query Optimizer Postgresql

2018-10-14 Thread Sumit Chaturvedi
Hello everyone! I'm seeking answers for the following questions. Looking forward to hearing from you all. -- Forwarded message - From: Sumit Chaturvedi Date: Sun, Oct 14, 2018 at 8:50 PM Subject: Query Optimizer Postgresql To: Cc: Adwait Godbole , Nilay Pande , Hello Sir My

Re: [External] Slot issues

2018-10-14 Thread Vijaykumar Jain
from your master, can you give us the output of select * from pg_replication_slots; maybe some stray slot exists that you may not be aware of ? Regards, Vijay On Mon, Oct 15, 2018 at 1:08 AM Vijaykumar Jain wrote: > ok my bad. > > i just set one of the 9.6.9 versions to have

Re: Slot issues

2018-10-14 Thread Ravi Krishna
> > You're not forced to use slots. Their purpose is to allow to force the > primary to keep necessary resources around. Which also allows to get rid > of the archive in some setups. Thanks. Disclaimer: We don't use replication as we piggy back on AWS HA. The reason why I posted this is