pgsql: Improve invalidation handling in pgoutput.c.

From: Amit Kapila <akapila(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Improve invalidation handling in pgoutput.c.
Date: 2022-02-04 02:12:49
Message-ID: E1nFo5h-0000Nt-K4@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Improve invalidation handling in pgoutput.c.

Fix the following issues in pgoutput.c:

* rel_sync_cache_relation_cb does the wrong thing when called for a cache
flush (i.e., relid == 0). Instead of invalidating all RelationSyncCache
entries as it should, it does nothing.

* When rel_sync_cache_relation_cb does invalidate an entry, it immediately
zaps the entry->map structure, even though that might still be in use. We
instead just mark the entry as invalid and rebuild it at a later safe
point.

* Similarly, rel_sync_cache_publication_cb is way too eager to reset the
pubactions flags, which would likely lead to failing to transmit changes
that we should transmit. In this case also, we just mark the entry as
invalid and rebuild it at a later safe point.

Author: Tom Lane
Reviewed-by: Amit Kapila
Discussion: https://postgr.es/m/885288.1641420714@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7f481b8d3884445b3839e402bf6d156e458ffeb6

Modified Files
--------------
src/backend/replication/pgoutput/pgoutput.c | 115 ++++++++++++++++------------
1 file changed, 68 insertions(+), 47 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Thomas Munro 2022-02-04 03:18:33 pgsql: Track LLVM 14 API changes, up to 2022-01-30.
Previous Message Etsuro Fujita 2022-02-04 00:51:04 Re: pgsql: Further fix for EvalPlanQual with mix of local and foreign parti