diff options
author | Amit Kapila <akapila@postgresql.org> | 2023-08-03 08:59:50 +0530 |
---|---|---|
committer | Amit Kapila <akapila@postgresql.org> | 2023-08-03 08:59:50 +0530 |
commit | 02c1b64fb15ca018f0c159a0152497c8d6704d40 (patch) | |
tree | e00d9c84a1df14e4f34aa457352a1dab762a5490 /src/backend/replication/logical/applyparallelworker.c | |
parent | 0125c4e21d7e9c8b3da95ffcd3e34c0f61c9b69a (diff) | |
download | postgresql-02c1b64fb15ca018f0c159a0152497c8d6704d40.tar.gz postgresql-02c1b64fb15ca018f0c159a0152497c8d6704d40.zip |
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
Diffstat (limited to 'src/backend/replication/logical/applyparallelworker.c')
-rw-r--r-- | src/backend/replication/logical/applyparallelworker.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |