diff options
author | Amit Kapila <akapila@postgresql.org> | 2023-08-14 08:38:03 +0530 |
---|---|---|
committer | Amit Kapila <akapila@postgresql.org> | 2023-08-14 08:38:03 +0530 |
commit | 2a8b40e3681921943a2989fd4ec6cdbf8766566c (patch) | |
tree | a5c55ec41deb79663ab7b9585f63bd6b1dcd3ad7 /src/backend/replication/logical/tablesync.c | |
parent | 3d8d217450a63638825167c17ed791122f376176 (diff) | |
download | postgresql-2a8b40e3681921943a2989fd4ec6cdbf8766566c.tar.gz postgresql-2a8b40e3681921943a2989fd4ec6cdbf8766566c.zip |
Simplify determining logical replication worker types.
We deduce a LogicalRepWorker's type from the values of several different
fields ('relid' and 'leader_pid') whenever logic needs to know it.
In fact, the logical replication worker type is already known at the time
of launching the LogicalRepWorker and it never changes for the lifetime of
that process. Instead of deducing the type, it is simpler to just store it
one time, and access it directly thereafter.
Author: Peter Smith
Reviewed-by: Amit Kapila, Bharath Rupireddy
Discussion: http://postgr.es/m/CAHut+PttPSuP0yoZ=9zLDXKqTJ=d0bhxwKaEaNcaym1XqcvDEg@mail.gmail.com
Diffstat (limited to 'src/backend/replication/logical/tablesync.c')
-rw-r--r-- | src/backend/replication/logical/tablesync.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/replication/logical/tablesync.c b/src/backend/replication/logical/tablesync.c index 651a7750653..67bdd14095e 100644 --- a/src/backend/replication/logical/tablesync.c +++ b/src/backend/replication/logical/tablesync.c @@ -587,7 +587,8 @@ process_syncing_tables_for_apply(XLogRecPtr current_lsn) TimestampDifferenceExceeds(hentry->last_start_time, now, wal_retrieve_retry_interval)) { - logicalrep_worker_launch(MyLogicalRepWorker->dbid, + logicalrep_worker_launch(WORKERTYPE_TABLESYNC, + MyLogicalRepWorker->dbid, MySubscription->oid, MySubscription->name, MyLogicalRepWorker->userid, |