About to add WAL write/fsync statistics to pg_stat_wal view

2020-12-07 Thread Masahiro Ikeda
` What do you think? Please let me know your comments. Regards -- Masahiro Ikeda NTT DATA CORPORATIONdiff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 8cd3d690..ba923a2b 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -7388,6 +7388,27 @@ COPY postgres_

Re: About to add WAL write/fsync statistics to pg_stat_wal view

2020-12-08 Thread Masahiro Ikeda
On 2020-12-08 16:45, Li Japin wrote: Hi, On Dec 8, 2020, at 1:06 PM, Masahiro Ikeda wrote: Hi, I propose to add wal write/fsync statistics to pg_stat_wal view. It's useful not only for developing/improving source code related to WAL but also for users to detect workload change

Re: Add statistics to pg_stat_wal view for wal related parameter tuning

2020-12-21 Thread Masahiro Ikeda
obal. - AdvanceXLInsertBuffer() does WalStats.m_wal_buffers_full, but as far as I can tell there's nothing actually sending that? IIUC, when pgstat_send_wal() is called by backends and so on, it is sent to the statistic collector and it is exposed via pg_stat_wal view. Regards, -- Masahiro Ikeda NTT DATA CORPORATION

Re: About to add WAL write/fsync statistics to pg_stat_wal view

2020-12-25 Thread Masahiro Ikeda
Hi, I rebased the patch to the master branch. Regards, -- Masahiro Ikeda NTT DATA CORPORATIONdiff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 4b60382778..45d54cd394 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -7388,6 +7388,27 @@ COPY

Re: Add session statistics to pg_stat_database

2020-12-25 Thread Masahiro Ikeda
t;Sent by the backend" right? Although this is a trivial thing, the following row has too many tabs. Other structs have only one space. // }Pgstat_MsgConn; Regards, -- Masahiro Ikeda NTT DATA CORPORATION

Re: Add session statistics to pg_stat_database

2021-01-07 Thread Masahiro Ikeda
On 2021-01-08 00:47, Laurenz Albe wrote: On Fri, 2020-12-25 at 20:28 +0900, Masahiro Ikeda wrote: As a user, I want this feature to know whether clients' session activities are as expected. I have some comments about the patch. Thanks you for the thorough review! Thanks for updatin

Re: Add session statistics to pg_stat_database

2021-01-08 Thread Masahiro Ikeda
On 2021-01-08 18:34, Laurenz Albe wrote: On Fri, 2021-01-08 at 12:00 +0900, Masahiro Ikeda wrote: 2. monitoring.sgml > > IIUC, "active_time" includes the time executes a fast-path function > > and > > "idle in transaction" includes "idle in tr

Re: About to add WAL write/fsync statistics to pg_stat_wal view

2021-02-14 Thread Masahiro Ikeda
On 2021-02-08 13:01, Fujii Masao wrote: On 2021/02/05 8:45, Masahiro Ikeda wrote: I pgindented the patches. Thanks for updating the patches! Thanks for checking the patches. + XLogWrite, which nomally called by an + issue_xlog_fsync, which nomally called by an Typo

Re: About to add WAL write/fsync statistics to pg_stat_wal view

2021-02-14 Thread Masahiro Ikeda
On 2021-02-08 14:26, Fujii Masao wrote: On 2021/02/08 13:01, Fujii Masao wrote: On 2021/02/05 8:45, Masahiro Ikeda wrote: I pgindented the patches. Thanks for updating the patches! +   XLogWrite, which nomally called by an +   issue_xlog_fsync, which nomally called by an Typo

Re: About to add WAL write/fsync statistics to pg_stat_wal view

2021-02-14 Thread Masahiro Ikeda
On 2021-02-10 00:51, David G. Johnston wrote: On Thu, Feb 4, 2021 at 4:45 PM Masahiro Ikeda wrote: I pgindented the patches. ... XLogWrite, which is invoked during an XLogFlush request (see ...). This is also incremented by the WAL receiver during replication. ("which normally c

Re: About to add WAL write/fsync statistics to pg_stat_wal view

2021-03-02 Thread Masahiro Ikeda
On 2021-02-24 16:14, Fujii Masao wrote: On 2021/02/15 11:59, Masahiro Ikeda wrote: On 2021-02-10 00:51, David G. Johnston wrote: On Thu, Feb 4, 2021 at 4:45 PM Masahiro Ikeda wrote: I pgindented the patches. ... XLogWrite, which is invoked during an XLogFlush request (see ...).  This is

Re: About to add WAL write/fsync statistics to pg_stat_wal view

2021-03-03 Thread Masahiro Ikeda
On 2021-03-03 16:30, Fujii Masao wrote: On 2021/03/03 14:33, Masahiro Ikeda wrote: On 2021-02-24 16:14, Fujii Masao wrote: On 2021/02/15 11:59, Masahiro Ikeda wrote: On 2021-02-10 00:51, David G. Johnston wrote: On Thu, Feb 4, 2021 at 4:45 PM Masahiro Ikeda wrote: I pgindented the patches

Re: About to add WAL write/fsync statistics to pg_stat_wal view

2021-03-03 Thread Masahiro Ikeda
On 2021-03-03 20:27, Masahiro Ikeda wrote: On 2021-03-03 16:30, Fujii Masao wrote: On 2021/03/03 14:33, Masahiro Ikeda wrote: On 2021-02-24 16:14, Fujii Masao wrote: On 2021/02/15 11:59, Masahiro Ikeda wrote: On 2021-02-10 00:51, David G. Johnston wrote: On Thu, Feb 4, 2021 at 4:45 PM

Re: About to add WAL write/fsync statistics to pg_stat_wal view

2021-03-04 Thread Masahiro Ikeda
On 2021-03-05 01:02, Fujii Masao wrote: On 2021/03/04 16:14, Masahiro Ikeda wrote: On 2021-03-03 20:27, Masahiro Ikeda wrote: On 2021-03-03 16:30, Fujii Masao wrote: On 2021/03/03 14:33, Masahiro Ikeda wrote: On 2021-02-24 16:14, Fujii Masao wrote: On 2021/02/15 11:59, Masahiro Ikeda wrote

Re: About to add WAL write/fsync statistics to pg_stat_wal view

2021-03-05 Thread Masahiro Ikeda
On 2021-03-05 12:47, Fujii Masao wrote: On 2021/03/05 8:38, Masahiro Ikeda wrote: On 2021-03-05 01:02, Fujii Masao wrote: On 2021/03/04 16:14, Masahiro Ikeda wrote: On 2021-03-03 20:27, Masahiro Ikeda wrote: On 2021-03-03 16:30, Fujii Masao wrote: On 2021/03/03 14:33, Masahiro Ikeda wrote

Re: About to add WAL write/fsync statistics to pg_stat_wal view

2021-03-08 Thread Masahiro Ikeda
On 2021-03-08 13:44, Fujii Masao wrote: On 2021/03/05 19:54, Masahiro Ikeda wrote: On 2021-03-05 12:47, Fujii Masao wrote: On 2021/03/05 8:38, Masahiro Ikeda wrote: On 2021-03-05 01:02, Fujii Masao wrote: On 2021/03/04 16:14, Masahiro Ikeda wrote: On 2021-03-03 20:27, Masahiro Ikeda wrote

Re: About to add WAL write/fsync statistics to pg_stat_wal view

2021-03-09 Thread Masahiro Ikeda
On 2021-03-09 17:51, Fujii Masao wrote: On 2021/03/05 8:38, Masahiro Ikeda wrote: On 2021-03-05 01:02, Fujii Masao wrote: On 2021/03/04 16:14, Masahiro Ikeda wrote: On 2021-03-03 20:27, Masahiro Ikeda wrote: On 2021-03-03 16:30, Fujii Masao wrote: On 2021/03/03 14:33, Masahiro Ikeda wrote

Re: About to add WAL write/fsync statistics to pg_stat_wal view

2021-03-10 Thread Masahiro Ikeda
On 2021-03-10 17:08, Fujii Masao wrote: On 2021/03/10 14:11, Masahiro Ikeda wrote: On 2021-03-09 17:51, Fujii Masao wrote: On 2021/03/05 8:38, Masahiro Ikeda wrote: On 2021-03-05 01:02, Fujii Masao wrote: On 2021/03/04 16:14, Masahiro Ikeda wrote: On 2021-03-03 20:27, Masahiro Ikeda wrote

Re: About to add WAL write/fsync statistics to pg_stat_wal view

2021-03-11 Thread Masahiro Ikeda
On 2021-03-11 11:52, Fujii Masao wrote: On 2021/03/11 9:38, Masahiro Ikeda wrote: On 2021-03-10 17:08, Fujii Masao wrote: On 2021/03/10 14:11, Masahiro Ikeda wrote: On 2021-03-09 17:51, Fujii Masao wrote: On 2021/03/05 8:38, Masahiro Ikeda wrote: On 2021-03-05 01:02, Fujii Masao wrote: On

Re: About to add WAL write/fsync statistics to pg_stat_wal view

2021-03-14 Thread Masahiro Ikeda
On 2021-03-12 12:39, Fujii Masao wrote: On 2021/03/11 21:29, Masahiro Ikeda wrote: In addition, I rebased the patch for WAL receiver. (v17-0003-Makes-the-wal-receiver-report-WAL-statistics.patch) Thanks! Will review this later. Thanks a lot! I read through the 0003 patch. Here are some

Re: About to add WAL write/fsync statistics to pg_stat_wal view

2021-03-14 Thread Masahiro Ikeda
On 2021/03/11 21:29, Masahiro Ikeda wrote: On 2021-03-11 11:52, Fujii Masao wrote: On 2021/03/11 9:38, Masahiro Ikeda wrote: On 2021-03-10 17:08, Fujii Masao wrote: IIUC the stats collector basically exits after checkpointer and walwriter exit. But there seems no guarantee that the stats

make the stats collector shutdown without writing the statsfiles if the immediate shutdown is requested.

2021-03-15 Thread Masahiro Ikeda
ss.nttdata.com [2] https://www.postgresql.org/message-id/flat/0A3221C70F24FB45833433255569204D1F5EF25A%40G01JPEXMBYT05 Regards, -- Masahiro Ikeda NTT DATA CORPORATIONdiff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c index b1e2d94951..03d191dfe6 100644 --- a/src/backend/postmaster/p

RE: make the stats collector shutdown without writing the statsfiles if the immediate shutdown is requested.

2021-03-16 Thread Masahiro Ikeda
comments might be removed. How do you think? Hi, Kuroda-san. Thanks for your comments. I agreed that your idea. I combined them into one function and moved the comments to the calling function side. (v2-0001-pgstat_avoid_writing_on_sigquit.patch) Regards, -- Masahiro Ikeda NTT DATA CORPORATIONdiff

Re: make the stats collector shutdown without writing the statsfiles if the immediate shutdown is requested.

2021-03-16 Thread Masahiro Ikeda
le \"%s\"", statfile); unlink(statfile) } ``` I fixed it in the same way instead of checking the return value because IIUC, it's unimportant if an error has occurred. The log shows that just to try removing it. Though? Regards, -- Masahiro Ikeda NTT DATA CORPORA

