diff options
author | Dan Pasette <dan@10gen.com> | 2015-02-12 07:39:45 -0500 |
---|---|---|
committer | Dan Pasette <dan@mongodb.com> | 2015-02-12 07:39:45 -0500 |
commit | a6c348aa16ee8676026be979fbf0a5c080c1a503 (patch) | |
tree | a70c8bba136c5a69a32527e82bf6254233d45873 /src/third_party/wiredtiger/src/block/block_open.c | |
parent | 394a8569ff14a215c0691aa34440227b2e62a4de (diff) | |
download | mongo-a6c348aa16ee8676026be979fbf0a5c080c1a503.tar.gz |
Import wiredtiger-wiredtiger-mongodb-3.0-rc9-1-g8eecf94.tar.gz from wiredtiger branch mongodb-3.0
Diffstat (limited to 'src/third_party/wiredtiger/src/block/block_open.c')
-rw-r--r-- | src/third_party/wiredtiger/src/block/block_open.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/third_party/wiredtiger/src/block/block_open.c b/src/third_party/wiredtiger/src/block/block_open.c index 2429e1c641c..5c824b59ec9 100644 --- a/src/third_party/wiredtiger/src/block/block_open.c +++ b/src/third_party/wiredtiger/src/block/block_open.c @@ -28,7 +28,13 @@ __wt_block_manager_truncate( WT_ERR(__wt_ftruncate(session, fh, (wt_off_t)0)); /* Write out the file's meta-data. */ - ret = __wt_desc_init(session, fh, allocsize); + WT_ERR(__wt_desc_init(session, fh, allocsize)); + + /* + * Ensure the truncated file has made it to disk, then the upper-level + * is never surprised. + */ + WT_ERR(__wt_fsync(session, fh)); /* Close the file handle. */ err: WT_TRET(__wt_close(session, fh)); @@ -55,8 +61,8 @@ __wt_block_manager_create( ret = __wt_desc_init(session, fh, allocsize); /* - * Ensure the new file has made it to disk. Otherwise a crash - * after log records exist for the file can lead to a recovery failure. + * Ensure the truncated file has made it to disk, then the upper-level + * is never surprised. */ WT_TRET(__wt_fsync(session, fh)); |