pgsql: Reset 'ps' display just once when resolving VXID conflicts.

Started by Robert Haasover 15 years ago5 messageshackers
Jump to latest
#1Robert Haas
robertmhaas@gmail.com

Reset 'ps' display just once when resolving VXID conflicts.

This prevents the word "waiting" from briefly disappearing from the ps
status line when ResolveRecoveryConflictWithVirtualXIDs begins a new
iteration of the outer loop.

Along the way, remove some useless pgstat_report_waiting() calls;
the startup process doesn't appear in pg_stat_activity.

Fujii Masao

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=611fed371227f430e71d0ff7fed037f1006b410d

Modified Files
--------------
src/backend/storage/ipc/standby.c | 30 +++++++++++++-----------------
1 files changed, 13 insertions(+), 17 deletions(-)

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Robert Haas (#1)
Re: pgsql: Reset 'ps' display just once when resolving VXID conflicts.

Robert Haas <rhaas@postgresql.org> writes:

Reset 'ps' display just once when resolving VXID conflicts.
This prevents the word "waiting" from briefly disappearing from the ps
status line when ResolveRecoveryConflictWithVirtualXIDs begins a new
iteration of the outer loop.

I imagine the reason for the original coding was to avoid a useless
gettimeofday kernel call in the common case that there are no
conflicting xacts to wait for. Could we restore that behavior?

regards, tom lane

#3Robert Haas
robertmhaas@gmail.com
In reply to: Tom Lane (#2)
Re: [COMMITTERS] pgsql: Reset 'ps' display just once when resolving VXID conflicts.

On Fri, Dec 17, 2010 at 9:52 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Robert Haas <rhaas@postgresql.org> writes:

Reset 'ps' display just once when resolving VXID conflicts.
This prevents the word "waiting" from briefly disappearing from the ps
status line when ResolveRecoveryConflictWithVirtualXIDs begins a new
iteration of the outer loop.

I imagine the reason for the original coding was to avoid a useless
gettimeofday kernel call in the common case that there are no
conflicting xacts to wait for.  Could we restore that behavior?

Something like the attached?

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

Attachments:

resolve-recovery-conflict-tweak.patchapplication/octet-stream; name=resolve-recovery-conflict-tweak.patchDownload+8-2
#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Robert Haas (#3)
Re: [COMMITTERS] pgsql: Reset 'ps' display just once when resolving VXID conflicts.

Robert Haas <robertmhaas@gmail.com> writes:

On Fri, Dec 17, 2010 at 9:52 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

I imagine the reason for the original coding was to avoid a useless
gettimeofday kernel call in the common case that there are no
conflicting xacts to wait for. �Could we restore that behavior?

Something like the attached?

I would just add the return-at-the-top. Changing the loop logic is
not necessary --- the loop test is cheap.

regards, tom lane

#5Robert Haas
robertmhaas@gmail.com
In reply to: Tom Lane (#4)
Re: [COMMITTERS] pgsql: Reset 'ps' display just once when resolving VXID conflicts.

On Fri, Dec 17, 2010 at 11:20 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Robert Haas <robertmhaas@gmail.com> writes:

On Fri, Dec 17, 2010 at 9:52 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

I imagine the reason for the original coding was to avoid a useless
gettimeofday kernel call in the common case that there are no
conflicting xacts to wait for.  Could we restore that behavior?

Something like the attached?

I would just add the return-at-the-top.  Changing the loop logic is
not necessary --- the loop test is cheap.

Hmm... that's a fine bit of hairsplitting, but OK.

Done that way, then.

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