summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gorrod <alexander.gorrod@mongodb.com>2015-05-14 14:15:42 +1000
committerAlex Gorrod <alexander.gorrod@mongodb.com>2015-05-14 14:15:42 +1000
commit0425896e0b1ec36c6b1a3d2997e2739a5c89ec5f (patch)
tree1751677b0bfc4326761f8eaa1700752621c53ebc
parente4016f07f57af920568e07963b1aa2fa6197f00d (diff)
parentdf453dca130ed76a953cff0c42a8ecbabdd5fc76 (diff)
downloadmongo-0425896e0b1ec36c6b1a3d2997e2739a5c89ec5f.tar.gz
Merge pull request #1969 from wiredtiger/fsync-before-validate
Add an fsync before verifying tables
-rw-r--r--src/txn/txn_ckpt.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/txn/txn_ckpt.c b/src/txn/txn_ckpt.c
index 2728dec3c2c..60c427c56b6 100644
--- a/src/txn/txn_ckpt.c
+++ b/src/txn/txn_ckpt.c
@@ -1008,8 +1008,16 @@ fake: /*
* will update the turtle file and swap the new one into place. We
* need to make sure the metadata is on disk before the turtle file is
* updated.
+ *
+ * If we are doing a checkpoint in a file without a transaction (e.g.,
+ * closing a dirty tree before an exclusive operation like verify),
+ * the metadata update will be auto-committed. In that case, we need to
+ * sync the file here or we could roll forward the metadata in
+ * recovery and open a checkpoint that isn't yet durable.
*/
- if (F_ISSET(conn, WT_CONN_CKPT_SYNC) && WT_IS_METADATA(dhandle))
+ if (F_ISSET(conn, WT_CONN_CKPT_SYNC) &&
+ (WT_IS_METADATA(dhandle) ||
+ !F_ISSET(&session->txn, WT_TXN_RUNNING)))
WT_ERR(__wt_checkpoint_sync(session, NULL));
WT_ERR(__wt_meta_ckptlist_set(