mirror of
https://github.com/postgres/postgres.git
synced 2025-06-13 07:41:39 +03:00
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
This commit is contained in:
@ -942,7 +942,7 @@ ParallelApplyWorkerMain(Datum main_arg)
|
||||
MyLogicalRepWorker->last_send_time = MyLogicalRepWorker->last_recv_time =
|
||||
MyLogicalRepWorker->reply_time = 0;
|
||||
|
||||
InitializeApplyWorker();
|
||||
InitializeLogRepWorker();
|
||||
|
||||
InitializingApplyWorker = false;
|
||||
|
||||
|
Reference in New Issue
Block a user