summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChenhao Qu <chenhao.qu@mongodb.com>2022-11-23 11:39:46 +1100
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-11-23 01:09:51 +0000
commit465eb7064748933e468d683d1d1a5c163f300c04 (patch)
tree3d81ea4598f4e3e636ee265f0452fc7686fe6252
parente191738ce04c8bf5971de81fcc9c8867b08d0f2a (diff)
downloadmongo-465eb7064748933e468d683d1d1a5c163f300c04.tar.gz
Import wiredtiger: 49031a8fb98a7413519c7df4af33d44fe48d2071 from branch mongodb-master
ref: 0fbad5023a..49031a8fb9 for: 6.3.0-rc0 WT-10175 Update Workgen to work with the 'u' format
-rw-r--r--src/third_party/wiredtiger/bench/workgen/workgen.cxx24
-rw-r--r--src/third_party/wiredtiger/import.data2
2 files changed, 23 insertions, 3 deletions
diff --git a/src/third_party/wiredtiger/bench/workgen/workgen.cxx b/src/third_party/wiredtiger/bench/workgen/workgen.cxx
index 3a41a1374ef..c7f43e4688b 100644
--- a/src/third_party/wiredtiger/bench/workgen/workgen.cxx
+++ b/src/third_party/wiredtiger/bench/workgen/workgen.cxx
@@ -949,6 +949,7 @@ ThreadRunner::op_run(Operation *op)
Track *track;
tint_t tint = op->_table._internal->_tint;
WT_CURSOR *cursor;
+ WT_ITEM item;
WT_DECL_RET;
uint64_t recno;
uint64_t range;
@@ -957,6 +958,7 @@ ThreadRunner::op_run(Operation *op)
uint64_t time_us;
char buf[BUF_SIZE];
+ WT_CLEAR(item);
track = NULL;
cursor = NULL;
recno = 0;
@@ -1042,12 +1044,30 @@ ThreadRunner::op_run(Operation *op)
// be retried.
if (op->is_table_op()) {
op->kv_gen(this, true, 100, recno, _keybuf);
- cursor->set_key(cursor, _keybuf);
+ const std::string key_format(cursor->key_format);
+ if (key_format == "S") {
+ cursor->set_key(cursor, _keybuf);
+ } else if (key_format == "u") {
+ item.data = _keybuf;
+ item.size = strlen(_keybuf);
+ cursor->set_key(cursor, &item);
+ } else {
+ THROW("The key format ('" << key_format << "') must be 'u' or 'S'.");
+ }
if (OP_HAS_VALUE(op)) {
uint64_t compressibility =
op->_table.options.random_value ? 0 : op->_table.options.value_compressibility;
op->kv_gen(this, false, compressibility, recno, _valuebuf);
- cursor->set_value(cursor, _valuebuf);
+ const std::string value_format(cursor->value_format);
+ if (value_format == "S") {
+ cursor->set_value(cursor, _valuebuf);
+ } else if (value_format == "u") {
+ item.data = _valuebuf;
+ item.size = strlen(_valuebuf);
+ cursor->set_value(cursor, &item);
+ } else {
+ THROW("The value format ('" << value_format << "') must be 'u' or 'S'.");
+ }
}
}
// Retry on rollback until success.
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data
index 70fa701e8f8..840a0b5a98f 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": "0fbad5023a23823b1dd8f63e2a9b582f3723cd64"
+ "commit": "49031a8fb98a7413519c7df4af33d44fe48d2071"
}