aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/async.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2023-11-27 17:42:39 +0200
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2023-11-27 17:42:39 +0200
commit1f395354d8742d57c166104874114b6e0d01e104 (patch)
tree6a607b78be1c7e7b6dc812f1dba2a355110eef6a /src/backend/commands/async.c
parent360392fa2a9bb74338b4864790d18eadb13fd8a8 (diff)
downloadpostgresql-1f395354d8742d57c166104874114b6e0d01e104.tar.gz
postgresql-1f395354d8742d57c166104874114b6e0d01e104.zip
Reduce rate of walwriter wakeups due to async commits.
XLogSetAsyncXactLSN(), called at asynchronous commit, would wake up walwriter every time the LSN advances, but walwriter doesn't actually do anything unless it has at least 'wal_writer_flush_after' full blocks of WAL to write. Repeatedly waking up walwriter to do nothing is a waste of CPU cycles in both walwriter and the backends doing the wakeups. To fix, apply the same logic in XLogSetAsyncXactLSN() to decide whether to wake up walwriter, as walwriter uses to determine if it has any work to do. In the passing, rename misleadingly named 'flushbytes' local variable to 'flushblocks'. Author: Andres Freund, Heikki Linnakangas Discussion: https://www.postgresql.org/message-id/20231024230929.vsc342baqs7kmbte@awork3.anarazel.de
Diffstat (limited to 'src/backend/commands/async.c')
0 files changed, 0 insertions, 0 deletions