Navigation Menu

Skip to content

Commit

Permalink
Revert "SERVER-18838 flush WT metadata during create/drop so we don't…
Browse files Browse the repository at this point in the history
… see missing files after a crash."

This reverts commit 5c4878f.
  • Loading branch information
michaelcahill committed Jun 25, 2015
1 parent 8f7da9a commit 01e822b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 33 deletions.
1 change: 0 additions & 1 deletion src/include/extern.h
Expand Up @@ -423,7 +423,6 @@ extern int __wt_ext_metadata_update(WT_EXTENSION_API *wt_api, WT_SESSION *wt_ses
extern int __wt_metadata_get_ckptlist( WT_SESSION *session, const char *name, WT_CKPT **ckptbasep);
extern void __wt_metadata_free_ckptlist(WT_SESSION *session, WT_CKPT *ckptbase);
extern int __wt_metadata_open(WT_SESSION_IMPL *session);
extern int __wt_metadata_sync(WT_SESSION_IMPL *session);
extern int __wt_metadata_cursor( WT_SESSION_IMPL *session, const char *config, WT_CURSOR **cursorp);
extern int __wt_metadata_insert( WT_SESSION_IMPL *session, const char *key, const char *value);
extern int __wt_metadata_update( WT_SESSION_IMPL *session, const char *key, const char *value);
Expand Down
28 changes: 0 additions & 28 deletions src/meta/meta_table.c
Expand Up @@ -49,34 +49,6 @@ __wt_metadata_open(WT_SESSION_IMPL *session)
return (__wt_session_release_btree(session));
}

/*
* __wt_metadata_sync --
* Make the metadata durable, either by flushing the log or by
* checkpointing the metadata.
*/
int
__wt_metadata_sync(WT_SESSION_IMPL *session)
{
WT_DECL_RET;

/* If we're logging, make sure the metadata update was flushed. */
if (FLD_ISSET(S2C(session)->log_flags, WT_CONN_LOG_ENABLED)) {
if (!FLD_ISSET(S2C(session)->txn_logsync,
WT_LOG_DSYNC | WT_LOG_FSYNC))
WT_WITH_DHANDLE(session, session->meta_dhandle,
ret = __wt_txn_checkpoint_log(session,
0, WT_TXN_LOG_CKPT_SYNC, NULL));
} else {
WT_WITH_DHANDLE(session, session->meta_dhandle,
ret = __wt_checkpoint(session, NULL));
WT_RET(ret);
WT_WITH_DHANDLE(session, session->meta_dhandle,
ret = __wt_checkpoint_sync(session, NULL));
}

return (ret);
}

/*
* __wt_metadata_cursor --
* Opens a cursor on the metadata.
Expand Down
15 changes: 14 additions & 1 deletion src/meta/meta_track.c
Expand Up @@ -255,7 +255,20 @@ __wt_meta_track_off(WT_SESSION_IMPL *session, int need_sync, int unroll)
if (unroll || ret != 0 || !need_sync || session->meta_dhandle == NULL)
return (ret);

WT_TRET(__wt_metadata_sync(session));
/* If we're logging, make sure the metadata update was flushed. */
if (FLD_ISSET(S2C(session)->log_flags, WT_CONN_LOG_ENABLED)) {
if (!FLD_ISSET(S2C(session)->txn_logsync,
WT_LOG_DSYNC | WT_LOG_FSYNC))
WT_WITH_DHANDLE(session, session->meta_dhandle,
ret = __wt_txn_checkpoint_log(session,
0, WT_TXN_LOG_CKPT_SYNC, NULL));
} else {
WT_WITH_DHANDLE(session, session->meta_dhandle,
ret = __wt_checkpoint(session, NULL));
WT_RET(ret);
WT_WITH_DHANDLE(session, session->meta_dhandle,
ret = __wt_checkpoint_sync(session, NULL));
}

return (ret);
}
Expand Down
3 changes: 0 additions & 3 deletions src/schema/schema_drop.c
Expand Up @@ -38,9 +38,6 @@ __drop_file(
if (!remove_files)
return (ret);

/* Make sure the metadata is flushed before removing the file. */
WT_TRET(__wt_metadata_sync(session));

/*
* Remove the underlying physical file. There is no point tracking this
* operation: there is no going back from here.
Expand Down

0 comments on commit 01e822b

Please sign in to comment.