Re: Logical replication CPU-bound with TRUNCATE/DROP/CREATE many tables

From: Keisuke Kuroda <keisuke(dot)kuroda(dot)3862(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Dilip Kumar <dilipbalaut(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Logical replication CPU-bound with TRUNCATE/DROP/CREATE many tables
Date: 2020-10-01 02:51:54
Message-ID: CANDwggLd7s-qRPTxQFoN6vCvnh5Hj_DM4OT8GnvGN5BxMptzWA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Dilip, Amit,

Thank you for the patch!

I test the patch on the master HEAD(9796f455) and it works fine.
* make installcheck-world: passed
* walsender process continues to use 100% of the CPU 1core when
TRUNCATE 1000 partition: 1s or less
** before patch : 230s

There is "ReorderBufferAddInvalidation" in reorderbuffer.h, but I
don't think it's needed.

src/include/replication/reorderbuffer.h
+void ReorderBufferAddInvalidation(ReorderBuffer *, TransactionId,
XLogRecPtr lsn,
+ int nmsgs, SharedInvalidationMessage *msgs);

If possible, I'd like to improve it even before PG13,
but I recognize that it's difficult because it uses a PG14 or later
mechanism...

Best Regards,
--
Keisuke Kuroda
NTT Software Innovation Center
keisuke(dot)kuroda(dot)3862(at)gmail(dot)com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message tsunakawa.takay@fujitsu.com 2020-10-01 02:55:46 RE: [Patch] Optimize dropping of relation buffers using dlist
Previous Message Kyotaro Horiguchi 2020-10-01 02:51:36 Re: Disable WAL logging to speed up data loading