Обсуждение: pgsql: Extend framework from commit 53be0b1ad to report latch waits.

Поиск
Список
Период
Сортировка

pgsql: Extend framework from commit 53be0b1ad to report latch waits.

От
Robert Haas
Дата:
Extend framework from commit 53be0b1ad to report latch waits.

WaitLatch, WaitLatchOrSocket, and WaitEventSetWait now taken an
additional wait_event_info parameter; legal values are defined in
pgstat.h.  This makes it possible to uniquely identify every point in
the core code where we are waiting for a latch; extensions can pass
WAIT_EXTENSION.

Because latches were the major wait primitive not previously covered
by this patch, it is now possible to see information in
pg_stat_activity on a large number of important wait events not
previously addressed, such as ClientRead, ClientWrite, and SyncRep.

Unfortunately, many of the wait events added by this patch will fail
to appear in pg_stat_activity because they're only used in background
processes which don't currently appear in pg_stat_activity.  We should
fix this either by creating a separate view for such information, or
else by deciding to include them in pg_stat_activity after all.

Michael Paquier and Robert Haas, reviewed by Alexander Korotkov and
Thomas Munro.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/6f3bd98ebfc008cbd676da777bb0b2376c4c4bfa

Modified Files
--------------
contrib/postgres_fdw/connection.c     |   3 +-
doc/src/sgml/monitoring.sgml          | 169 ++++++++++++++++++++++++
src/backend/access/transam/parallel.c |   4 +-
src/backend/access/transam/xlog.c     |   7 +-
src/backend/executor/nodeGather.c     |   3 +-
src/backend/libpq/be-secure-openssl.c |   4 +-
src/backend/libpq/be-secure.c         |   7 +-
src/backend/libpq/pqmq.c              |   4 +-
src/backend/postmaster/autovacuum.c   |   3 +-
src/backend/postmaster/bgworker.c     |   7 +-
src/backend/postmaster/bgwriter.c     |   5 +-
src/backend/postmaster/checkpointer.c |   3 +-
src/backend/postmaster/pgarch.c       |   3 +-
src/backend/postmaster/pgstat.c       | 236 ++++++++++++++++++++++++++++++++--
src/backend/postmaster/syslogger.c    |   4 +-
src/backend/postmaster/walwriter.c    |   3 +-
src/backend/replication/basebackup.c  |   3 +-
src/backend/replication/syncrep.c     |   4 +-
src/backend/replication/walreceiver.c |   7 +-
src/backend/replication/walsender.c   |   9 +-
src/backend/storage/buffer/bufmgr.c   |   7 +-
src/backend/storage/ipc/latch.c       |  18 ++-
src/backend/storage/ipc/shm_mq.c      |   7 +-
src/backend/storage/ipc/standby.c     |   5 +-
src/backend/storage/lmgr/lock.c       |   3 -
src/backend/storage/lmgr/lwlock.c     |   6 +-
src/backend/storage/lmgr/predicate.c  |   3 +-
src/backend/storage/lmgr/proc.c       |   8 +-
src/backend/utils/adt/misc.c          |   4 +-
src/include/pgstat.h                  |  99 ++++++++++++--
src/include/storage/latch.h           |   9 +-
src/include/storage/lwlock.h          |   2 +-
src/include/storage/proc.h            |   2 +-
src/test/modules/test_shm_mq/setup.c  |   3 +-
src/test/modules/test_shm_mq/test.c   |   3 +-
35 files changed, 584 insertions(+), 83 deletions(-)


Re: pgsql: Extend framework from commit 53be0b1ad to report latch waits.

От
Tom Lane
Дата:
Robert Haas <rhaas@postgresql.org> writes:
> Extend framework from commit 53be0b1ad to report latch waits.

Buildfarm doesn't like this one bit.

            regards, tom lane


Re: pgsql: Extend framework from commit 53be0b1ad to report latch waits.

От
Robert Haas
Дата:
On Tue, Oct 4, 2016 at 11:12 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <rhaas@postgresql.org> writes:
>> Extend framework from commit 53be0b1ad to report latch waits.
>
> Buildfarm doesn't like this one bit.

Hmm, and for good reason.  But I swear I ran 'make check-world' before
pushing.  Argh.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: pgsql: Extend framework from commit 53be0b1ad to report latch waits.

От
Robert Haas
Дата:
On Tue, Oct 4, 2016 at 11:17 AM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Tue, Oct 4, 2016 at 11:12 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Robert Haas <rhaas@postgresql.org> writes:
>>> Extend framework from commit 53be0b1ad to report latch waits.
>>
>> Buildfarm doesn't like this one bit.
>
> Hmm, and for good reason.  But I swear I ran 'make check-world' before
> pushing.  Argh.

Apparently, 'make world' does not build worker_spi.  I thought 'make
world' was supposed to build everything?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: pgsql: Extend framework from commit 53be0b1ad to report latch waits.

От
Amit Kapila
Дата:
On Tue, Oct 4, 2016 at 8:32 PM, Robert Haas <rhaas@postgresql.org> wrote:
> Extend framework from commit 53be0b1ad to report latch waits.
>

I am facing windows below compilation error:

1>pgstat.h(726): warning C4005: 'WAIT_TIMEOUT' : macro redefinition
1>c:\Program Files (x86)\Microsoft
SDKs\Windows\v7.0A\include\winerror.h(1797) : see previous definition
of 'WAIT_TIMEOUT'

It seems windows already have a define for WAIT_TIMEOUT.  Do we want
to rename it to WAIT_TIMEEXPIRED or WAIT_EXPIRETIME?

--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com


Re: pgsql: Extend framework from commit 53be0b1ad to report latch waits.

От
Amit Kapila
Дата:
On Wed, Oct 5, 2016 at 5:53 PM, Amit Kapila <amit.kapila16@gmail.com> wrote:
> On Tue, Oct 4, 2016 at 8:32 PM, Robert Haas <rhaas@postgresql.org> wrote:
>> Extend framework from commit 53be0b1ad to report latch waits.
>>
>
> I am facing windows below compilation error:
>
> 1>pgstat.h(726): warning C4005: 'WAIT_TIMEOUT' : macro redefinition
> 1>c:\Program Files (x86)\Microsoft
> SDKs\Windows\v7.0A\include\winerror.h(1797) : see previous definition
> of 'WAIT_TIMEOUT'
>
> It seems windows already have a define for WAIT_TIMEOUT.  Do we want
> to rename it to WAIT_TIMEEXPIRED or WAIT_EXPIRETIME?
>

Recent commit d2ce38e204583bc444eebffd800d492cf56e3b38 should fix this problem.



--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com