Re: Add statistics to pg_stat_wal view for wal related parameter tuning

2020-10-29 Thread Masahiro Ikeda
Hi, Thanks for your comments and advice. I updated the patch. On 2020-10-21 18:03, Kyotaro Horiguchi wrote: At Tue, 20 Oct 2020 16:11:29 +0900, Masahiro Ikeda wrote in On 2020-10-20 12:46, Amit Kapila wrote: > I see that we also need to add extra code to capture these stats (some > of

Re: Add statistics to pg_stat_wal view for wal related parameter tuning

2020-11-05 Thread Masahiro Ikeda
On 2020-10-30 11:50, Fujii Masao wrote: On 2020/10/29 17:03, Masahiro Ikeda wrote: Hi, Thanks for your comments and advice. I updated the patch. On 2020-10-21 18:03, Kyotaro Horiguchi wrote: At Tue, 20 Oct 2020 16:11:29 +0900, Masahiro Ikeda wrote in On 2020-10-20 12:46, Amit Kapila wrote

Re: Add statistics to pg_stat_wal view for wal related parameter tuning

2020-11-15 Thread Masahiro Ikeda
On 2020-11-12 16:27, Fujii Masao wrote: On 2020/11/12 14:58, Fujii Masao wrote: On 2020/11/06 10:25, Masahiro Ikeda wrote: On 2020-10-30 11:50, Fujii Masao wrote: On 2020/10/29 17:03, Masahiro Ikeda wrote: Hi, Thanks for your comments and advice. I updated the patch. On 2020-10-21 18:03

Re: Add statistics to pg_stat_wal view for wal related parameter tuning

2020-11-15 Thread Masahiro Ikeda
On 2020-11-12 14:58, Fujii Masao wrote: On 2020/11/06 10:25, Masahiro Ikeda wrote: On 2020-10-30 11:50, Fujii Masao wrote: On 2020/10/29 17:03, Masahiro Ikeda wrote: Hi, Thanks for your comments and advice. I updated the patch. On 2020-10-21 18:03, Kyotaro Horiguchi wrote: At Tue, 20 Oct

Re: Add statistics to pg_stat_wal view for wal related parameter tuning

2020-11-16 Thread Masahiro Ikeda
o use "wal_buffers_full" and how to tune parameters. I thought the reason which wal buffer has no space is important for users to tune the wal_buffers parameter. How about the following comments? 'Total number of times WAL data was written to the disk because WAL buffers got

Re: Add statistics to pg_stat_wal view for wal related parameter tuning

2020-11-18 Thread Masahiro Ikeda
On 2020-11-17 11:46, Fujii Masao wrote: On 2020/11/16 16:35, Masahiro Ikeda wrote: On 2020-11-12 14:58, Fujii Masao wrote: On 2020/11/06 10:25, Masahiro Ikeda wrote: On 2020-10-30 11:50, Fujii Masao wrote: On 2020/10/29 17:03, Masahiro Ikeda wrote: Hi, Thanks for your comments and advice

Re: Add statistics to pg_stat_wal view for wal related parameter tuning

2020-11-19 Thread Masahiro Ikeda
ther page. OK, I will change the above sentence since there are some sentences like "space occupied by", "disk blocks occupied", and so on in the documents. Do we need to change the column name from "wal_buffers_full" to another name like "wal_buffers_all_occupied"? Regards -- Masahiro Ikeda NTT DATA CORPORATION

Re: Add statistics to pg_stat_wal view for wal related parameter tuning

2020-11-25 Thread Masahiro Ikeda
On 2020-11-25 20:19, Fujii Masao wrote: On 2020/11/19 16:31, Masahiro Ikeda wrote: On 2020-11-17 11:46, Fujii Masao wrote: On 2020/11/16 16:35, Masahiro Ikeda wrote: On 2020-11-12 14:58, Fujii Masao wrote: On 2020/11/06 10:25, Masahiro Ikeda wrote: On 2020-10-30 11:50, Fujii Masao wrote

configurable the threshold for warning due to run out of transaction ID

2021-01-18 Thread Masahiro Ikeda
way. I would like to know your opinion. If it's useful for us, I'll make patches. Regards, -- Masahiro Ikeda NTT DATA CORPORATION

Re: pg_stat_statements oddity with track = all

2021-01-19 Thread Masahiro Ikeda
patch uses the only exec_nested_level to check whether a query is top-level or not. The reason is nested_level is less useful and I agree. But, pg_stat_kcache uses plan_nested_level too. Although the check result is the same, it's better to change it corresponding to this patch after it's committed. Regards, -- Masahiro Ikeda NTT DATA CORPORATION

Re: Add statistics to pg_stat_wal view for wal related parameter tuning

2021-01-19 Thread Masahiro Ikeda
On 2020-12-22 11:16, Masahiro Ikeda wrote: Thanks for your comments. On 2020-12-22 09:39, Andres Freund wrote: Hi, On 2020-12-21 13:16:50 -0800, Andres Freund wrote: On 2020-12-02 13:52:43 +0900, Fujii Masao wrote: > Pushed. Thanks! Why are wal_records/fpi long, instead of uin

Re: pg_stat_statements oddity with track = all

2021-01-20 Thread Masahiro Ikeda
On 2021-01-20 18:14, Julien Rouhaud wrote: On Tue, Jan 19, 2021 at 4:55 PM Masahiro Ikeda wrote: I tested the "update" command can work. postgres=# ALTER EXTENSION pg_stat_statements UPDATE TO '1.10'; Although the "toplevel" column of all queries which already

RE: About to add WAL write/fsync statistics to pg_stat_wal view

2021-01-22 Thread Masahiro Ikeda
hat the performance impact may be bigger in standby servers because WALReceiver didn't use wal buffers, it's no need to be considered. I agreed that if track_wal_io_timing is turned on, the primary server's performance degradation occurs too. I will make rebased and modif

Re: About to add WAL write/fsync statistics to pg_stat_wal view

2021-01-22 Thread Masahiro Ikeda
On 2021-01-22 14:50, Masahiko Sawada wrote: On Fri, Dec 25, 2020 at 6:46 PM Masahiro Ikeda wrote: Hi, I rebased the patch to the master branch. Thank you for working on this. I've read the latest patch. Here are comments: --- + if (track_wal_io_t

Re: About to add WAL write/fsync statistics to pg_stat_wal view

2021-01-24 Thread Masahiro Ikeda
. Regards, -- Masahiro Ikeda NTT DATA CORPORATIONFrom ee1b7d17391b9d9619f709afeacdd118973471d6 Mon Sep 17 00:00:00 2001 From: Masahiro Ikeda Date: Fri, 22 Jan 2021 21:38:31 +0900 Subject: [PATCH] Add statistics related to write/sync wal records. This patch adds following statistics to pg_stat_wal vie

RE: About to add WAL write/fsync statistics to pg_stat_wal view

2021-01-24 Thread Masahiro Ikeda
r of xxx", "Total amount of time that xxx" and "Total time spent xxx". Since the "time" is used for showing spending time, not count, I'll change it to "Total number of WAL data written/synced to disk". Thought? Regards, -- Masahiro Ikeda NTT DATA CORPORATION

Re: About to add WAL write/fsync statistics to pg_stat_wal view

2021-01-24 Thread Masahiro Ikeda
On 2021-01-25 10:36, Masahiko Sawada wrote: On Fri, Jan 22, 2021 at 10:05 PM Masahiro Ikeda wrote: On 2021-01-22 14:50, Masahiko Sawada wrote: > On Fri, Dec 25, 2020 at 6:46 PM Masahiro Ikeda > wrote: >> >> Hi, >> >> I rebased the patch to the master branch. >

Re: About to add WAL write/fsync statistics to pg_stat_wal view

2021-01-24 Thread Masahiro Ikeda
On 2021-01-25 11:47, japin wrote: On Mon, 25 Jan 2021 at 09:36, Masahiko Sawada wrote: On Fri, Jan 22, 2021 at 10:05 PM Masahiro Ikeda wrote: On 2021-01-22 14:50, Masahiko Sawada wrote: > On Fri, Dec 25, 2020 at 6:46 PM Masahiro Ikeda > wrote: >> >> Hi, >> >&

Re: About to add WAL write/fsync statistics to pg_stat_wal view

2021-01-24 Thread Masahiro Ikeda
On 2021-01-25 13:15, Masahiro Ikeda wrote: On 2021-01-25 10:36, Masahiko Sawada wrote: On Fri, Jan 22, 2021 at 10:05 PM Masahiro Ikeda wrote: On 2021-01-22 14:50, Masahiko Sawada wrote: > On Fri, Dec 25, 2020 at 6:46 PM Masahiro Ikeda > wrote: >> >> Hi, >> >&

Re: About to add WAL write/fsync statistics to pg_stat_wal view

2021-01-24 Thread Masahiro Ikeda
ot; argument to the pgstat_send_wal function. If "force" is false, it can skip reporting until at least 500 msec since it last reported. WalReceiverMain() almost calls pgstat_send_wal() with "force" as false. Regards, -- Masahiro Ikeda NTT DATA CORPORATION--- v5-0001-Add-statis

Re: About to add WAL write/fsync statistics to pg_stat_wal view

2021-01-25 Thread Masahiro Ikeda
On 2021-01-26 00:03, Masahiko Sawada wrote: On Mon, Jan 25, 2021 at 4:51 PM Masahiro Ikeda wrote: Hi, thanks for the reviews. I updated the attached patch. Thank you for updating the patch! The summary of the changes is following. 1. fix document I followed another view's comments

Re: About to add WAL write/fsync statistics to pg_stat_wal view

2021-01-25 Thread Masahiro Ikeda
Hi, David. Thanks for your comments. On 2021-01-26 08:48, David G. Johnston wrote: On Mon, Jan 25, 2021 at 8:03 AM Masahiko Sawada wrote: On Mon, Jan 25, 2021 at 4:51 PM Masahiro Ikeda wrote: Hi, thanks for the reviews. I updated the attached patch. Thank you for updating the patch

Re: About to add WAL write/fsync statistics to pg_stat_wal view

2021-01-29 Thread Masahiro Ikeda
On 2021-01-27 00:14, David G. Johnston wrote: On Mon, Jan 25, 2021 at 11:56 PM Masahiro Ikeda wrote: (wal_write) The number of times WAL buffers were written out to disk via XLogWrite Thanks. I thought it's better to omit "The" and "XLogWrite" because other view

Re: About to add WAL write/fsync statistics to pg_stat_wal view

2021-02-04 Thread Masahiro Ikeda
I pgindented the patches. Regards -- Masahiro Ikeda NTT DATA CORPORATIONFrom 47f436d7e423ece33a25adebf4265eac02e575f3 Mon Sep 17 00:00:00 2001 From: Masahiro Ikeda Date: Fri, 29 Jan 2021 16:41:34 +0900 Subject: [PATCH 1/2] Add statistics related to write/sync wal records. This patch adds

Re: make the stats collector shutdown without writing the statsfiles if the immediate shutdown is requested.

2021-03-18 Thread Masahiro Ikeda
nged to the SignalPgstatHandlerForNonCrashExit() to add FreeWaitEventSet() in the handler for the stats collector. Regards, -- Masahiro Ikeda NTT DATA CORPORATIONdiff --git a/src/backend/postmaster/interrupt.c b/src/backend/postmaster/interrupt.c index dd9136a942..2cc5a39ec

Re: make the stats collector shutdown without writing the statsfiles if the immediate shutdown is requested.

2021-03-19 Thread Masahiro Ikeda
ed in all postmaster children by InitializeLatchSupport(). Those wishing to disconnect from it should call ShutdownLatchSupport(). ``` Regards, -- Masahiro Ikeda NTT DATA CORPORATION

Re: make the stats collector shutdown without writing the statsfiles if the immediate shutdown is requested.

2021-03-22 Thread Masahiro Ikeda
On 2021/03/22 23:59, Fujii Masao wrote: > > > On 2021/03/20 13:40, Masahiro Ikeda wrote: >> Sorry, there is no evidence we should call it. >> I thought that to call FreeWaitEventSet() is a manner after using >> CreateWaitEventSet() and the performance impact to call

Re: make the stats collector shutdown without writing the statsfiles if the immediate shutdown is requested.

2021-03-22 Thread Masahiro Ikeda
On 2021/03/23 11:40, Fujii Masao wrote: > > > On 2021/03/23 9:05, Masahiro Ikeda wrote: >> Yes. I attached the v5 patch based on v3 patch. >> I renamed SignalHandlerForUnsafeExit() and fixed the following comment. > > Thanks for updating the patch! > > When

Re: make the stats collector shutdown without writing the statsfiles if the immediate shutdown is requested.

2021-03-24 Thread Masahiro Ikeda
rrupted, just recreate it. [1] https://github.com/anarazel/postgres/compare/master...shmstat-before-split-2021-03-22 Regards, -- Masahiro Ikeda NTT DATA CORPORATION

Re: make the stats collector shutdown without writing the statsfiles if the immediate shutdown is requested.

2021-03-24 Thread Masahiro Ikeda
dating the patch! I checked your patch and I don't have any comments. Regards, -- Masahiro Ikeda NTT DATA CORPORATION

Re: wal stats questions

2021-03-24 Thread Masahiro Ikeda
ing of your comment is right.) You mean that we need to expend a clock check in pgstat_report_wal()? I think it's unnecessary because pgstat_report_stat() is already checked it. > Generally the various patches seems to to have a lot of the boilerplate > style comments (like "Prepare and send the message"), but very little in > the way of explaining the design. Sorry for that. I'll be careful. Regards, -- Masahiro Ikeda NTT DATA CORPORATION

Re: About to add WAL write/fsync statistics to pg_stat_wal view

2021-03-24 Thread Masahiro Ikeda
s better because to collect stats in shared memory is very useful feature for users and it make a big change in design. So, I think it's beneficial to make an effort to move the shared memory stats thread forward (by reviewing or testing) instead of handling the issues in this thread. [1] https

Re: make the stats collector shutdown without writing the statsfiles if the immediate shutdown is requested.

2021-03-25 Thread Masahiro Ikeda
wn case (and other cases too?), HandleChildCrash() is never invoked due to the exit of pgstat. My understanding of Andres-san's comment is that is it ok to show like the following log message? ``` LOG: statistics collector process (PID 64991) exited with exit code 1 ``` Surely, other processes don't output the log like it. So, I agree to suppress the log message. FWIW, in immediate shutdown case, since pmdie() sets "pmState" variable to "PM_WAIT_BACKENDS", pgstat_start() won't be invoked. Regards, -- Masahiro Ikeda NTT DATA CORPORATION

Re: make the stats collector shutdown without writing the statsfiles if the immediate shutdown is requested.

2021-03-25 Thread Masahiro Ikeda
On 2021/03/25 19:48, Fujii Masao wrote: > > > On 2021/03/25 9:31, Masahiro Ikeda wrote: >> >> >> On 2021/03/24 18:36, Fujii Masao wrote: >>> >>> >>> On 2021/03/24 3:51, Andres Freund wrote: >>>> Hi, >>>> >>

Re: wal stats questions

2021-03-26 Thread Masahiro Ikeda
ut if you already know the function which leads the following case, please let me know. > Maybe there is the case where a backend generates no WAL records, > but just writes them because it needs to do write-ahead-logging > when flush the table data? > Ugh! I was missing a very la

Re: make the stats collector shutdown without writing the statsfiles if the immediate shutdown is requested.

2021-03-26 Thread Masahiro Ikeda
On 2021/03/26 9:54, Fujii Masao wrote: > On 2021/03/26 9:25, Masahiro Ikeda wrote: >> On 2021/03/25 21:23, Fujii Masao wrote: >>> On 2021/03/25 9:58, Andres Freund wrote: >>>> Also, won't this lead to postmaster now starting to complain about >>>>

Re: wal stats questions

2021-03-29 Thread Masahiro Ikeda
I update the patch since there were my misunderstanding points. On 2021/03/26 16:20, Masahiro Ikeda wrote: > Thanks for many your suggestions! > I made the patch to handle the issues. > >> 1) What is the motivation to have both prevWalUsage and pgWalUsage, >>instead of

Re: make the stats collector shutdown without writing the statsfiles if the immediate shutdown is requested.

2021-03-29 Thread Masahiro Ikeda
On 2021/03/27 2:14, Andres Freund wrote: > Hi, > > On 2021-03-26 09:27:19 +0900, Masahiro Ikeda wrote: >> On 2021/03/25 19:48, Fujii Masao wrote: >>> Yes. So we should wait for the shared memory stats patch to be >>> committed before working on walreceiver stat

Re: wal stats questions

2021-03-30 Thread Masahiro Ikeda
On 2021/03/30 17:28, Kyotaro Horiguchi wrote: > At Tue, 30 Mar 2021 09:41:24 +0900, Masahiro Ikeda > wrote in >> I update the patch since there were my misunderstanding points. >> >> On 2021/03/26 16:20, Masahiro Ikeda wrote: >>> Thanks for many your suggestion

Re: Why reset pgstat during recovery

2021-04-05 Thread Masahiro Ikeda
erated as a one-time snapshot. This means that the stats counters saved at last may not be valid for the specific point in time. FWIW, there was a related discussion([1]) although the behavior is not changed yet. [1] https://www.postgresql.org/message-id/1416.1479760254%40sss.pgh.pa.us Regards, --

Re: Display individual query in pg_stat_activity

2020-08-17 Thread Masahiro Ikeda
e queries, and users want to know the progress of query execution, doesn't it? -- Masahiro Ikeda NTT DATA CORPORATION

New statistics for tuning WAL buffer size

2020-08-18 Thread Masahiro Ikeda
ink? If we can have a consensus, I will make a PoC patch. Regards, -- Masahiro Ikeda NTT DATA CORPORATION

RE: New statistics for tuning WAL buffer size

2020-08-18 Thread Masahiro Ikeda
On 2020-08-18 16:35, tsunakawa.ta...@fujitsu.com wrote: From: Masahiro Ikeda It's important to provide the metrics for tuning the size of WAL buffers. For now, it's lack of the statistics how often processes wait to write WAL because WAL buffer is full. If those situation are ofte

RE: New statistics for tuning WAL buffer size

2020-08-18 Thread Masahiro Ikeda
On 2020-08-19 13:49, tsunakawa.ta...@fujitsu.com wrote: From: Masahiro Ikeda If my understanding is correct, we have to measure the performance impact first. Do you know HariBabu is now trying to solve it? If not, I will try to modify patches to apply HEAD. No, he's not doing it an

Re: New statistics for tuning WAL buffer size

2020-08-24 Thread Masahiro Ikeda
Is it enough as a first step? Regards, -- Masahiro Ikeda NTT DATA CORPORATIONdiff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml index 7dcddf478a..d49e539da3 100644 --- a/doc/src/sgml/monitoring.sgml +++ b/doc/src/sgml/monitoring.sgml @@ -424,6 +424,14 @@ postgres 27093 0.0

Re: New statistics for tuning WAL buffer size

2020-08-24 Thread Masahiro Ikeda
On 2020-08-24 20:45, Masahiro Ikeda wrote: Hi, thanks for useful comments. I agree to expose the number of WAL write caused by full of WAL buffers. It's helpful when tuning wal_buffers size. Haribabu separated that number into two fields in his patch; one is the number of WAL wri

Re: Display individual query in pg_stat_activity

2020-08-28 Thread Masahiro Ikeda
On 2020-08-19 14:48, Drouvot, Bertrand wrote: Hi, On 8/18/20 9:35 AM, Pavel Stehule wrote: Hi út 18. 8. 2020 v 8:54 odesílatel Masahiro Ikeda napsal: Hi, I've attached a patch to display individual query in the pg_stat_activity query field when multiple SQL statements are curr

Re: Transactions involving multiple postgres foreign servers, take 2

2020-08-28 Thread Masahiro Ikeda
On 2020-07-17 15:55, Masahiko Sawada wrote: On Fri, 17 Jul 2020 at 11:06, Masahiro Ikeda wrote: On 2020-07-16 13:16, Masahiko Sawada wrote: On Tue, 14 Jul 2020 at 17:24, Masahiro Ikeda wrote: I've attached the latest version patches. I've incorporated the review comments I

Re: New statistics for tuning WAL buffer size

2020-09-02 Thread Masahiro Ikeda
s not security restricted now, so ordinary users can access it. I has the same security level as pg_stat_archiver.If you have any comments, please let me know. Regards, -- Masahiro Ikeda NTT DATA CORPORATIONdiff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml index d973

Re: Transactions involving multiple postgres foreign servers, take 2

2020-09-06 Thread Masahiro Ikeda
On 2020-09-03 23:08, Masahiko Sawada wrote: On Fri, 28 Aug 2020 at 17:50, Masahiro Ikeda wrote: > I think there is a case we can't check orphaned foreign > prepared transaction in pg_foreign_xacts view on the new standby > server. > It confuses users and database administr

Re: New statistics for tuning WAL buffer size

2020-09-06 Thread Masahiro Ikeda
Thanks for the review and advice! On 2020-09-03 16:05, Fujii Masao wrote: On 2020/09/02 18:56, Masahiro Ikeda wrote: +/* -- + * Backend types + * -- You seem to forget to add "*/" into the above comment. This issue could cause the following compiler warning. ../../s

Re: New statistics for tuning WAL buffer size

2020-09-08 Thread Masahiro Ikeda
On 2020-09-07 16:19, Fujii Masao wrote: On 2020/09/07 9:58, Masahiro Ikeda wrote: Thanks for the review and advice! On 2020-09-03 16:05, Fujii Masao wrote: On 2020/09/02 18:56, Masahiro Ikeda wrote: +/* -- + * Backend types + * -- You seem to forget to add "*/"

LogicalChanges* and LogicalSubxact* wait events are never reported

2021-10-19 Thread Masahiro Ikeda
e 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 diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring

Re: LogicalChanges* and LogicalSubxact* wait events are never reported

2021-10-20 Thread Masahiro Ikeda
On 2021/10/20 18:17, Amit Kapila wrote: > On Wed, Oct 20, 2021 at 10:50 AM Michael Paquier wrote: >> >> On Wed, Oct 20, 2021 at 02:12:20PM +0900, Masahiro Ikeda wrote: >>> If my understanding is right, it's better to remove them since they make >>> users c

Re: LogicalChanges* and LogicalSubxact* wait events are never reported

2021-10-21 Thread Masahiro Ikeda
On 2021/10/21 17:40, Amit Kapila wrote: > On Wed, Oct 20, 2021 at 3:46 PM Masahiro Ikeda > wrote: >> >> On 2021/10/20 18:17, Amit Kapila wrote: >>> On Wed, Oct 20, 2021 at 10:50 AM Michael Paquier >>> wrote: >>>> >>>> On Wed, Oct

Re: Rethink the wait event names for postgres_fdw, dblink and etc

2023-10-05 Thread Masahiro Ikeda
of dblink were wrong for DblinkGetConnect: the wait event could be seen in other functions than dblink() and dblink_exec(). Thanks for modifying and committing. I agree your comments. Regards, -- Masahiro Ikeda NTT DATA CORPORATION

Re: wal stats questions

2021-04-15 Thread Masahiro Ikeda
On 2021/04/13 9:33, Fujii Masao wrote: > > > On 2021/03/30 20:37, Masahiro Ikeda wrote: >> OK, I added the condition to the fast-return check. I noticed that I >> misunderstood that the purpose is to avoid expanding a clock check using WAL >> stats counters. But,

Re: wal stats questions

2021-04-21 Thread Masahiro Ikeda
On 2021/04/21 15:08, torikoshia wrote: > On 2021-04-16 10:27, Masahiro Ikeda wrote: >> On 2021/04/13 9:33, Fujii Masao wrote: >>> >>> >>> On 2021/03/30 20:37, Masahiro Ikeda wrote: >>>> OK, I added the condition to the fast-return check. I notice

Re: wal stats questions

2021-04-22 Thread Masahiro Ikeda
 On 2021/04/23 0:36, Andres Freund wrote: > Hi > > On Thu, Apr 22, 2021, at 06:42, Fujii Masao wrote: >> On 2021/04/21 18:31, Masahiro Ikeda wrote: >>>> BTW, is it better to change PgStat_Counter from int64 to uint64 because> >>>> there aren't

Re: wal stats questions

2021-04-25 Thread Masahiro Ikeda
On 2021/04/23 16:30, Fujii Masao wrote: > > > On 2021/04/23 10:25, Andres Freund wrote: >> Hi, >> >> On 2021-04-23 09:26:17 +0900, Masahiro Ikeda wrote: >>> On 2021/04/23 0:36, Andres Freund wrote: >>>> On Thu, Apr 22, 2021, at 06:42, Fujii

Re: Transactions involving multiple postgres foreign servers, take 2

2021-04-26 Thread Masahiro Ikeda
lving and removing per each entry. I think it's better since this is simpler than A. If I'm missing something, please let me know. Regards, -- Masahiro Ikeda NTT DATA CORPORATION

Re: wal stats questions

2021-04-27 Thread Masahiro Ikeda
On 2021/04/27 21:56, Fujii Masao wrote: > > > On 2021/04/26 10:11, Masahiro Ikeda wrote: >> >> First patch has only the changes for pg_stat_wal view. >> ("v6-0001-performance-improvements-of-reporting-wal-stats-without-introducing-a-new-variable.patch") &g

Re: wal stats questions

2021-05-11 Thread Masahiro Ikeda
On 2021/05/11 16:44, Fujii Masao wrote: > > > On 2021/04/28 9:10, Masahiro Ikeda wrote: >> >> >> On 2021/04/27 21:56, Fujii Masao wrote: >>> >>> >>> On 2021/04/26 10:11, Masahiro Ikeda wrote: >>>> >>>> Fir

Re: wal stats questions

2021-05-12 Thread Masahiro Ikeda
On 2021/05/12 19:19, Fujii Masao wrote: > > > On 2021/05/11 18:46, Masahiro Ikeda wrote: >> >> >> On 2021/05/11 16:44, Fujii Masao wrote: >>> >>> >>> On 2021/04/28 9:10, Masahiro Ikeda wrote: >>>> >>>> >>>&g

Re: wal stats questions

2021-05-17 Thread Masahiro Ikeda
er may write/sync the WAL although it doesn't > > You use both 'wal' and 'WAL' in the comments, but are there any intension? No, I changed to use 'WAL' only. Although some other comments have 'wal' and 'WAL', it seems that 'WAL' is

Re: wal stats questions

2021-05-17 Thread Masahiro Ikeda
On 2021/05/17 22:34, Fujii Masao wrote: > > > On 2021/05/17 16:39, Masahiro Ikeda wrote: >> >> Thanks for your comments! >> >>>> + * is executed, wal records aren't nomally generated (although HOT >>>> makes >>> >>>

Re: wal stats questions

2021-05-19 Thread Masahiro Ikeda
On 2021/05/19 11:40, Fujii Masao wrote: > Thanks for updating the patch! I modified some comments slightly and > pushed that version of the patch. Thanks a lot! Regards, -- Masahiro Ikeda NTT DATA CORPORATION

Re: Transactions involving multiple postgres foreign servers, take 2

2021-05-19 Thread Masahiro Ikeda
on participant/ - s/Foreign transactions involved in the current transaction/Foreign transaction participants involved in the current transaction/ Regards, -- Masahiro Ikeda NTT DATA CORPORATION

Re: Transactions involving multiple postgres foreign servers, take 2

2021-05-20 Thread Masahiro Ikeda
On 2021/05/21 10:39, Masahiko Sawada wrote: > On Thu, May 20, 2021 at 1:26 PM Masahiro Ikeda > wrote: >> >> >> On 2021/05/11 13:37, Masahiko Sawada wrote: >>> I've attached the updated patches that incorporated comments from >>> Zhihong and I

Re: Transactions involving multiple postgres foreign servers, take 2

2021-05-21 Thread Masahiro Ikeda
On 2021/05/21 13:45, Masahiko Sawada wrote: > On Fri, May 21, 2021 at 12:45 PM Masahiro Ikeda > wrote: >> >> >> >> On 2021/05/21 10:39, Masahiko Sawada wrote: >>> On Thu, May 20, 2021 at 1:26 PM Masahiro Ikeda >>> wrote: >>>> >

Re: Transactions involving multiple postgres foreign servers, take 2

2021-06-02 Thread Masahiro Ikeda
On 2021/05/25 21:59, Masahiko Sawada wrote: > On Fri, May 21, 2021 at 5:48 PM Masahiro Ikeda > wrote: >> >> On 2021/05/21 13:45, Masahiko Sawada wrote: >>> >>> Yes. We also might need to be careful about the order of foreign >>> transaction r

Re: Transactions involving multiple postgres foreign servers, take 2

2021-06-24 Thread Masahiro Ikeda
the > upper bound if committing foreign prepared transactions cannot keep > up. Hi Jamison-san, sawada-san, Thanks for testing! FWIF, I tested using pgbench with "--rate=" option to know the server can execute transactions with stable throughput. As sawada-san said, the latest patch resolved second phase of 2PC asynchronously. So, it's difficult to control the stable throughput without "--rate=" option. I also worried what I should do when the error happened because to increase "max_prepared_foreign_transaction" doesn't work. Since too overloading may show the error, is it better to add the case to the HINT message? BTW, if sawada-san already develop to run the resolver processes in parallel, why don't you measure performance improvement? Although Robert-san, Tunakawa-san and so on are discussing what architecture is best, one discussion point is that there is a performance risk if adopting asynchronous approach. If we have promising solutions, I think we can make the discussion forward. In my understanding, there are three improvement idea. First is that to make the resolver processes run in parallel. Second is that to send "COMMIT/ABORT PREPARED" remote servers in bulk. Third is to stop syncing the WAL remove_fdwxact() after resolving is done, which I addressed in the mail sent at June 3rd, 13:56. Since third idea is not yet discussed, there may be my misunderstanding. -- Masahiro Ikeda NTT DATA CORPORATION

Re: Transactions involving multiple postgres foreign servers, take 2

2021-06-24 Thread Masahiro Ikeda
: Distributed PostgreSQL for Data Intensive Applications >From 12:27 says that how to solve unresolved prepared xacts. https://www.youtube.com/watch?v=AlF4C60FdlQ&list=PL3xUNnH4TdbsfndCMn02BqAAgGB0z7cwq Regards, -- Masahiro Ikeda NTT DATA CORPORATION

Re: Transactions involving multiple postgres foreign servers, take 2

2021-07-04 Thread Masahiro Ikeda
On 2021/06/30 10:05, Masahiko Sawada wrote: > On Fri, Jun 25, 2021 at 9:53 AM Masahiro Ikeda > wrote: >> >> Hi Jamison-san, sawada-san, >> >> Thanks for testing! >> >> FWIF, I tested using pgbench with "--rate=" option to know the server &g

Re: Allow escape in application_name

2021-09-05 Thread Masahiro Ikeda
ase the limitation of application_name and make it accept Non-ASCII. As a user, 3) is best for me. But it seems be out of scope this threads, so will you select 1)? Regards, -- Masahiro Ikeda NTT DATA CORPORATION

Re: Allow escape in application_name

2021-09-06 Thread Masahiro Ikeda
te it. How do you think? OK. I agree that (1) is enough for the first step. If I have any time, I'll investigate it too. Regards, -- Masahiro Ikeda NTT DATA CORPORATION

  1   2   3   >