Skip to content

Commit

Permalink
WT-2219 Revert a change to not sweep when in-memory is configured.
Browse files Browse the repository at this point in the history
We need to sweep, or dropped tables won't be cleaned up.
  • Loading branch information
agorrod committed Nov 16, 2015
1 parent 0347b94 commit 2ecf22b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 25 deletions.
3 changes: 2 additions & 1 deletion src/conn/conn_api.c
Expand Up @@ -1054,7 +1054,7 @@ __conn_reconfigure(WT_CONNECTION *wt_conn, const char *config)
WT_ERR(__wt_logmgr_reconfig(session, cfg));
WT_ERR(__wt_lsm_manager_reconfig(session, cfg));
WT_ERR(__wt_statlog_create(session, cfg));
WT_ERR(__wt_sweep_config(session, cfg, NULL));
WT_ERR(__wt_sweep_config(session, cfg));
WT_ERR(__wt_verbose_config(session, cfg));

/* Third, merge everything together, creating a new connection state. */
Expand Down Expand Up @@ -2000,6 +2000,7 @@ wiredtiger_open(const char *home, WT_EVENT_HANDLER *event_handler,

WT_ERR(__conn_statistics_config(session, cfg));
WT_ERR(__wt_lsm_manager_config(session, cfg));
WT_ERR(__wt_sweep_config(session, cfg));
WT_ERR(__wt_verbose_config(session, cfg));

/* Now that we know if verbose is configured, output the version. */
Expand Down
2 changes: 1 addition & 1 deletion src/conn/conn_open.c
Expand Up @@ -268,7 +268,7 @@ __wt_connection_workers(WT_SESSION_IMPL *session, const char *cfg[])
WT_RET(__wt_evict_create(session));

/* Start the handle sweep thread. */
WT_RET(__wt_sweep_create(session, cfg));
WT_RET(__wt_sweep_create(session));

/* Start the optional async threads. */
WT_RET(__wt_async_create(session, cfg));
Expand Down
32 changes: 11 additions & 21 deletions src/conn/conn_sweep.c
Expand Up @@ -322,31 +322,27 @@ err: WT_PANIC_MSG(session, ret, "handle sweep server error");
* Pull out sweep configuration settings
*/
int
__wt_sweep_config(WT_SESSION_IMPL *session, const char *cfg[], bool *startp)
__wt_sweep_config(WT_SESSION_IMPL *session, const char *cfg[])
{
WT_CONFIG_ITEM cval;
WT_CONNECTION_IMPL *conn;

conn = S2C(session);

/*
* Sweeping file handles isn't useful if configured in-memory; because
* the default is to configure sweep, turn it off if running in-memory.
*/
WT_RET(__wt_config_gets(session, cfg, "in_memory", &cval));
if (cval.val != 0) {
if (startp != NULL)
*startp = false;
return (0);
}
if (startp != NULL)
*startp = true;

/* Pull out the sweep configurations. */
WT_RET(__wt_config_gets(session,
cfg, "file_manager.close_idle_time", &cval));
conn->sweep_idle_time = (time_t)cval.val;

/* Non-zero sweep idle time is incompatible with in-memory */
if (conn->sweep_idle_time != 0) {
WT_RET(__wt_config_gets(session, cfg, "in_memory", &cval));
if (cval.val != 0)
WT_RET_MSG(session, EINVAL,
"In memory configuration incompatible with "
"non zero file_manager=(close_idle_time)");
}

WT_RET(__wt_config_gets(session,
cfg, "file_manager.close_scan_interval", &cval));
conn->sweep_interval = (time_t)cval.val;
Expand All @@ -363,19 +359,13 @@ __wt_sweep_config(WT_SESSION_IMPL *session, const char *cfg[], bool *startp)
* Start the handle sweep thread.
*/
int
__wt_sweep_create(WT_SESSION_IMPL *session, const char *cfg[])
__wt_sweep_create(WT_SESSION_IMPL *session)
{
WT_CONNECTION_IMPL *conn;
uint32_t session_flags;
bool start;

conn = S2C(session);

/* Configure the handle sweep thread. */
WT_RET(__wt_sweep_config(session, cfg, &start));
if (!start)
return (0);

/* Set first, the thread might run before we finish up. */
F_SET(conn, WT_CONN_SERVER_SWEEP);

Expand Down
4 changes: 2 additions & 2 deletions src/include/extern.h
Expand Up @@ -261,8 +261,8 @@ extern void __wt_conn_stat_init(WT_SESSION_IMPL *session);
extern int __wt_statlog_log_one(WT_SESSION_IMPL *session);
extern int __wt_statlog_create(WT_SESSION_IMPL *session, const char *cfg[]);
extern int __wt_statlog_destroy(WT_SESSION_IMPL *session, bool is_close);
extern int __wt_sweep_config(WT_SESSION_IMPL *session, const char *cfg[], bool *startp);
extern int __wt_sweep_create(WT_SESSION_IMPL *session, const char *cfg[]);
extern int __wt_sweep_config(WT_SESSION_IMPL *session, const char *cfg[]);
extern int __wt_sweep_create(WT_SESSION_IMPL *session);
extern int __wt_sweep_destroy(WT_SESSION_IMPL *session);
extern int __wt_curbackup_open(WT_SESSION_IMPL *session, const char *uri, const char *cfg[], WT_CURSOR **cursorp);
extern int __wt_backup_file_remove(WT_SESSION_IMPL *session);
Expand Down

0 comments on commit 2ecf22b

Please sign in to comment.