diff options
author | Robert Haas <rhaas@postgresql.org> | 2019-12-19 14:56:20 -0500 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2019-12-19 14:56:20 -0500 |
commit | 16a4e4aecd47da7a6c4e1ebc20f6dd1a13f9133b (patch) | |
tree | 598ee1c089f080fde4bcb2e0707bb342fb934aa6 /src/backend/postmaster/pgstat.c | |
parent | 9f83468b3536caf6fb7fe8f9dcdbb108a98d1257 (diff) |
Extend the ProcSignal mechanism to support barriers.
A new function EmitProcSignalBarrier() can be used to emit a global
barrier which all backends that participate in the ProcSignal
mechanism must absorb, and a new function WaitForProcSignalBarrier()
can be used to wait until all relevant backends have in fact
absorbed the barrier.
This can be used to coordinate global state changes, such as turning
checksums on while the system is running.
There's no real client of this mechanism yet, although two are
proposed, but an enum has to have at least one element, so this
includes a placeholder type (PROCSIGNAL_BARRIER_PLACEHOLDER) which
should be replaced by the first real client of this mechanism to
get committed.
Andres Freund and Robert Haas, reviewed by Daniel Gustafsson and,
in earlier versions, by Magnus Hagander.
Discussion: http://postgr.es/m/CA+TgmoZwDk=BguVDVa+qdA6SBKef=PKbaKDQALTC_9qoz1mJqg@mail.gmail.com
Diffstat (limited to 'src/backend/postmaster/pgstat.c')
-rw-r--r-- | src/backend/postmaster/pgstat.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c index e9315122033..7410b2ff5e9 100644 --- a/src/backend/postmaster/pgstat.c +++ b/src/backend/postmaster/pgstat.c @@ -3988,6 +3988,9 @@ pgstat_get_wait_io(WaitEventIO w) case WAIT_EVENT_LOGICAL_REWRITE_WRITE: event_name = "LogicalRewriteWrite"; break; + case WAIT_EVENT_PROC_SIGNAL_BARRIER: + event_name = "ProcSignalBarrier"; + break; case WAIT_EVENT_RELATION_MAP_READ: event_name = "RelationMapRead"; break; |