Thread: Roll forward the replica instance

Roll forward the replica instance

From
Siraj G
Date:
Hello -

Is there any way we can roll forward the replica instance in PgSQL streaming replication environment? Say, WALs are deleted and there is a gap in the replica, what are the ways to sync the replica with its primary?

Regards
Siraj

Re: Roll forward the replica instance

From
nikhil kumar
Date:
Hi Siraj,


As per my experience there is two methods;
1. Standby db data directory move some other location. Create a new empty data directory 
Take the base backup again —- Preferred one  

2. If enable the archive log in your environment 
Take the missing wal files to correct time wal files. Move all files to wal directory location — this is bit complex 

Thanks & Best Regards,
Nikhil,


On Thu, 4 Jul 2024 at 11:18 PM, Siraj G <tosiraj.g@gmail.com> wrote:
Hello -

Is there any way we can roll forward the replica instance in PgSQL streaming replication environment? Say, WALs are deleted and there is a gap in the replica, what are the ways to sync the replica with its primary?

Regards
Siraj

Re: Roll forward the replica instance

From
Kashif Zeeshan
Date:
Hi

There can be two ways

1. Setup standby again.
2. Use  pg_rewind.


Regards
Kashif Zeeshan

On Thu, Jul 4, 2024 at 10:48 PM Siraj G <tosiraj.g@gmail.com> wrote:
Hello -

Is there any way we can roll forward the replica instance in PgSQL streaming replication environment? Say, WALs are deleted and there is a gap in the replica, what are the ways to sync the replica with its primary?

Regards
Siraj

Re: Roll forward the replica instance

From
nikhil kumar
Date:
Yes pg_rewind is available 
Thank you @kashif zeeshan

On Fri, 5 Jul 2024 at 9:46 AM, Kashif Zeeshan <kashi.zeeshan@gmail.com> wrote:
Hi

There can be two ways

1. Setup standby again.
2. Use  pg_rewind.


Regards
Kashif Zeeshan

On Thu, Jul 4, 2024 at 10:48 PM Siraj G <tosiraj.g@gmail.com> wrote:
Hello -

Is there any way we can roll forward the replica instance in PgSQL streaming replication environment? Say, WALs are deleted and there is a gap in the replica, what are the ways to sync the replica with its primary?

Regards
Siraj