pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedReplication terminated by primary server
4+ messages / 3 participants
[nested] [flat]
* Replication terminated by primary server
@ 2012-07-16 11:52 Nicolau Roca <nicolau.roca@uib.cat>
0 siblings, 0 replies; 4+ messages in thread
From: Nicolau Roca @ 2012-07-16 11:52 UTC (permalink / raw)
To: pgsql-general
Hi,
we have configured a synchronous master-slave replication.
Node "postgres1" is the master, while node "postgres2" is the slave.
It works fine, but when restarting the master (using "pg_ctl restart"),
the replication is broken. In the slave log we have the following message:
2012-07-16 13:10:20 CESTFATAL: replication terminated by primary server
There is a process in the slave which indicates the file the slave is
waiting for:
[postgres@postgres2 walpostgres1]$ ps -ef | grep start
postgres 1874 1872 0 Jun19 ? 00:01:04 postgres: startup
process waiting for 000000010000000C000000A6
Once we manually copy this file from the master (in path
$PGDATA/pg_xlog) to the archive location (in the slave), the replication
is resumed.
[postgres@postgres1 pg_xlog]$ scp 000000010000000C000000A6
postgres2:/home/postgres/walpostgres1
000000010000000C000000A6 100% 16MB 16.0MB/s 00:01
And in the slave log:
2012-07-16 13:16:03 CESTLOG: restored log file
"000000010000000C000000A6" from archive
2012-07-16 13:16:03 CESTLOG: record with zero length at C/A60000B0
2012-07-16 13:16:03 CESTLOG: unexpected pageaddr C/84000000 in log file
12, segment 166, offset 0
2012-07-16 13:16:03 CESTLOG: streaming replication successfully
connected to primary
Is this a configuration issue?
The archive_command in postgresql.conf in the master is:
archive_command = 'scp %p postgres2:/home/postgres/walpostgres1/%f'
Thank you
Best regards,
Nicolau
^ permalink raw reply [nested|flat] 4+ messages in thread
* replication terminated by primary server
@ 2017-12-06 13:07 Bruyninckx Kristof <Kristof.Bruyninckx@cegeka.com>
2017-12-07 18:29 ` Re: replication terminated by primary server Payal Singh <payals1@umbc.edu>
0 siblings, 1 reply; 4+ messages in thread
From: Bruyninckx Kristof @ 2017-12-06 13:07 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
In our environment, we have a master slave replication setup that has been working stable for the last year.
Host systems are debian Jessie and we are using postgres 9.4.
Now recently we have experienced a crash/hung master, and after restarting the postgress services on here the replication stopped working. The master however is running seemingly normal, except for the errors reported when it got restarted. After this nothing error related is reported.
[10192-1] [unknown]@[unknown] LOG: incomplete startup packet
[10222-1] [unknown]@[unknown] LOG: incomplete startup packet
[10033-2] LOG: replication terminated by primary server
[10033-3] DETAIL: End of WAL reached on timeline 2 at 999/A5687790.
[1082-12] LOG: invalid record length at 999/A5687790
[10239-1] LOG: started streaming WAL from primary at 999/A5000000 on timeline 2
[1064-7] LOG: startup process (PID 1082) exited with exit code 1
[1064-8] LOG: terminating any other active server processes
[18749-1] readonly@pal WARNING: terminating connection because of crash of another server process
[25793-1] _readonly@pal WARNING: terminating connection because of crash of another server process
After a recent crash of the postgres master I'm not able to get the slave to start replicating.
I always get the following error message
13247-2] HINT: Future log output will go to log destination "syslog".
[13247-3] LOCATION: PostmasterMain, postmaster.c:1228
[13248-1] LOG: 00000: database system was interrupted while in recovery at log time 2017-12-04 15:10:29 CET
[13248-2] HINT: If this has occurred more than once some data might be corrupted and you might need to choose an earlier recovery target.
[13248-3] LOCATION: StartupXLOG, xlog.c:6134
[13248-4] LOG: 00000: entering standby mode
[13248-5] LOCATION: StartupXLOG, xlog.c:6203
[13247-4] LOG: 00000: startup process (PID 13248) exited with exit code 1
[13247-5] LOCATION: LogChildExit, postmaster.c:3452
[13247-6] LOG: 00000: aborting startup due to startup process failure
I've already tried to perform a complete backup and resync procedure on the slave
pg_basebackup -D /var/lib/postgresql/backups/fullbackup -R -h <IP> --checkpoint=fast --username=<username> --xlog-method=stream
Which completes without any error message. The odd thing is that the backup folder does already contains a recovery.done file. When I do the same command on a test platform this recovery.done is not created.
But the test is using 9.5. Not sure it is related.
Also the recovery.conf contains all the information is should but still the error message stays the same.
cat recovery.conf
recovery_target_timeline='latest'
standby_mode = 'on'
primary_conninfo = 'user=<user> password=<passwd> host=IP port=5432 sslmode=prefer sslcompression=1 krbsrvname=postgres'
Does this mean that the corruption is on the master system and it needs to be restored to a point before it crashed ? Not sure what I can do to get the replication working again ?
Any ideas ?
Kind Regards,
Kristof
Met vriendelijke groeten / Meilleures salutations / Best regards
Kristof Bruyninckx
System Engineer
E Kristof.Bruyninckx@cegeka.com<mailto:Kristof.Bruyninckx@cegeka.com>
M +32 473 33 50 67
[cid:image003.jpg@01D36E9B.7F398A60]
CEGEKA Universiteitslaan 9
B-3500 Hasselt, Belgium
T +32 11 24 02 34
WWW.CEGEKA.COM<http://www.cegeka.com;
[LinkedIn]<https://www.linkedin.com/company/cegeka;
[Twitter]<https://twitter.com/cegeka;
[Facebook]<https://www.facebook.com/Cegeka/;
[Youtube]<https://www.youtube.com/user/2010Cegeka;
[cid:image008.jpg@01D36E9B.7F398A60]<http://www.cegeka.com/be/nl/emailsignature;
Attachments:
image001.jpg (image/jpeg, 7.9K) download
view image
image002.jpg (image/jpeg, 8.3K) download
view image
image003.jpg (image/jpeg, 4.6K) download
view image
image004.jpg (image/jpeg, 9.2K) download
view image
image005.jpg (image/jpeg, 9.7K) download
view image
image006.jpg (image/jpeg, 9.1K) download
view image
image007.jpg (image/jpeg, 9.7K) download
view image
image008.jpg (image/jpeg, 29.2K) download
view image
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: replication terminated by primary server
2017-12-06 13:07 replication terminated by primary server Bruyninckx Kristof <Kristof.Bruyninckx@cegeka.com>
@ 2017-12-07 18:29 ` Payal Singh <payals1@umbc.edu>
2017-12-08 11:30 ` RE: replication terminated by primary server Bruyninckx Kristof <Kristof.Bruyninckx@cegeka.com>
0 siblings, 1 reply; 4+ messages in thread
From: Payal Singh @ 2017-12-07 18:29 UTC (permalink / raw)
To: Bruyninckx Kristof <Kristof.Bruyninckx@cegeka.com>; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
On Wed, Dec 6, 2017 at 8:07 AM, Bruyninckx Kristof <
Kristof.Bruyninckx@cegeka.com> wrote:
>
>
> In our environment, we have a master slave replication setup that has been
> working stable for the last year.
>
> Host systems are debian Jessie and we are using postgres 9.4.
>
> Now recently we have experienced a crash/hung master, and after restarting
> the postgress services on here the replication stopped working. The master
> however is running seemingly normal, except for the errors reported when it
> got restarted. After this nothing error related is reported.
>
Might want to check the master postgres logs during and after crash as
well. Also, check for wal file progress on master (select * from
pg_stat_archiver).
--
Payal Singh
Graduate Student
Department of Computer Science and Electrical Engineering
University of Maryland, Baltimore County
^ permalink raw reply [nested|flat] 4+ messages in thread
* RE: replication terminated by primary server
2017-12-06 13:07 replication terminated by primary server Bruyninckx Kristof <Kristof.Bruyninckx@cegeka.com>
2017-12-07 18:29 ` Re: replication terminated by primary server Payal Singh <payals1@umbc.edu>
@ 2017-12-08 11:30 ` Bruyninckx Kristof <Kristof.Bruyninckx@cegeka.com>
0 siblings, 0 replies; 4+ messages in thread
From: Bruyninckx Kristof @ 2017-12-08 11:30 UTC (permalink / raw)
To: Payal Singh <payals1@umbc.edu>; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
I’ve been going over the log of the system at the time of the crash, but I’m not seeing something that stands out as telling me anymore about the reason of either the crash or the failure to start the replication again. I’m attaching a part of the log file to this mail.
Correct me if I’m wrong but the “select * from pg_stat_archiver” is linked with WAL archiving, correct ? Currently this system has archiving switch off. For backup purposes we are running scheduled pg_dumps of each database.
So it didn’t give me any output. Which I think is normal since we switched it off.
To setup the replication we used the pg_basebackup with the --xlog-method=stream option this way pg_basebackup will not only copy the data as it is, but also stream the XLOG being created during the base backup to our destination server.
Not sure what the problem is since it appears to being able to perform these actions without any reported error.
Cheers,
Kristof
From: Payal Singh [mailto:payals1@umbc.edu]
Sent: donderdag 7 december 2017 19:29
To: Bruyninckx Kristof <Kristof.Bruyninckx@cegeka.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: replication terminated by primary server
On Wed, Dec 6, 2017 at 8:07 AM, Bruyninckx Kristof <Kristof.Bruyninckx@cegeka.com<mailto:Kristof.Bruyninckx@cegeka.com>> wrote:
In our environment, we have a master slave replication setup that has been working stable for the last year.
Host systems are debian Jessie and we are using postgres 9.4.
Now recently we have experienced a crash/hung master, and after restarting the postgress services on here the replication stopped working. The master however is running seemingly normal, except for the errors reported when it got restarted. After this nothing error related is reported.
Might want to check the master postgres logs during and after crash as well. Also, check for wal file progress on master (select * from pg_stat_archiver).
--
Payal Singh
Graduate Student
Department of Computer Science and Electrical Engineering
University of Maryland, Baltimore County
Attachments:
db.log (application/octet-stream, 257.0K) download
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2017-12-08 11:30 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-07-16 11:52 Replication terminated by primary server Nicolau Roca <nicolau.roca@uib.cat>
2017-12-06 13:07 replication terminated by primary server Bruyninckx Kristof <Kristof.Bruyninckx@cegeka.com>
2017-12-07 18:29 ` Re: replication terminated by primary server Payal Singh <payals1@umbc.edu>
2017-12-08 11:30 ` RE: replication terminated by primary server Bruyninckx Kristof <Kristof.Bruyninckx@cegeka.com>
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