Re: hot standby in Postgresql 12

From: Paul Förster <paul(dot)foerster(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Ankush Chawla <ankushchawla03(at)gmail(dot)com>, pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: hot standby in Postgresql 12
Date: 2021-01-19 05:48:17
Message-ID: 95BFBF96-8C8D-4691-BDE4-918F9F64A9CB@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi David,

> On 19. Jan, 2021, at 04:48, David G. Johnston <david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
>
> And now the standby is waiting for the next wal file to be archived by the primary. You should probably set archive_timeout to a non-zero value since the primary doesn’t seem very busy (though you also still need to do at least one write, empty wal files don’t get rotated out and archived.)

you should be able to get around your problem by doing the following on the primary database:

checkpoint;
select pg_switch_wal();

The pg_switch_wal() alone will not trigger WAL file generation if no transaction has been going on. That's why I recommend forcing a checkpoint before that (same with Oracle by the way).

As soon as a WAL is generated, it should get shipped to the standby database. Then it should open.

Cheers,
Paul

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Ankush Chawla 2021-01-19 06:17:09 Re: hot standby in Postgresql 12
Previous Message David G. Johnston 2021-01-19 04:24:04 Re: hot standby in Postgresql 12