Queries in replica are failing

From: "Wetmore, Matthew (CTR)" <Matthew(dot)Wetmore(at)evernorth(dot)com>
To: ROHIT SACHDEVA <sachdeva(dot)rohit648(at)gmail(dot)com>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: Siraj G <tosiraj(dot)g(at)gmail(dot)com>, Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Queries in replica are failing
Date: 2024-05-31 18:49:20
Message-ID: aee4d808289443b49c6b1735bac699c9@evernorth.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

The correct answer, IMHO, is to not use the replica as a RO query db.

It’s not exactly specifically designed for that, and causes these exact issues.

All operations on Leader must happen first. The Replica cannot and should not be at blame for this. It’s not meant to be optimized.

If you really need a RO for research. DUMP and create a maindb_research.

This can all be automated with a shell script, so every morning you have a fresh research db.

You CAN do what you’re doing, it doesn’t mean you should.

You can cause major issues with a wrong click in the Replica, even in it’s RO status.

From: ROHIT SACHDEVA <sachdeva(dot)rohit648(at)gmail(dot)com>
Sent: Friday, May 31, 2024 11:21 AM
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: Siraj G <tosiraj(dot)g(at)gmail(dot)com>; Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: [EXTERNAL] Re: Queries in replica are failing

Can I pause or stop the replication at a particular time in postgres RDS.?

On Fri, May 31, 2024 at 11:47 PM Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at<mailto:laurenz(dot)albe(at)cybertec(dot)at>> wrote:
On Fri, 2024-05-31 at 23:37 +0530, ROHIT SACHDEVA wrote:
> On Thu, May 30, 2024 at 11:37 AM Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at<mailto:laurenz(dot)albe(at)cybertec(dot)at>> wrote:
> > Sure, WAL will pile up on the standby if it cannot be replayed right away.
> >
> > You could stop replication, but then WAL would pile up on the primary server.
> >
> > You have to keep the information somewhere.
>
> So What will be the work around for this.

Get more disk space, or perform less work on the database.

Yours,
Laurenz Albe

--
Have a Good day !!!

Regards
Rohit Sachdeva

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Mohan NBSPS 2024-05-31 23:00:52 postgrsql 9.5: Old WAL files remain in secondary `pg_xlog`
Previous Message ROHIT SACHDEVA 2024-05-31 18:20:46 Re: Queries in replica are failing