/* * __wt_checkpoint_server_create -- * Configure and start the checkpoint server. */ int __wt_checkpoint_server_create(WT_SESSION_IMPL *session, const char *cfg[]) { WT_CONNECTION_IMPL *conn; bool start; conn = S2C(session); start = false; /* * Stop any server that is already running. This means that each time * reconfigure is called we'll bounce the server even if there are no * configuration changes. This makes our life easier as the underlying * configuration routine doesn't have to worry about freeing objects * in the connection structure (it's guaranteed to always start with a * blank slate), and we don't have to worry about races where a running * server is reading configuration information that we're updating, and * it's not expected that reconfiguration will happen a lot. */ if (conn->ckpt_session != NULL) WT_RET(__wt_checkpoint_server_destroy(session)); WT_RET(__ckpt_server_config(session, cfg, &start)); if (start) WT_RET(__ckpt_server_start(conn)); return (0); }
/* * __wt_checkpoint_create -- * Start the checkpoint server thread. */ int __wt_checkpoint_create(WT_CONNECTION_IMPL *conn, const char *cfg[]) { WT_SESSION_IMPL *session; int run; session = conn->default_session; /* Handle configuration. */ WT_RET(__ckpt_server_config(session, cfg, &run)); /* If not configured, we're done. */ if (!run) return (0); /* The checkpoint server gets its own session. */ WT_RET(__wt_open_session(conn, 1, NULL, NULL, &conn->ckpt_session)); conn->ckpt_session->name = "checkpoint-server"; WT_RET( __wt_cond_alloc(session, "checkpoint server", 0, &conn->ckpt_cond)); /* * Start the thread. */ WT_RET(__wt_thread_create( session, &conn->ckpt_tid, __ckpt_server, conn->ckpt_session)); conn->ckpt_tid_set = 1; return (0); }
/* * __wt_checkpoint_server_create -- * Configure and start the checkpoint server. */ int __wt_checkpoint_server_create(WT_CONNECTION_IMPL *conn, const char *cfg[]) { 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); }
/* * __wt_checkpoint_server_create -- * Configure and start the checkpoint server. */ int __wt_checkpoint_server_create(WT_SESSION_IMPL *session, const char *cfg[]) { WT_CONNECTION_IMPL *conn; bool start; conn = S2C(session); start = false; /* If there is already a server running, shut it down. */ if (conn->ckpt_session != NULL) WT_RET(__wt_checkpoint_server_destroy(session)); WT_RET(__ckpt_server_config(session, cfg, &start)); if (start) WT_RET(__ckpt_server_start(conn)); return (0); }