Optimize walsender handling invalid messages of 'drop publication'

From: Bowen Shi <zxwsbg12138(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Optimize walsender handling invalid messages of 'drop publication'
Date: 2023-02-27 08:12:11
Message-ID: CAM_vCudj3_HdJ2G5erwq_Jj+-bwfr67yxmS8oh=-cjPXY4pihg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

Before PG 14, walsender process has to handle invalid message in one
XLOG (PG 14 provide a particular XLOG type: XLOG_XACT_INVALIDATIONS).
This may bring some problems which has been discussed in previous
mail: https://www.postgresql.org/message-id/flat/CAM_vCufO3eeRZ_O04z9reiE%2BB644%2BRgczbAVo9C5%2BoHV9S7%2B-g%40mail.gmail.com#981e65567784e0aefa4474cc3fd840f6

This patch can solve the problem. It has three parts:
1. pgoutput do not do useless invalid cache anymore;
2. Add a relid->relfilenode hash map to invoid hash seq search;
3. test case: It needs two or three minutes to finish.

The patch is based on the HEAD of branch REL_13_STABLE. It also works
for PG 10~12.

Thanks.
Bowenshi

Attachment Content-Type Size
0001-Optimize-invalidating-cache-in-pgoutput-and-relfilen.patch application/octet-stream 10.6 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2023-02-27 08:20:21 Re: Time delayed LR (WAS Re: logical replication restrictions)
Previous Message Amit Kapila 2023-02-27 08:05:29 Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher