1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-14 18:42:34 +03:00

Temporarily make pg_ctl and server shutdown a whole lot chattier.

This is a quick hack, due to be reverted when its purpose has been served,
to try to gather information about why some of the buildfarm critters
regularly fail with "postmaster does not shut down" complaints.  Maybe they
are just really overloaded, but maybe something else is going on.  Hence,
instrument pg_ctl to print the current time when it starts waiting for
postmaster shutdown and when it gives up, and add a lot of logging of the
current time in the server's checkpoint and shutdown code paths.

No attempt has been made to make this pretty.  I'm not even totally sure
if it will build on Windows, but we'll soon find out.
This commit is contained in:
Tom Lane
2016-02-08 18:43:11 -05:00
parent 0231f83856
commit 3971f64843
7 changed files with 125 additions and 8 deletions

View File

@ -1691,6 +1691,10 @@ BufferSync(int flags)
UnlockBufHdr(bufHdr);
}
elog(IsPostmasterEnvironment ? LOG : NOTICE,
"BufferSync(%x) beginning to write %d buffers at %s",
flags, num_to_write, current_time_as_str());
if (num_to_write == 0)
return; /* nothing to do */
@ -1745,6 +1749,11 @@ BufferSync(int flags)
if (num_written >= num_to_write)
break;
if ((num_written % 1024) == 0)
elog(IsPostmasterEnvironment ? LOG : NOTICE,
"BufferSync(%x) wrote %d/%d buffers at %s",
flags, num_written, num_to_write, current_time_as_str());
/*
* Sleep to throttle our I/O rate.
*/
@ -1756,6 +1765,10 @@ BufferSync(int flags)
buf_id = 0;
}
elog(IsPostmasterEnvironment ? LOG : NOTICE,
"BufferSync(%x) done, wrote %d/%d buffers at %s",
flags, num_written, num_to_write, current_time_as_str());
/*
* Update checkpoint statistics. As noted above, this doesn't include
* buffers written by other backends or bgwriter scan.