Thread: Postgresql Bug Report
Hi,
Hi, I have an #bug #problem. It's occur pg_basebackup and
systemctl restart postgresql-12
. How can I repair it? Attachment
Hi, On Tue, Sep 22, 2020 at 4:09 PM İsmet BALAT <bcalbatros@gmail.com> wrote: > > Hi, > > Hi, I have an #bug #problem. It's occur pg_basebackup and systemctl restart postgresql-12 . How can I repair it? The reason for this problem should be given in the postgres logs. Could you show us the relevant extract?
Hi Julien,
Thanks for the reply. My log in addition. I did;
1- rm -fr /var/lib/pgsql/12/data/*
2- /usr/pgsql-12/bin/pg_basebackup --host=master_ip --pgdata=/var/lib/pgsql/12/data/ --username=replica_user --verbose --progress --wal-method=stream --write-recovery-conf --checkpoint=fast --create-slot --slot=ha_slot
3- systemctl restart postgresql-12
4- Crush :/
But I tried same steps and all of this and avarage 8-success, 2-this fail. I don't understand because I did same everthing of steps.
Thank you for now.
Julien Rouhaud <rjuju123@gmail.com>, 22 Eyl 2020 Sal, 11:13 tarihinde şunu yazdı:
Hi,
On Tue, Sep 22, 2020 at 4:09 PM İsmet BALAT <bcalbatros@gmail.com> wrote:
>
> Hi,
>
> Hi, I have an #bug #problem. It's occur pg_basebackup and systemctl restart postgresql-12 . How can I repair it?
The reason for this problem should be given in the postgres logs.
Could you show us the relevant extract?
Attachment
On Tue, Sep 22, 2020 at 7:36 PM İsmet BALAT <bcalbatros@gmail.com> wrote: > > Hi Julien, > > Thanks for the reply. My log in addition. I did; > 1- rm -fr /var/lib/pgsql/12/data/* > 2- /usr/pgsql-12/bin/pg_basebackup --host=master_ip --pgdata=/var/lib/pgsql/12/data/ --username=replica_user --verbose--progress --wal-method=stream --write-recovery-conf --checkpoint=fast --create-slot --slot=ha_slot > 3- systemctl restart postgresql-12 > 4- Crush :/ > > But I tried same steps and all of this and avarage 8-success, 2-this fail. I don't understand because I did same everthingof steps. > > Thank you for now. It seems that you have an issue with your procedure, as the logs show: 2020-09-22 14:23:59.041 +03 [5045] FATAL: database system identifier differs between the primary and standby 2020-09-22 14:23:59.041 +03 [5045] DETAIL: The primary's identifier is 6875268062102845505, the standby's identifier is 6875268050644555587. [...] 2020-09-22 14:30:27.418 +03 [9247] LOG: database system was shut down in recovery at 2020-09-22 14:30:27 +03 2020-09-22 14:30:27.419 +03 [9247] LOG: entering standby mode 2020-09-22 14:30:27.419 +03 [9247] LOG: invalid primary checkpoint record 2020-09-22 14:30:27.419 +03 [9247] PANIC: could not locate a valid checkpoint record 2020-09-22 14:30:28.913 +03 [9244] LOG: startup process (PID 9247) was terminated by signal 6: Aborted 2020-09-22 14:30:28.913 +03 [9244] LOG: aborting startup due to startup process failure 2020-09-22 14:30:29.008 +03 [9244] LOG: database system is shut down I see that your step 3 is to *restart* the postgres service. Are you executing the pg_basebackup command (and removing the data) while the server is running? If yes don't search any further, that can't work.
On Tue, Sep 22, 2020 at 7:52 PM Julien Rouhaud <rjuju123@gmail.com> wrote: > > On Tue, Sep 22, 2020 at 7:36 PM İsmet BALAT <bcalbatros@gmail.com> wrote: > > > > Hi Julien, > > > > Thanks for the reply. My log in addition. I did; > > 1- rm -fr /var/lib/pgsql/12/data/* > > 2- /usr/pgsql-12/bin/pg_basebackup --host=master_ip --pgdata=/var/lib/pgsql/12/data/ --username=replica_user --verbose--progress --wal-method=stream --write-recovery-conf --checkpoint=fast --create-slot --slot=ha_slot > > 3- systemctl restart postgresql-12 > > 4- Crush :/ > > > > But I tried same steps and all of this and avarage 8-success, 2-this fail. I don't understand because I did same everthingof steps. > > > > Thank you for now. > > It seems that you have an issue with your procedure, as the logs show: > > 2020-09-22 14:23:59.041 +03 [5045] FATAL: database system identifier > differs between the primary and standby > 2020-09-22 14:23:59.041 +03 [5045] DETAIL: The primary's identifier > is 6875268062102845505, the standby's identifier is > 6875268050644555587. > [...] > 2020-09-22 14:30:27.418 +03 [9247] LOG: database system was shut down > in recovery at 2020-09-22 14:30:27 +03 > 2020-09-22 14:30:27.419 +03 [9247] LOG: entering standby mode > 2020-09-22 14:30:27.419 +03 [9247] LOG: invalid primary checkpoint record > 2020-09-22 14:30:27.419 +03 [9247] PANIC: could not locate a valid > checkpoint record > 2020-09-22 14:30:28.913 +03 [9244] LOG: startup process (PID 9247) > was terminated by signal 6: Aborted > 2020-09-22 14:30:28.913 +03 [9244] LOG: aborting startup due to > startup process failure > 2020-09-22 14:30:29.008 +03 [9244] LOG: database system is shut down > > I see that your step 3 is to *restart* the postgres service. Are you > executing the pg_basebackup command (and removing the data) while the > server is running? If yes don't search any further, that can't work. For the archive's sake, OP did confirm that stopping postgres before step 1 fixed the issue.
Great, thanks for the update.
Julien Rouhaud <rjuju123@gmail.com>, 22 Eyl 2020 Sal, 16:04 tarihinde şunu yazdı:
On Tue, Sep 22, 2020 at 7:52 PM Julien Rouhaud <rjuju123@gmail.com> wrote:
>
> On Tue, Sep 22, 2020 at 7:36 PM İsmet BALAT <bcalbatros@gmail.com> wrote:
> >
> > Hi Julien,
> >
> > Thanks for the reply. My log in addition. I did;
> > 1- rm -fr /var/lib/pgsql/12/data/*
> > 2- /usr/pgsql-12/bin/pg_basebackup --host=master_ip --pgdata=/var/lib/pgsql/12/data/ --username=replica_user --verbose --progress --wal-method=stream --write-recovery-conf --checkpoint=fast --create-slot --slot=ha_slot
> > 3- systemctl restart postgresql-12
> > 4- Crush :/
> >
> > But I tried same steps and all of this and avarage 8-success, 2-this fail. I don't understand because I did same everthing of steps.
> >
> > Thank you for now.
>
> It seems that you have an issue with your procedure, as the logs show:
>
> 2020-09-22 14:23:59.041 +03 [5045] FATAL: database system identifier
> differs between the primary and standby
> 2020-09-22 14:23:59.041 +03 [5045] DETAIL: The primary's identifier
> is 6875268062102845505, the standby's identifier is
> 6875268050644555587.
> [...]
> 2020-09-22 14:30:27.418 +03 [9247] LOG: database system was shut down
> in recovery at 2020-09-22 14:30:27 +03
> 2020-09-22 14:30:27.419 +03 [9247] LOG: entering standby mode
> 2020-09-22 14:30:27.419 +03 [9247] LOG: invalid primary checkpoint record
> 2020-09-22 14:30:27.419 +03 [9247] PANIC: could not locate a valid
> checkpoint record
> 2020-09-22 14:30:28.913 +03 [9244] LOG: startup process (PID 9247)
> was terminated by signal 6: Aborted
> 2020-09-22 14:30:28.913 +03 [9244] LOG: aborting startup due to
> startup process failure
> 2020-09-22 14:30:29.008 +03 [9244] LOG: database system is shut down
>
> I see that your step 3 is to *restart* the postgres service. Are you
> executing the pg_basebackup command (and removing the data) while the
> server is running? If yes don't search any further, that can't work.
For the archive's sake, OP did confirm that stopping postgres before
step 1 fixed the issue.