diff options
author | Luke Chen <luke.chen@mongodb.com> | 2021-06-17 15:47:01 +1000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-06-17 06:09:32 +0000 |
commit | ea3825fdfc2c39aed7893558c117d05a96707409 (patch) | |
tree | 86d3e6edfed4212d589b97230d197ded185dd233 | |
parent | 510357d3f541ed3755cdcb155b69082ee7987f8d (diff) | |
download | mongo-ea3825fdfc2c39aed7893558c117d05a96707409.tar.gz |
Import wiredtiger: 7c3b6258b1188a27656d1b0e3e81feee97cd1bba from branch mongodb-5.0
ref: 363c7384ed..7c3b6258b1
for: 5.1.0
WT-7556 Fix test_rollback_to_stable10 failure cache_hs_ondisk is 0
-rw-r--r-- | src/third_party/wiredtiger/examples/c/ex_file_system.c | 7 | ||||
-rw-r--r-- | src/third_party/wiredtiger/import.data | 2 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/history/hs_rec.c | 1 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/txn/txn_ckpt.c | 8 |
4 files changed, 14 insertions, 4 deletions
diff --git a/src/third_party/wiredtiger/examples/c/ex_file_system.c b/src/third_party/wiredtiger/examples/c/ex_file_system.c index 01e71595f3d..ad43cfe1cc0 100644 --- a/src/third_party/wiredtiger/examples/c/ex_file_system.c +++ b/src/third_party/wiredtiger/examples/c/ex_file_system.c @@ -536,9 +536,12 @@ demo_fs_size(WT_FILE_SYSTEM *file_system, WT_SESSION *session, const char *name, ret = ENOENT; lock_file_system(&demo_fs->lock); - if ((demo_fh = demo_handle_search(file_system, name)) != NULL) + if ((demo_fh = demo_handle_search(file_system, name)) != NULL) { + unlock_file_system(&demo_fs->lock); ret = demo_file_size((WT_FILE_HANDLE *)demo_fh, session, sizep); - unlock_file_system(&demo_fs->lock); + } else { + unlock_file_system(&demo_fs->lock); + } return (ret); } diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index 13670219790..4228fdd7d72 100644 --- a/src/third_party/wiredtiger/import.data +++ b/src/third_party/wiredtiger/import.data @@ -2,5 +2,5 @@ "vendor": "wiredtiger", "github": "wiredtiger/wiredtiger.git", "branch": "mongodb-5.0", - "commit": "363c7384edce63df337f110492c6424c5f13a451" + "commit": "7c3b6258b1188a27656d1b0e3e81feee97cd1bba" } diff --git a/src/third_party/wiredtiger/src/history/hs_rec.c b/src/third_party/wiredtiger/src/history/hs_rec.c index f96384dfef7..3e391a1fc56 100644 --- a/src/third_party/wiredtiger/src/history/hs_rec.c +++ b/src/third_party/wiredtiger/src/history/hs_rec.c @@ -696,7 +696,6 @@ __wt_hs_insert_updates( } WT_ERR(__wt_block_manager_named_size(session, WT_HS_FILE, &hs_size)); - WT_STAT_CONN_SET(session, cache_hs_ondisk, hs_size); hs_btree = __wt_curhs_get_btree(hs_cursor); max_hs_size = hs_btree->file_max; if (max_hs_size != 0 && (uint64_t)hs_size > max_hs_size) diff --git a/src/third_party/wiredtiger/src/txn/txn_ckpt.c b/src/third_party/wiredtiger/src/txn/txn_ckpt.c index a8c5c8664a4..dec8d7a3a48 100644 --- a/src/third_party/wiredtiger/src/txn/txn_ckpt.c +++ b/src/third_party/wiredtiger/src/txn/txn_ckpt.c @@ -757,6 +757,7 @@ __txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[]) WT_TXN *txn; WT_TXN_GLOBAL *txn_global; WT_TXN_ISOLATION saved_isolation; + wt_off_t hs_size; wt_timestamp_t ckpt_tmp_ts; uint64_t fsync_duration_usecs, generation, hs_ckpt_duration_usecs; uint64_t time_start_fsync, time_stop_fsync, time_start_hs, time_stop_hs; @@ -766,6 +767,7 @@ __txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[]) conn = S2C(session); cache = conn->cache; + hs_size = 0; hs_dhandle = NULL; txn = session->txn; txn_global = &conn->txn_global; @@ -956,6 +958,12 @@ __txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[]) __checkpoint_verbose_track(session, "sync completed"); + /* If the history store file exists on disk, update its statistic. */ + if (F_ISSET(hs_dhandle, WT_DHANDLE_OPEN)) { + WT_ERR(__wt_block_manager_named_size(session, WT_HS_FILE, &hs_size)); + WT_STAT_CONN_SET(session, cache_hs_ondisk, hs_size); + } + /* * Commit the transaction now that we are sure that all files in the checkpoint have been * flushed to disk. It's OK to commit before checkpointing the metadata since we know that all |