diff options
Diffstat (limited to 'src/txn/txn_ckpt.c')
-rw-r--r-- | src/txn/txn_ckpt.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/txn/txn_ckpt.c b/src/txn/txn_ckpt.c index 8e2e55c5424..37ed48e8b96 100644 --- a/src/txn/txn_ckpt.c +++ b/src/txn/txn_ckpt.c @@ -504,11 +504,6 @@ __wt_txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[]) session->meta_dhandle, ret = __wt_checkpoint(session, cfg)); session->meta_track_next = saved_meta_next; WT_ERR(ret); - if (F_ISSET(conn, WT_CONN_CKPT_SYNC)) { - WT_WITH_DHANDLE(session, session->meta_dhandle, - ret = __wt_checkpoint_sync(session, NULL)); - WT_ERR(ret); - } WT_ERR(__checkpoint_verbose_track(session, "metadata sync completed", &verb_timer)); @@ -998,7 +993,16 @@ fake: /* if (fake_ckpt && FLD_ISSET(conn->log_flags, WT_CONN_LOG_ENABLED)) WT_INIT_LSN(&ckptlsn); - /* Update the object's metadata. */ + /* + * Update the object's metadata. + * + * If the object is the metadata, the call to __wt_meta_ckptlist_set + * will update the turtle file. We need to make sure the metadata is + * on disk before the turtle file is changed. + */ + if (F_ISSET(conn, WT_CONN_CKPT_SYNC) && + strcmp(dhandle->name, WT_METAFILE_URI) == 0) + WT_ERR(__wt_checkpoint_sync(session, NULL)); WT_ERR(__wt_meta_ckptlist_set( session, dhandle->name, ckptbase, &ckptlsn)); |