diff options
author | Siddhartha Mahajan <siddhartha.mahajan8899@mongodb.com> | 2023-01-06 01:18:47 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-01-06 02:01:19 +0000 |
commit | 297d43f81b51320356fd0cdbdef116023931cea7 (patch) | |
tree | 88c8c562c14492bc87adca9e0e17c39c40c59003 | |
parent | 86ce7392a9df89c37684ed6f9a6164cdb6dbbf25 (diff) | |
download | mongo-297d43f81b51320356fd0cdbdef116023931cea7.tar.gz |
Import wiredtiger: f0f2aa4917ed962228591f242468bc68d8eef68f from branch mongodb-master
ref: 0dd6ca0312..f0f2aa4917
for: 6.3.0-rc0
WT-10301 Replace _table_runtime with a better data structure in Workgen
-rw-r--r-- | src/third_party/wiredtiger/bench/workgen/workgen.cxx | 21 | ||||
-rw-r--r-- | src/third_party/wiredtiger/bench/workgen/workgen_int.h | 3 | ||||
-rw-r--r-- | src/third_party/wiredtiger/import.data | 2 |
3 files changed, 8 insertions, 18 deletions
diff --git a/src/third_party/wiredtiger/bench/workgen/workgen.cxx b/src/third_party/wiredtiger/bench/workgen/workgen.cxx index ea2d0529e9f..6112e138f4c 100644 --- a/src/third_party/wiredtiger/bench/workgen/workgen.cxx +++ b/src/third_party/wiredtiger/bench/workgen/workgen.cxx @@ -418,9 +418,9 @@ Context::operator=(const Context &other) } ContextInternal::ContextInternal() - : _tint(), _table_names(), _table_runtime(nullptr), _runtime_alloced(0), _tint_last(0), - _dyn_tint(), _dyn_table_names(), _dyn_table_runtime(), _dyn_tint_last(0), _dyn_table_in_use(), - _dyn_tables_delete(), _context_count(0), _dyn_mutex(new std::mutex()) + : _tint(), _table_names(), _table_runtime(), _tint_last(0), _dyn_tint(), _dyn_table_names(), + _dyn_table_runtime(), _dyn_tint_last(0), _dyn_table_in_use(), _dyn_tables_delete(), + _context_count(0), _dyn_mutex(new std::mutex()) { uint32_t count = workgen_atomic_add32(&context_count, 1); if (count != 1) @@ -428,23 +428,14 @@ ContextInternal::ContextInternal() _context_count = count; } -ContextInternal::~ContextInternal() -{ - if (_table_runtime != nullptr) - delete _table_runtime; -} +ContextInternal::~ContextInternal() {} int ContextInternal::create_all() { - if (_runtime_alloced < _tint_last) { + if (_table_runtime.size() < _tint_last) { // The array references are 1-based, we'll waste one entry. - TableRuntime *new_table_runtime = new TableRuntime[_tint_last + 1]; - for (uint32_t i = 0; i < _runtime_alloced; i++) - new_table_runtime[i + 1] = _table_runtime[i + 1]; - delete _table_runtime; - _table_runtime = new_table_runtime; - _runtime_alloced = _tint_last; + _table_runtime.resize(_tint_last + 1); } return (0); } diff --git a/src/third_party/wiredtiger/bench/workgen/workgen_int.h b/src/third_party/wiredtiger/bench/workgen/workgen_int.h index 7df97af587d..7745ff51a91 100644 --- a/src/third_party/wiredtiger/bench/workgen/workgen_int.h +++ b/src/third_party/wiredtiger/bench/workgen/workgen_int.h @@ -209,8 +209,7 @@ struct ContextInternal { // Dedicated to tables that are alive until the workload ends. std::map<std::string, tint_t> _tint; // maps uri -> tint_t std::map<tint_t, std::string> _table_names; // reverse mapping - TableRuntime *_table_runtime; // # entries per tint_t - uint32_t _runtime_alloced; // length of _table_runtime + std::vector<TableRuntime> _table_runtime; // # entries per tint_t tint_t _tint_last; // last tint allocated // Dedicated to tables that can be created or removed during the workload. diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index 0942c00bdc1..db5cd8ba824 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-master", - "commit": "0dd6ca031291805203db8fcd786615deb3db34dd" + "commit": "f0f2aa4917ed962228591f242468bc68d8eef68f" } |