aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/buffer/bufmgr.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2016-02-08 18:43:11 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2016-02-08 18:43:11 -0500
commit3971f64843b02e4a55d854156bd53e46a0588e45 (patch)
tree173c8cb46e8bedec34779f90551852bef47fc2ee /src/backend/storage/buffer/bufmgr.c
parent0231f838565d2921a0960407c4240237ba1d56ae (diff)
downloadpostgresql-3971f64843b02e4a55d854156bd53e46a0588e45.tar.gz
postgresql-3971f64843b02e4a55d854156bd53e46a0588e45.zip
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.
Diffstat (limited to 'src/backend/storage/buffer/bufmgr.c')
-rw-r--r--src/backend/storage/buffer/bufmgr.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c
index 7141eb83c68..3d28946699a 100644
--- a/src/backend/storage/buffer/bufmgr.c
+++ b/src/backend/storage/buffer/bufmgr.c
@@ -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.