summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChenhao Qu <chenhao.qu@mongodb.com>2022-04-27 01:05:56 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-04-27 01:33:53 +0000
commit838549c540519723c644346bd180fd966ecbc0d0 (patch)
tree83cfc88eeb0bfb17b0faee28942e8a72edc06ac3 /src
parent1ae2e2b11e010f87f3f73b8f9cda147f58de3c89 (diff)
downloadmongo-838549c540519723c644346bd180fd966ecbc0d0.tar.gz
Import wiredtiger: b37584cfc4d461d107d0221aab0eef0882a7d34d from branch mongodb-master
ref: d49187b688..b37584cfc4 for: 6.1.0-rc0 WT-9089 Define a new remove operation function in the cpp testing
Diffstat (limited to 'src')
-rw-r--r--src/third_party/wiredtiger/dist/test_data.py6
-rw-r--r--src/third_party/wiredtiger/import.data2
-rw-r--r--src/third_party/wiredtiger/src/config/test_config.c55
-rw-r--r--src/third_party/wiredtiger/test/cppsuite/configs/operations_test_default.txt6
-rw-r--r--src/third_party/wiredtiger/test/cppsuite/configs/operations_test_stress.txt6
-rw-r--r--src/third_party/wiredtiger/test/cppsuite/test_harness/util/api_const.cpp1
-rw-r--r--src/third_party/wiredtiger/test/cppsuite/test_harness/util/api_const.h1
-rw-r--r--src/third_party/wiredtiger/test/cppsuite/test_harness/workload/database_operation.cpp77
-rw-r--r--src/third_party/wiredtiger/test/cppsuite/test_harness/workload/database_operation.h3
-rw-r--r--src/third_party/wiredtiger/test/cppsuite/test_harness/workload/thread_context.cpp2
-rw-r--r--src/third_party/wiredtiger/test/cppsuite/test_harness/workload/thread_context.h2
-rw-r--r--src/third_party/wiredtiger/test/cppsuite/test_harness/workload_generator.cpp4
-rw-r--r--src/third_party/wiredtiger/test/cppsuite/tests/test_template.cpp6
13 files changed, 146 insertions, 25 deletions
diff --git a/src/third_party/wiredtiger/dist/test_data.py b/src/third_party/wiredtiger/dist/test_data.py
index fe6f15b2e2e..83695e3eb38 100644
--- a/src/third_party/wiredtiger/dist/test_data.py
+++ b/src/third_party/wiredtiger/dist/test_data.py
@@ -110,7 +110,7 @@ transaction_config = [
Config('ops_per_transaction', '', r'''
Defines how many operations a transaction can perform, the range is defined with a minimum
and a maximum and a random number is chosen between the two using a linear distribution.''',
- type='category',subconfig=range_config),
+ type='category', subconfig=range_config),
]
thread_count = [
@@ -119,6 +119,7 @@ thread_count = [
]
read_thread_config = thread_count + throttle_config + transaction_config + record_config
+remove_thread_config = thread_count + transaction_config + throttle_config
update_insert_thread_config = thread_count + transaction_config + throttle_config + record_config
custom_operation_thread_config = thread_count + transaction_config + throttle_config + record_config
@@ -174,6 +175,9 @@ workload_generator = enabled_config_true + component_config + [
Config('populate_config', '', r'''
Config that specifies how the database will be populated initially.''',
type='category', subconfig=populate_config),
+ Config('remove_config', '',r'''
+ Config that specifies the number of remove_operation threads and their behaviour.''',
+ type='category', subconfig=remove_thread_config),
Config('read_config', '', r'''
Config that specifies the number of read_operation threads and their behaviour.''',
type='category', subconfig=read_thread_config),
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data
index 7dd0cf88dfb..a0ab4755ff4 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": "d49187b688033a7d20115853149858da5753f2b5"
+ "commit": "b37584cfc4d461d107d0221aab0eef0882a7d34d"
}
diff --git a/src/third_party/wiredtiger/src/config/test_config.c b/src/third_party/wiredtiger/src/config/test_config.c
index 837f91b8f76..5120dd65f97 100644
--- a/src/third_party/wiredtiger/src/config/test_config.c
+++ b/src/third_party/wiredtiger/src/config/test_config.c
@@ -73,6 +73,11 @@ static const WT_CONFIG_CHECK confchk_read_config_subconfigs[] = {
{"thread_count", "int", NULL, "min=0", NULL, 0},
{"value_size", "int", NULL, "min=0,max=1000000000", NULL, 0}, {NULL, NULL, NULL, NULL, NULL, 0}};
+static const WT_CONFIG_CHECK confchk_remove_config_subconfigs[] = {
+ {"op_rate", "string", NULL, NULL, NULL, 0},
+ {"ops_per_transaction", "category", NULL, NULL, confchk_ops_per_transaction_subconfigs, 2},
+ {"thread_count", "int", NULL, "min=0", NULL, 0}, {NULL, NULL, NULL, NULL, NULL, 0}};
+
static const WT_CONFIG_CHECK confchk_update_config_subconfigs[] = {
{"key_size", "int", NULL, "min=0,max=10000", NULL, 0}, {"op_rate", "string", NULL, NULL, NULL, 0},
{"ops_per_transaction", "category", NULL, NULL, confchk_ops_per_transaction_subconfigs, 2},
@@ -86,6 +91,7 @@ static const WT_CONFIG_CHECK confchk_workload_generator_subconfigs[] = {
{"op_rate", "string", NULL, NULL, NULL, 0},
{"populate_config", "category", NULL, NULL, confchk_populate_config_subconfigs, 5},
{"read_config", "category", NULL, NULL, confchk_read_config_subconfigs, 5},
+ {"remove_config", "category", NULL, NULL, confchk_remove_config_subconfigs, 3},
{"update_config", "category", NULL, NULL, confchk_update_config_subconfigs, 5},
{NULL, NULL, NULL, NULL, NULL, 0}};
@@ -103,7 +109,7 @@ static const WT_CONFIG_CHECK confchk_burst_inserts[] = {
{"runtime_monitor", "category", NULL, NULL, confchk_runtime_monitor_subconfigs, 6},
{"statistics_config", "category", NULL, NULL, confchk_statistics_config_subconfigs, 2},
{"timestamp_manager", "category", NULL, NULL, confchk_timestamp_manager_subconfigs, 4},
- {"workload_generator", "category", NULL, NULL, confchk_workload_generator_subconfigs, 7},
+ {"workload_generator", "category", NULL, NULL, confchk_workload_generator_subconfigs, 8},
{"workload_tracking", "category", NULL, NULL, confchk_workload_tracking_subconfigs, 2},
{NULL, NULL, NULL, NULL, NULL, 0}};
@@ -116,7 +122,7 @@ static const WT_CONFIG_CHECK confchk_hs_cleanup[] = {
{"runtime_monitor", "category", NULL, NULL, confchk_runtime_monitor_subconfigs, 6},
{"statistics_config", "category", NULL, NULL, confchk_statistics_config_subconfigs, 2},
{"timestamp_manager", "category", NULL, NULL, confchk_timestamp_manager_subconfigs, 4},
- {"workload_generator", "category", NULL, NULL, confchk_workload_generator_subconfigs, 7},
+ {"workload_generator", "category", NULL, NULL, confchk_workload_generator_subconfigs, 8},
{"workload_tracking", "category", NULL, NULL, confchk_workload_tracking_subconfigs, 2},
{NULL, NULL, NULL, NULL, NULL, 0}};
@@ -129,7 +135,7 @@ static const WT_CONFIG_CHECK confchk_operations_test[] = {
{"runtime_monitor", "category", NULL, NULL, confchk_runtime_monitor_subconfigs, 6},
{"statistics_config", "category", NULL, NULL, confchk_statistics_config_subconfigs, 2},
{"timestamp_manager", "category", NULL, NULL, confchk_timestamp_manager_subconfigs, 4},
- {"workload_generator", "category", NULL, NULL, confchk_workload_generator_subconfigs, 7},
+ {"workload_generator", "category", NULL, NULL, confchk_workload_generator_subconfigs, 8},
{"workload_tracking", "category", NULL, NULL, confchk_workload_tracking_subconfigs, 2},
{NULL, NULL, NULL, NULL, NULL, 0}};
@@ -143,7 +149,7 @@ static const WT_CONFIG_CHECK confchk_search_near_01[] = {
{"search_near_threads", "string", NULL, NULL, NULL, 0},
{"statistics_config", "category", NULL, NULL, confchk_statistics_config_subconfigs, 2},
{"timestamp_manager", "category", NULL, NULL, confchk_timestamp_manager_subconfigs, 4},
- {"workload_generator", "category", NULL, NULL, confchk_workload_generator_subconfigs, 7},
+ {"workload_generator", "category", NULL, NULL, confchk_workload_generator_subconfigs, 8},
{"workload_tracking", "category", NULL, NULL, confchk_workload_tracking_subconfigs, 2},
{NULL, NULL, NULL, NULL, NULL, 0}};
@@ -156,7 +162,7 @@ static const WT_CONFIG_CHECK confchk_search_near_02[] = {
{"runtime_monitor", "category", NULL, NULL, confchk_runtime_monitor_subconfigs, 6},
{"statistics_config", "category", NULL, NULL, confchk_statistics_config_subconfigs, 2},
{"timestamp_manager", "category", NULL, NULL, confchk_timestamp_manager_subconfigs, 4},
- {"workload_generator", "category", NULL, NULL, confchk_workload_generator_subconfigs, 7},
+ {"workload_generator", "category", NULL, NULL, confchk_workload_generator_subconfigs, 8},
{"workload_tracking", "category", NULL, NULL, confchk_workload_tracking_subconfigs, 2},
{NULL, NULL, NULL, NULL, NULL, 0}};
@@ -169,7 +175,7 @@ static const WT_CONFIG_CHECK confchk_search_near_03[] = {
{"runtime_monitor", "category", NULL, NULL, confchk_runtime_monitor_subconfigs, 6},
{"statistics_config", "category", NULL, NULL, confchk_statistics_config_subconfigs, 2},
{"timestamp_manager", "category", NULL, NULL, confchk_timestamp_manager_subconfigs, 4},
- {"workload_generator", "category", NULL, NULL, confchk_workload_generator_subconfigs, 7},
+ {"workload_generator", "category", NULL, NULL, confchk_workload_generator_subconfigs, 8},
{"workload_tracking", "category", NULL, NULL, confchk_workload_tracking_subconfigs, 2},
{NULL, NULL, NULL, NULL, NULL, 0}};
@@ -182,7 +188,7 @@ static const WT_CONFIG_CHECK confchk_test_template[] = {
{"runtime_monitor", "category", NULL, NULL, confchk_runtime_monitor_subconfigs, 6},
{"statistics_config", "category", NULL, NULL, confchk_statistics_config_subconfigs, 2},
{"timestamp_manager", "category", NULL, NULL, confchk_timestamp_manager_subconfigs, 4},
- {"workload_generator", "category", NULL, NULL, confchk_workload_generator_subconfigs, 7},
+ {"workload_generator", "category", NULL, NULL, confchk_workload_generator_subconfigs, 8},
{"workload_tracking", "category", NULL, NULL, confchk_workload_tracking_subconfigs, 2},
{NULL, NULL, NULL, NULL, NULL, 0}};
@@ -207,8 +213,9 @@ static const WT_CONFIG_ENTRY config_entries[] = {
"key_count_per_collection=0,key_size=5,thread_count=1,"
"value_size=5),read_config=(key_size=5,op_rate=1s,"
"ops_per_transaction=(max=1,min=0),thread_count=0,value_size=5),"
- "update_config=(key_size=5,op_rate=1s,ops_per_transaction=(max=1,"
- "min=0),thread_count=0,value_size=5)),"
+ "remove_config=(op_rate=1s,ops_per_transaction=(max=1,min=0),"
+ "thread_count=0),update_config=(key_size=5,op_rate=1s,"
+ "ops_per_transaction=(max=1,min=0),thread_count=0,value_size=5)),"
"workload_tracking=(enabled=true,op_rate=1s)",
confchk_burst_inserts, 11},
{"hs_cleanup",
@@ -230,8 +237,9 @@ static const WT_CONFIG_ENTRY config_entries[] = {
"key_count_per_collection=0,key_size=5,thread_count=1,"
"value_size=5),read_config=(key_size=5,op_rate=1s,"
"ops_per_transaction=(max=1,min=0),thread_count=0,value_size=5),"
- "update_config=(key_size=5,op_rate=1s,ops_per_transaction=(max=1,"
- "min=0),thread_count=0,value_size=5)),"
+ "remove_config=(op_rate=1s,ops_per_transaction=(max=1,min=0),"
+ "thread_count=0),update_config=(key_size=5,op_rate=1s,"
+ "ops_per_transaction=(max=1,min=0),thread_count=0,value_size=5)),"
"workload_tracking=(enabled=true,op_rate=1s)",
confchk_hs_cleanup, 10},
{"operations_test",
@@ -253,8 +261,9 @@ static const WT_CONFIG_ENTRY config_entries[] = {
"key_count_per_collection=0,key_size=5,thread_count=1,"
"value_size=5),read_config=(key_size=5,op_rate=1s,"
"ops_per_transaction=(max=1,min=0),thread_count=0,value_size=5),"
- "update_config=(key_size=5,op_rate=1s,ops_per_transaction=(max=1,"
- "min=0),thread_count=0,value_size=5)),"
+ "remove_config=(op_rate=1s,ops_per_transaction=(max=1,min=0),"
+ "thread_count=0),update_config=(key_size=5,op_rate=1s,"
+ "ops_per_transaction=(max=1,min=0),thread_count=0,value_size=5)),"
"workload_tracking=(enabled=true,op_rate=1s)",
confchk_operations_test, 10},
{"search_near_01",
@@ -277,8 +286,9 @@ static const WT_CONFIG_ENTRY config_entries[] = {
"key_count_per_collection=0,key_size=5,thread_count=1,"
"value_size=5),read_config=(key_size=5,op_rate=1s,"
"ops_per_transaction=(max=1,min=0),thread_count=0,value_size=5),"
- "update_config=(key_size=5,op_rate=1s,ops_per_transaction=(max=1,"
- "min=0),thread_count=0,value_size=5)),"
+ "remove_config=(op_rate=1s,ops_per_transaction=(max=1,min=0),"
+ "thread_count=0),update_config=(key_size=5,op_rate=1s,"
+ "ops_per_transaction=(max=1,min=0),thread_count=0,value_size=5)),"
"workload_tracking=(enabled=true,op_rate=1s)",
confchk_search_near_01, 11},
{"search_near_02",
@@ -300,8 +310,9 @@ static const WT_CONFIG_ENTRY config_entries[] = {
"key_count_per_collection=0,key_size=5,thread_count=1,"
"value_size=5),read_config=(key_size=5,op_rate=1s,"
"ops_per_transaction=(max=1,min=0),thread_count=0,value_size=5),"
- "update_config=(key_size=5,op_rate=1s,ops_per_transaction=(max=1,"
- "min=0),thread_count=0,value_size=5)),"
+ "remove_config=(op_rate=1s,ops_per_transaction=(max=1,min=0),"
+ "thread_count=0),update_config=(key_size=5,op_rate=1s,"
+ "ops_per_transaction=(max=1,min=0),thread_count=0,value_size=5)),"
"workload_tracking=(enabled=true,op_rate=1s)",
confchk_search_near_02, 10},
{"search_near_03",
@@ -323,8 +334,9 @@ static const WT_CONFIG_ENTRY config_entries[] = {
"key_count_per_collection=0,key_size=5,thread_count=1,"
"value_size=5),read_config=(key_size=5,op_rate=1s,"
"ops_per_transaction=(max=1,min=0),thread_count=0,value_size=5),"
- "update_config=(key_size=5,op_rate=1s,ops_per_transaction=(max=1,"
- "min=0),thread_count=0,value_size=5)),"
+ "remove_config=(op_rate=1s,ops_per_transaction=(max=1,min=0),"
+ "thread_count=0),update_config=(key_size=5,op_rate=1s,"
+ "ops_per_transaction=(max=1,min=0),thread_count=0,value_size=5)),"
"workload_tracking=(enabled=true,op_rate=1s)",
confchk_search_near_03, 10},
{"test_template",
@@ -346,8 +358,9 @@ static const WT_CONFIG_ENTRY config_entries[] = {
"key_count_per_collection=0,key_size=5,thread_count=1,"
"value_size=5),read_config=(key_size=5,op_rate=1s,"
"ops_per_transaction=(max=1,min=0),thread_count=0,value_size=5),"
- "update_config=(key_size=5,op_rate=1s,ops_per_transaction=(max=1,"
- "min=0),thread_count=0,value_size=5)),"
+ "remove_config=(op_rate=1s,ops_per_transaction=(max=1,min=0),"
+ "thread_count=0),update_config=(key_size=5,op_rate=1s,"
+ "ops_per_transaction=(max=1,min=0),thread_count=0,value_size=5)),"
"workload_tracking=(enabled=true,op_rate=1s)",
confchk_test_template, 10},
{NULL, NULL, NULL, 0}};
diff --git a/src/third_party/wiredtiger/test/cppsuite/configs/operations_test_default.txt b/src/third_party/wiredtiger/test/cppsuite/configs/operations_test_default.txt
index 4608f9ad526..32fc0baf9ce 100644
--- a/src/third_party/wiredtiger/test/cppsuite/configs/operations_test_default.txt
+++ b/src/third_party/wiredtiger/test/cppsuite/configs/operations_test_default.txt
@@ -65,6 +65,12 @@ workload_generator=
ops_per_transaction=(max=100,min=50),
thread_count=10
),
+ remove_config=
+ (
+ op_rate=500ms,
+ ops_per_transaction=(max=50,min=0),
+ thread_count=1
+ ),
update_config=
(
op_rate=15ms,
diff --git a/src/third_party/wiredtiger/test/cppsuite/configs/operations_test_stress.txt b/src/third_party/wiredtiger/test/cppsuite/configs/operations_test_stress.txt
index 3a570402a7b..7f85f23d048 100644
--- a/src/third_party/wiredtiger/test/cppsuite/configs/operations_test_stress.txt
+++ b/src/third_party/wiredtiger/test/cppsuite/configs/operations_test_stress.txt
@@ -52,6 +52,12 @@ workload_generator=
ops_per_transaction=(max=100,min=50),
thread_count=20
),
+ remove_config=
+ (
+ op_rate=100ms,
+ ops_per_transaction=(max=100,min=50),
+ thread_count=5
+ ),
update_config=
(
op_rate=10ms,
diff --git a/src/third_party/wiredtiger/test/cppsuite/test_harness/util/api_const.cpp b/src/third_party/wiredtiger/test/cppsuite/test_harness/util/api_const.cpp
index ef78504aca7..460a0bfb0bb 100644
--- a/src/third_party/wiredtiger/test/cppsuite/test_harness/util/api_const.cpp
+++ b/src/third_party/wiredtiger/test/cppsuite/test_harness/util/api_const.cpp
@@ -60,6 +60,7 @@ const std::string OPS_PER_TRANSACTION = "ops_per_transaction";
const std::string POPULATE_CONFIG = "populate_config";
const std::string POSTRUN_STATISTICS = "postrun";
const std::string READ_OP_CONFIG = "read_config";
+const std::string REMOVE_OP_CONFIG = "remove_config";
const std::string RUNTIME_STATISTICS = "runtime";
const std::string SAVE = "save";
const std::string STABLE_LAG = "stable_lag";
diff --git a/src/third_party/wiredtiger/test/cppsuite/test_harness/util/api_const.h b/src/third_party/wiredtiger/test/cppsuite/test_harness/util/api_const.h
index ed7bf33fbdb..060f556947b 100644
--- a/src/third_party/wiredtiger/test/cppsuite/test_harness/util/api_const.h
+++ b/src/third_party/wiredtiger/test/cppsuite/test_harness/util/api_const.h
@@ -63,6 +63,7 @@ extern const std::string OPS_PER_TRANSACTION;
extern const std::string POPULATE_CONFIG;
extern const std::string POSTRUN_STATISTICS;
extern const std::string READ_OP_CONFIG;
+extern const std::string REMOVE_OP_CONFIG;
extern const std::string RUNTIME_STATISTICS;
extern const std::string SAVE;
extern const std::string STABLE_LAG;
diff --git a/src/third_party/wiredtiger/test/cppsuite/test_harness/workload/database_operation.cpp b/src/third_party/wiredtiger/test/cppsuite/test_harness/workload/database_operation.cpp
index 1cc116169e6..f6160b83e5e 100644
--- a/src/third_party/wiredtiger/test/cppsuite/test_harness/workload/database_operation.cpp
+++ b/src/third_party/wiredtiger/test/cppsuite/test_harness/workload/database_operation.cpp
@@ -87,7 +87,7 @@ database_operation::populate(
testutil_assert(key_count <= pow(10, key_size));
logger::log_msg(
- LOG_INFO, "Populate: " + std::to_string(collection_count) + " creating collections.");
+ LOG_INFO, "Populate: creating " + std::to_string(collection_count) + " collections.");
/* Create n collections as per the configuration. */
for (int64_t i = 0; i < collection_count; ++i)
@@ -247,6 +247,81 @@ database_operation::read_operation(thread_context *tc)
}
void
+database_operation::remove_operation(thread_context *tc)
+{
+ logger::log_msg(
+ LOG_INFO, type_string(tc->type) + " thread {" + std::to_string(tc->id) + "} commencing.");
+
+ /*
+ * We need two types of cursors. One cursor is a random cursor to randomly select a key and the
+ * other one is a standard cursor to remove the random key. This is required as the random
+ * cursor does not support the remove operation.
+ */
+ std::map<uint64_t, scoped_cursor> rnd_cursors, cursors;
+
+ /* Loop while the test is running. */
+ while (tc->running()) {
+ /*
+ * Sleep the period defined by the op_rate in the configuration. Do this at the start of the
+ * loop as it could be skipped by a subsequent continue call.
+ */
+ tc->sleep();
+
+ /* Choose a random collection to update. */
+ collection &coll = tc->db.get_random_collection();
+
+ /* Look for existing cursors in our cursor cache. */
+ if (cursors.find(coll.id) == cursors.end()) {
+ logger::log_msg(LOG_TRACE,
+ "Thread {" + std::to_string(tc->id) +
+ "} Creating cursor for collection: " + coll.name);
+ /* Open the two cursors for the chosen collection. */
+ scoped_cursor rnd_cursor =
+ tc->session.open_scoped_cursor(coll.name, "next_random=true");
+ rnd_cursors.emplace(coll.id, std::move(rnd_cursor));
+ scoped_cursor cursor = tc->session.open_scoped_cursor(coll.name);
+ cursors.emplace(coll.id, std::move(cursor));
+ }
+
+ /* Start a transaction if possible. */
+ tc->transaction.try_begin();
+
+ /* Get the cursor associated with the collection. */
+ scoped_cursor &rnd_cursor = rnd_cursors[coll.id];
+ scoped_cursor &cursor = cursors[coll.id];
+
+ /* Choose a random key to delete. */
+ const char *key_str;
+ int ret = rnd_cursor->next(rnd_cursor.get());
+ /* It is possible not to find anything if the collection is empty. */
+ testutil_assert(ret == 0 || ret == WT_NOTFOUND);
+ if (ret == WT_NOTFOUND) {
+ /*
+ * If we cannot find any record, finish the current transaction as we might be able to
+ * see new records after starting a new one.
+ */
+ WT_IGNORE_RET_BOOL(tc->transaction.commit());
+ continue;
+ }
+ testutil_check(rnd_cursor->get_key(rnd_cursor.get(), &key_str));
+ if (!tc->remove(cursor, coll.id, key_str)) {
+ tc->transaction.rollback();
+ }
+
+ /* Reset our cursor to avoid pinning content. */
+ testutil_check(cursor->reset(cursor.get()));
+
+ /* Commit the current transaction if we're able to. */
+ if (tc->transaction.can_commit())
+ WT_IGNORE_RET_BOOL(tc->transaction.commit());
+ }
+
+ /* Make sure the last operation is rolled back now the work is finished. */
+ if (tc->transaction.active())
+ tc->transaction.rollback();
+}
+
+void
database_operation::update_operation(thread_context *tc)
{
logger::log_msg(
diff --git a/src/third_party/wiredtiger/test/cppsuite/test_harness/workload/database_operation.h b/src/third_party/wiredtiger/test/cppsuite/test_harness/workload/database_operation.h
index 06e6d0ca881..2545aa9de04 100644
--- a/src/third_party/wiredtiger/test/cppsuite/test_harness/workload/database_operation.h
+++ b/src/third_party/wiredtiger/test/cppsuite/test_harness/workload/database_operation.h
@@ -56,6 +56,9 @@ class database_operation {
/* Basic read operation that chooses a random collection and walks a cursor. */
virtual void read_operation(thread_context *tc);
+ /* Basic remove operation that chooses a random key and deletes it. */
+ virtual void remove_operation(thread_context *tc);
+
/* Basic update operation that chooses a random key and updates it. */
virtual void update_operation(thread_context *tc);
diff --git a/src/third_party/wiredtiger/test/cppsuite/test_harness/workload/thread_context.cpp b/src/third_party/wiredtiger/test/cppsuite/test_harness/workload/thread_context.cpp
index fbae1563832..e307e2b250a 100644
--- a/src/third_party/wiredtiger/test/cppsuite/test_harness/workload/thread_context.cpp
+++ b/src/third_party/wiredtiger/test/cppsuite/test_harness/workload/thread_context.cpp
@@ -46,6 +46,8 @@ type_string(thread_type type)
return ("insert");
case thread_type::READ:
return ("read");
+ case thread_type::REMOVE:
+ return ("remove");
case thread_type::UPDATE:
return ("update");
default:
diff --git a/src/third_party/wiredtiger/test/cppsuite/test_harness/workload/thread_context.h b/src/third_party/wiredtiger/test/cppsuite/test_harness/workload/thread_context.h
index 7f30e6a6d94..e3cbf82b6f7 100644
--- a/src/third_party/wiredtiger/test/cppsuite/test_harness/workload/thread_context.h
+++ b/src/third_party/wiredtiger/test/cppsuite/test_harness/workload/thread_context.h
@@ -44,7 +44,7 @@ class timestamp_manager;
class workload_tracking;
namespace test_harness {
-enum thread_type { CUSTOM, INSERT, READ, UPDATE };
+enum thread_type { CUSTOM, INSERT, READ, REMOVE, UPDATE };
const std::string type_string(thread_type type);
diff --git a/src/third_party/wiredtiger/test/cppsuite/test_harness/workload_generator.cpp b/src/third_party/wiredtiger/test/cppsuite/test_harness/workload_generator.cpp
index 472f4feb643..9ea12e0e2eb 100644
--- a/src/third_party/wiredtiger/test/cppsuite/test_harness/workload_generator.cpp
+++ b/src/third_party/wiredtiger/test/cppsuite/test_harness/workload_generator.cpp
@@ -56,6 +56,8 @@ operation_config::get_func(database_operation *dbo)
return (std::bind(&database_operation::insert_operation, dbo, std::placeholders::_1));
case thread_type::READ:
return (std::bind(&database_operation::read_operation, dbo, std::placeholders::_1));
+ case thread_type::REMOVE:
+ return (std::bind(&database_operation::remove_operation, dbo, std::placeholders::_1));
case thread_type::UPDATE:
return (std::bind(&database_operation::update_operation, dbo, std::placeholders::_1));
default:
@@ -94,6 +96,8 @@ workload_generator::run()
operation_configs.push_back(
operation_config(_config->get_subconfig(READ_OP_CONFIG), thread_type::READ));
operation_configs.push_back(
+ operation_config(_config->get_subconfig(REMOVE_OP_CONFIG), thread_type::REMOVE));
+ operation_configs.push_back(
operation_config(_config->get_subconfig(UPDATE_OP_CONFIG), thread_type::UPDATE));
populate_config = _config->get_subconfig(POPULATE_CONFIG);
diff --git a/src/third_party/wiredtiger/test/cppsuite/tests/test_template.cpp b/src/third_party/wiredtiger/test/cppsuite/tests/test_template.cpp
index 7c92b2fe4eb..f8d312380cb 100644
--- a/src/third_party/wiredtiger/test/cppsuite/tests/test_template.cpp
+++ b/src/third_party/wiredtiger/test/cppsuite/tests/test_template.cpp
@@ -69,6 +69,12 @@ class test_template : public test_harness::test {
}
void
+ remove_operation(test_harness::thread_context *) override final
+ {
+ std::cout << "remove_operation: nothing done." << std::endl;
+ }
+
+ void
update_operation(test_harness::thread_context *) override final
{
std::cout << "update_operation: nothing done." << std::endl;