Re: Is there any documentation on how to correctly create extensions in HA(primary-standby) setup?

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Is there any documentation on how to correctly create extensions in HA(primary-standby) setup?
Date: 2021-12-03 14:28:52
Message-ID: CALj2ACWr6u6pZpHq-NqnYPK8NgXaxTOWsNnmfDxFT=OXrQ_vPg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 1, 2021 at 12:31 PM Bharath Rupireddy
<bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
>
> Hi,
>
> I recently did a small experiment to see how one can create extensions
> properly in HA(primary-standby) setup.
>
> Here are my findings:
> 1) ALTER SYSTEM SET or GUC(configuration parameters) settings are not
> replicated to standby.
> 2) CREATE EXTENSION statements are replicated to standby.
> 3) If the extension doesn't need to be set up in
> shared_preload_libraries GUC, no need to create extension on the
> standby, it just works.
> 4) If the extension needs to be set up in shared_preload_libraries
> GUC: the correct way to install the extension on both primary and
> standby is:
> a) set shared_preload_libraries GUC on primary, reload conf,
> restart the primary to make the GUC effective.
> b) set shared_preload_libraries GUC on standby, restart the
> standby to make the GUC effective.
> c) create extension on primary (we don't need to create extension
> on standby as the create extension statements are replicated).
> d) verify that the extension functions work on both primary and standby.
> 5) The extensions which perform writes to the database may not work on
> standby as the write transactions are not allowed on the standby.
> However, the create extension on the standby works just fine but the
> functions it provides may not work.
>
> I think I was successful in my experiment, please let me know if
> anything is wrong in what I did.
>
> Do we have the documentation on how to create extensions correctly in
> HA setup? If what I did is correct and we don't have it documented,
> can we have it somewhere in the existing HA related documentation?

I'm thinking of adding the above steps into the "Additional Supplied
Modules" section documentation. Any thoughts please?

[1] - https://www.postgresql.org/docs/devel/contrib.html

Regards,
Bharath Rupireddy.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2021-12-03 14:57:51 Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints
Previous Message Bharath Rupireddy 2021-12-03 14:19:52 Re: should we document an example to set multiple libraries in shared_preload_libraries?