From 02c1b64fb15ca018f0c159a0152497c8d6704d40 Mon Sep 17 00:00:00 2001 From: Amit Kapila Date: Thu, 3 Aug 2023 08:59:50 +0530 Subject: Refactor to split Apply and Tablesync Workers code. Both apply and tablesync workers were using ApplyWorkerMain() as entry point. As the name implies, ApplyWorkerMain() should be considered as the main function for apply workers. Tablesync worker's path was hidden and does not have enough in common to share the same main function with apply worker. Also, most of the code shared by both worker types is already combined in LogicalRepApplyLoop(). There is no need to combine the rest in ApplyWorkerMain() anymore. This patch introduces TablesyncWorkerMain() as a new entry point for tablesync workers. This aims to increase code readability and would help with future improvements like the reuse of tablesync workers in the initial synchronization. Author: Melih Mutlu based on suggestions by Melanie Plageman Reviewed-by: Peter Smith, Kuroda Hayato, Amit Kapila Discussion: http://postgr.es/m/CAGPVpCTq=rUDd4JUdaRc1XUWf4BrH2gdSNf3rtOMUGj9rPpfzQ@mail.gmail.com --- src/backend/replication/logical/applyparallelworker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/backend/replication/logical/applyparallelworker.c') diff --git a/src/backend/replication/logical/applyparallelworker.c b/src/backend/replication/logical/applyparallelworker.c index 6fb96148f4a..1d4e83c4c1f 100644 --- a/src/backend/replication/logical/applyparallelworker.c +++ b/src/backend/replication/logical/applyparallelworker.c @@ -942,7 +942,7 @@ ParallelApplyWorkerMain(Datum main_arg) MyLogicalRepWorker->last_send_time = MyLogicalRepWorker->last_recv_time = MyLogicalRepWorker->reply_time = 0; - InitializeApplyWorker(); + InitializeLogRepWorker(); InitializingApplyWorker = false; -- cgit v1.2.3