Re: Reindex doesn’t not working replica nodes - Mailing list pgsql-admin

From Peter Gram
Subject Re: Reindex doesn’t not working replica nodes
Date
Msg-id CAJ=80GUOozWnm14_vJ3MccTZ9LNJ7d6Rsd_bkszMr=MrWdFm-w@mail.gmail.com
Whole thread Raw
In response to Re: Reindex doesn’t not working replica nodes  (khan Affan <bawag773@gmail.com>)
Responses Re: Reindex doesn’t not working replica nodes
List pgsql-admin
Hi Mohammed

If we are talking physical replication then the wall includes changes to index’s data. If we are talking logical replication the wall does not include index changes. 

Med venlig hilsen

Peter Gram
Sæbyholmsvej 18 
2500 Valby

Mobile: (+45) 5374 7107



On Fri, 16 Aug 2024 at 13.20, khan Affan <bawag773@gmail.com> wrote:
Hi Mohammed,

PostgreSQL replication is based on replicating WAL (Write-Ahead Log) records, which capture changes to data files such as inserts, updates, deletes, and the creation of new tables. However,

WAL does not include the physical structure of indexes.

If you're encountering issues like zero rows being fetched from the replica, it could be due to index inconsistencies or replication lag. To ensure your read replica has updated indexes, you can promote the replica to be the primary node, perform the REINDEX operation, and then revert the roles, making the original primary node the primary again.

Regards
Muhammad Affan

On Wed, Aug 14, 2024 at 5:58 PM Mohammed Afsar <vmdapsar@gmail.com> wrote:
Dear experts,


We have initiated reindex on source db but it not replicated to replica db and we have having select query fetching with zero rows but data exiting on the table.
Postgres 11.10 streaming replication 

Regards,
Mohammed Afsar

pgsql-admin by date:

Previous
From: Mohammed Afsar
Date:
Subject: Re: Reindex doesn’t not working replica nodes
Next
From: khan Affan
Date:
Subject: Re: Reindex doesn’t not working replica nodes