Re: [PATCH] Reuse Workers and Replication Slots during Logical Replication
Melih Mutlu <m.melihmutlu@gmail.com>
From: Melih Mutlu <m.melihmutlu@gmail.com>
To: Peter Smith <smithpb2250@gmail.com>
Cc: Melanie Plageman <melanieplageman@gmail.com>, "wangw.fnst@fujitsu.com" <wangw.fnst@fujitsu.com>,
"shiy.fnst@fujitsu.com" <shiy.fnst@fujitsu.com>, Amit Kapila <amit.kapila16@gmail.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>, shveta malik <shveta.malik@gmail.com>
Date: 2023-06-01T10:54:02Z
Lists: pgsql-hackers
Attachments
- v2-0001-Reuse-Tablesync-Workers.patch (application/octet-stream) patch v2-0001
- v10-0002-Add-replication-protocol-cmd-to-create-a-snapshot.patch (application/octet-stream) patch v10-0002
- v13-0003-Reuse-Replication-Slot-and-Origin-in-Tablesync.patch (application/octet-stream) patch v13-0003
Hi, I rebased the patch and addressed the following reviews. Peter Smith <smithpb2250@gmail.com>, 24 May 2023 Çar, 05:59 tarihinde şunu yazdı: > Here are a few other random things noticed while looking at patch 0001: > > 1. Commit message > > 1a. typo /sequantially/sequentially/ > > 1b. Saying "killed" and "killing" seemed a bit extreme and implies > somebody else is killing the process. But I think mostly tablesync is > just ending by a normal proc exit, so maybe reword this a bit. > Fixed the type and reworded a bit. > > 2. It seemed odd that some -- clearly tablesync specific -- functions > are in the worker.c instead of in tablesync.c. > > 2a. e.g. clean_sync_worker > > 2b. e.g. sync_worker_exit > Honestly, the distinction between worker.c and tablesync.c is not that clear to me. Both seem like they're doing some work for tablesync and apply. But yes, you're right. Those functions fit better to tablesync.c. Moved them. > > 3. process_syncing_tables_for_sync > > + /* > + * Sync worker is cleaned at this point. It's ready to sync next table, > + * if needed. > + */ > + SpinLockAcquire(&MyLogicalRepWorker->relmutex); > + MyLogicalRepWorker->ready_to_reuse = true; > SpinLockRelease(&MyLogicalRepWorker->relmutex); > + } > + > + SpinLockRelease(&MyLogicalRepWorker->relmutex); > > Isn't there a double release of that mutex happening there? Fixed. Thanks, -- Melih Mutlu Microsoft
Commits
-
Refactor to split Apply and Tablesync Workers code.
- 02c1b64fb15c 17.0 landed
-
Fix possible logical replication crash.
- e7e7da2f8d57 16.0 cited