Re: Regarding(Read Replica in RDS)

From: Keith <keith(at)keithf4(dot)com>
To: ROHIT SACHDEVA <sachdeva(dot)rohit648(at)gmail(dot)com>
Cc: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>, pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Regarding(Read Replica in RDS)
Date: 2024-03-07 16:46:51
Message-ID: CAHw75vv+HWhtO+5NAJsvS5AssK6fzecLjSrdfuvL=KiX_fb=Pg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

If your goal here is to have an FDW connection to another server ONLY on
the replica, or different than the SERVER definition on the primary, I
don't believe that is possible based on the error that you are getting.
Whether you use a replica as a read-only or not, PG always considers a
replica as a potential failover target, so that sort of data cannot be
different within the replication cluster.

Once you promote that replica to a primary to allow writes, you can only
turn it back into a replica again by re-syncing it with the target primary
which would undo any changes you did to it after promotion.

Off the top of my head, I'm not sure if FDW connections created on the
primary are actually usable on the replica as well. Would have to test and
see. If so, and if you wanted another FDW connection to use on your
replica, just create it on the primary and then only actually use it on the
replica.

Keith

On Thu, Mar 7, 2024 at 11:25 AM ROHIT SACHDEVA <sachdeva(dot)rohit648(at)gmail(dot)com>
wrote:

> Any other option.
>
> Bcz if I promote can I rollback again.
>
> Regards
> Rohit Sachdeva
>
> On Thu, 7 Mar, 2024, 8:00 pm Ron Johnson, <ronljohnsonjr(at)gmail(dot)com> wrote:
>
>> On Thu, Mar 7, 2024 at 9:26 AM Dan Smith <j(dot)daniel(dot)smith1(at)gmail(dot)com>
>> wrote:
>>
>>> You can promote a Read Replica via AWS CLI or AWS Web Console.
>>>
>>> Reference:
>>>
>>> -
>>> https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReadRepl.html#USER_ReadRepl.Promote
>>> -
>>> https://awscli.amazonaws.com/v2/documentation/api/latest/reference/rds/promote-read-replica.html
>>>
>>> aws rds promote-read-replica \
>>>> --db-instance-identifier test-instance-repl
>>>>
>>>> Which breaks replication. You can't "demote".
>>
>>>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Ron Johnson 2024-03-07 17:21:07 Re: Regarding(Read Replica in RDS)
Previous Message ROHIT SACHDEVA 2024-03-07 16:25:02 Re: Regarding(Read Replica in RDS)