summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gorrod <alexg@wiredtiger.com>2014-05-09 16:26:07 +1000
committerAlex Gorrod <alexg@wiredtiger.com>2014-05-09 16:26:07 +1000
commit727d65dad51ed960a98fbfb1695e183cfa710d31 (patch)
tree044f2c703ecade36d6367322e93ea87f7cdb308f
parentade47b572da1659c95b4d06f297f0d87b0a20d0d (diff)
downloadmongo-727d65dad51ed960a98fbfb1695e183cfa710d31.tar.gz
Update checkpoint server reconfigure to match stat log semantics.
-rw-r--r--src/conn/conn_ckpt.c72
1 files changed, 11 insertions, 61 deletions
diff --git a/src/conn/conn_ckpt.c b/src/conn/conn_ckpt.c
index 984f69ddb34..a466afc5a71 100644
--- a/src/conn/conn_ckpt.c
+++ b/src/conn/conn_ckpt.c
@@ -51,52 +51,6 @@ __ckpt_server_config(WT_SESSION_IMPL *session, const char **cfg, int *startp)
}
/*
- * __ckpt_server_reconfig --
- * Parse checkpoint server options, and update checkpoint server
- * to reflect changes.
- */
-static int
-__ckpt_server_reconfig(WT_SESSION_IMPL *session, const char **cfg, int *stopp)
-{
- WT_CONFIG_ITEM cval;
- WT_CONNECTION_IMPL *conn;
- WT_DECL_ITEM(tmp);
- WT_DECL_RET;
-
- conn = S2C(session);
- *stopp = 0;
-
- /* The checkpoint configuration is disabled by not setting a wait */
- WT_RET(__wt_config_gets(session, cfg, "checkpoint.wait", &cval));
- if (cval.val == 0) {
- *stopp = 1;
- return (0);
- }
- conn->ckpt_usecs = (long)cval.val * 1000000;
-
- /*
- * If the old server had a name, free it. Worst case scenario here
- * is that the checkpoint server is still running and will create
- * a checkpoint with the default name while we are reconfiguring. We
- * could avoid that by locking around reconfigure if we care.
- */
- __wt_free(session, conn->ckpt_config);
- WT_RET(__wt_config_gets(session, cfg, "checkpoint.name", &cval));
-
- if (!WT_STRING_MATCH(WT_CHECKPOINT, cval.str, cval.len)) {
- WT_RET(__wt_scr_alloc(session, cval.len + 20, &tmp));
- strcpy((char *)tmp->data, "name=");
- strncat((char *)tmp->data, cval.str, cval.len);
- ret = __wt_strndup(session,
- tmp->data, strlen("name=") + cval.len, &conn->ckpt_config);
- __wt_scr_free(&tmp);
- WT_RET(ret);
- }
-
- return (0);
-}
-
-/*
* __ckpt_server --
* The checkpoint server thread.
*/
@@ -168,21 +122,17 @@ __ckpt_server_start(WT_CONNECTION_IMPL *conn)
int
__wt_checkpoint_server_create(WT_CONNECTION_IMPL *conn, const char *cfg[])
{
- int start, stop;
-
- start = stop = 0;
- /* Handle configuration. */
- if (conn->ckpt_session == NULL) {
- WT_RET_NOTFOUND_OK(__ckpt_server_config(
- conn->default_session, cfg, &start));
- if (start)
- WT_RET(__ckpt_server_start(conn));
- } else {
- WT_RET_NOTFOUND_OK(__ckpt_server_reconfig(
- conn->default_session, cfg, &stop));
- if (stop)
- WT_RET(__wt_checkpoint_server_destroy(conn));
- }
+ int start;
+
+ start = 0;
+
+ /* If there is already a server running, shut it down. */
+ if (conn->ckpt_session != NULL)
+ WT_RET(__wt_checkpoint_server_destroy(conn));
+
+ WT_RET(__ckpt_server_config(conn->default_session, cfg, &start));
+ if (start)
+ WT_RET(__ckpt_server_start(conn));
return (0);
}