Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1md3tu-0008Tg-OT for pgsql-hackers@arkaria.postgresql.org; Wed, 20 Oct 2021 05:12:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1md3tt-0002Qy-Hb for pgsql-hackers@arkaria.postgresql.org; Wed, 20 Oct 2021 05:12:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1md3tt-0002Qp-98 for pgsql-hackers@lists.postgresql.org; Wed, 20 Oct 2021 05:12:29 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1md3tp-0003Eu-OW for pgsql-hackers@postgresql.org; Wed, 20 Oct 2021 05:12:28 +0000 Received: from [192.168.0.6] (42-147-217-92.rev.home.ne.jp [42.147.217.92]) by oss.nttdata.com (Postfix) with ESMTPSA id DDB7D603BE for ; Wed, 20 Oct 2021 14:12:20 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.3 at oss.nttdata.com To: PostgreSQL-development From: Masahiro Ikeda Subject: LogicalChanges* and LogicalSubxact* wait events are never reported Message-ID: Date: Wed, 20 Oct 2021 14:12:20 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------B0230434EBF9A9B4BF52863F" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------B0230434EBF9A9B4BF52863F Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Hi, When I read the documents and source code of wait evens, I found that the following wait events are never reported. * LogicalChangesRead: Waiting for a read from a logical changes file. * LogicalChangesWrite: Waiting for a write to a logical changes file. * LogicalSubxactRead: Waiting for a read from a logical subxact file. * LogicalSubxactWrite: Waiting for a write to a logical subxact file. The wait events are introduced in the following patch. Add support for streaming to built-in logical replication. Amit Kapila on 2020/9/3 11:24:07 464824323e57dc4b397e8b05854d779908b55304 I read the above discussion and found the wait events were reported at first. But they seemed to be removed because they are not necessary because BufFileWrite/BufFileRead are enough([1]). If my understanding is right, it's better to remove them since they make users confused. Please see the attached patch. I confirmed that to make check-world passes all tests. [1] https://www.postgresql.org/message-id/CAA4eK1JV37jXUT5LeWzkBDNNnSntwQbLUZAj6m82QMiR1ZuuHQ%40mail.gmail.com Regards, -- Masahiro Ikeda NTT DATA CORPORATION --------------B0230434EBF9A9B4BF52863F Content-Type: text/x-patch; charset=UTF-8; name="v1_remove_unreported_wait_events.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="v1_remove_unreported_wait_events.patch" diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml index 7355835202..3173ec2566 100644 --- a/doc/src/sgml/monitoring.sgml +++ b/doc/src/sgml/monitoring.sgml @@ -1549,22 +1549,6 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser WALWrite Waiting for a write to a WAL file. - - LogicalChangesRead - Waiting for a read from a logical changes file. - - - LogicalChangesWrite - Waiting for a write to a logical changes file. - - - LogicalSubxactRead - Waiting for a read from a logical subxact file. - - - LogicalSubxactWrite - Waiting for a write to a logical subxact file. - diff --git a/src/backend/utils/activity/wait_event.c b/src/backend/utils/activity/wait_event.c index ef7e6bfb77..4a5b7502f5 100644 --- a/src/backend/utils/activity/wait_event.c +++ b/src/backend/utils/activity/wait_event.c @@ -717,18 +717,6 @@ pgstat_get_wait_io(WaitEventIO w) case WAIT_EVENT_WAL_WRITE: event_name = "WALWrite"; break; - case WAIT_EVENT_LOGICAL_CHANGES_READ: - event_name = "LogicalChangesRead"; - break; - case WAIT_EVENT_LOGICAL_CHANGES_WRITE: - event_name = "LogicalChangesWrite"; - break; - case WAIT_EVENT_LOGICAL_SUBXACT_READ: - event_name = "LogicalSubxactRead"; - break; - case WAIT_EVENT_LOGICAL_SUBXACT_WRITE: - event_name = "LogicalSubxactWrite"; - break; /* no default case, so that compiler will warn */ } diff --git a/src/include/utils/wait_event.h b/src/include/utils/wait_event.h index 6007827b44..c22142365f 100644 --- a/src/include/utils/wait_event.h +++ b/src/include/utils/wait_event.h @@ -221,11 +221,7 @@ typedef enum WAIT_EVENT_WAL_READ, WAIT_EVENT_WAL_SYNC, WAIT_EVENT_WAL_SYNC_METHOD_ASSIGN, - WAIT_EVENT_WAL_WRITE, - WAIT_EVENT_LOGICAL_CHANGES_READ, - WAIT_EVENT_LOGICAL_CHANGES_WRITE, - WAIT_EVENT_LOGICAL_SUBXACT_READ, - WAIT_EVENT_LOGICAL_SUBXACT_WRITE + WAIT_EVENT_WAL_WRITE } WaitEventIO; --------------B0230434EBF9A9B4BF52863F--