Improvement in log message of logical replication worker

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Improvement in log message of logical replication worker
Date: 2017-05-12 04:30:25
Message-ID: CAD21AoBEKzQot24KhgW8_kTTi-SGLEM7Kh8EuW8Nj=v46qvSBA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

When I created a subscription with copydata option that corresponds to
a publication that includes several tables, I got the following log
messages.

[7019] LOG: starting logical replication worker for subscription "hoge_sub"
[7047] LOG: logical replication apply for subscription hoge_sub started
[7047] LOG: starting logical replication worker for subscription "hoge_sub"
[7049] LOG: logical replication sync for subscription hoge_sub, table
pgbench_accounts started
[7047] LOG: starting logical replication worker for subscription "hoge_sub"
[7051] LOG: logical replication sync for subscription hoge_sub, table
pgbench_branches started
[7049] LOG: logical replication synchronization worker finished processing
[7051] LOG: logical replication synchronization worker finished processing
[7047] LOG: starting logical replication worker for subscription "hoge_sub"
[7047] LOG: starting logical replication worker for subscription "hoge_sub"
[7056] LOG: logical replication sync for subscription hoge_sub, table
pgbench_history started
[7057] LOG: logical replication sync for subscription hoge_sub, table
pgbench_tellers started
[7056] LOG: logical replication synchronization worker finished processing
[7057] LOG: logical replication synchronization worker finished processing

PID 7019 is a logical replication launcher, PID 7047 is a apply worker
and other processes are table sync worker. I set
max_sync_workers_per_subscription = 2.

I got same log messages 'starting logical replication worker for
subscription' total 5 times but actually 4 of them mean to launch
table sync worker and another one means apply worker. We cannot
distinguish them. Also, I got same log messages 'logical replication
synchronization worker finished processing' total 4 times but I think
it's better to show the table name in finish log message as well. Any
thoughts?

Attached small patch adds relid to these log messages if it's valid.
I'd like to propose it for PG10 if possible, but since It's not a bug
and not an open item we can add it to next CF.

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

Attachment Content-Type Size
log_message_improvement_for_logical_repl.patch application/octet-stream 1.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2017-05-12 04:31:56 Re: UPDATE of partition key
Previous Message Tsunakawa, Takayuki 2017-05-12 04:28:50 [bug fix] PG10: libpq doesn't connect to alternative hosts when some errors occur