Speedup pg_ctl stop,start,restart by reducing 1 sec sleep.
Speedup pg_ctl stop,start,restart by reducing 1 sec sleep.

This is cherry-pcik of upstream commit c61559ec3a41ad72a13c18d95b1eee8251de94c6.
---------------------
Reduce pg_ctl's reaction time when waiting for postmaster start/stop.

pg_ctl has traditionally waited one second between probes for whether
the start or stop request has completed.  That behavior was embodied
in the original shell script written in 1999 (commit 5b912b089) and
I doubt anyone's questioned it since.  Nowadays, machines are a lot
faster, and the shell script is long since replaced by C code, so it's
fair to reconsider how long we ought to wait.

This patch adjusts the coding so that the wait time can be any even
divisor of 1 second, and sets the actual probe rate to 10 per second.
That's based on experimentation with the src/test/recovery TAP tests,
which include a lot of postmaster starts and stops.  This patch alone
reduces the (non-parallelized) runtime of those tests from ~4m30s to
~3m5s on my machine.  Increasing the probe rate further doesn't help
much, so this seems like a good number.

In the real world this probably won't have much impact, since people
don't start/stop production postmasters often, and the shutdown checkpoint
usually takes nontrivial time too.  But it makes development work and
testing noticeably snappier, and that's good enough reason for me.

Also, by reducing the dead time in postmaster restart sequences, this
change has made it easier to reproduce some bugs that have been lurking
for awhile.  Patches for those will follow.

Discussion: e3c85fb1504743fc149298e066f7c995cf561418@sss.pgh.pa.us
---------------------

lisakowen/gpdb,lisakowen/gpdb,jmcatamney/gpdb,adam8157/gpdb,50wu/gpdb,50wu/gpdb,greenplum-db/gpdb,xinzweb/gpdb,50wu/gpdb,xinzweb/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,adam8157/gpdb,jmcatamney/gpdb,adam8157/gpdb,50wu/gpdb,greenplum-db/gpdb,50wu/gpdb,lisakowen/gpdb,jmcatamney/gpdb,xinzweb/gpdb,greenplum-db/gpdb,xinzweb/gpdb,50wu/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,xinzweb/gpdb,50wu/gpdb,ashwinstar/gpdb,ashwinstar/gpdb,ashwinstar/gpdb,ashwinstar/gpdb,adam8157/gpdb,xinzweb/gpdb,lisakowen/gpdb,xinzweb/gpdb,xinzweb/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,jmcatamney/gpdb,adam8157/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,50wu/gpdb,lisakowen/gpdb,adam8157/gpdb,adam8157/gpdb,adam8157/gpdb,jmcatamney/gpdb,lisakowen/gpdb,ashwinstar/gpdb,lisakowen/gpdb,lisakowen/gpdb,greenplum-db/gpdb