summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2021-06-02 16:56:16 +1000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-06-02 07:18:21 +0000
commitd8a96f23c753ab712ef7bff43d508acd88fa67e4 (patch)
treed05fa2c1fb0ca7ff3e16c99936d38a2b8f1fe7d3
parent80526485d3a782397c8e2ab8ac1eb0b85546dd97 (diff)
downloadmongo-d8a96f23c753ab712ef7bff43d508acd88fa67e4.tar.gz
Import wiredtiger: fff62519f0d66a140e47f99a317780e29a05fa31 from branch mongodb-5.0
ref: 5625eb9ce9..fff62519f0 for: 5.1.0 WT-7319 Implement a checkpoint_manager class that creates checkpoints at configurable intervals
-rw-r--r--src/third_party/wiredtiger/dist/test_data.py8
-rw-r--r--src/third_party/wiredtiger/import.data2
-rw-r--r--src/third_party/wiredtiger/src/config/test_config.c17
-rw-r--r--src/third_party/wiredtiger/test/cppsuite/configs/config_poc_test_default.txt5
-rw-r--r--src/third_party/wiredtiger/test/cppsuite/test_harness/checkpoint_manager.h73
-rw-r--r--src/third_party/wiredtiger/test/cppsuite/test_harness/test.h9
-rw-r--r--src/third_party/wiredtiger/test/cppsuite/test_harness/util/api_const.h1
7 files changed, 108 insertions, 7 deletions
diff --git a/src/third_party/wiredtiger/dist/test_data.py b/src/third_party/wiredtiger/dist/test_data.py
index 23667a35751..a2ad0f343a0 100644
--- a/src/third_party/wiredtiger/dist/test_data.py
+++ b/src/third_party/wiredtiger/dist/test_data.py
@@ -115,6 +115,11 @@ transaction_config = [
]
#
+# Configuration for the checkpoint_manager component.
+#
+checkpoint_manager = component_config
+
+#
# Configuration that applies to the runtime monitor component, this should be a list of statistics
# that need to be checked by the component.
#
@@ -161,6 +166,9 @@ workload_generator = component_config + transaction_config + record_config + pop
test_config = [
# Component configurations.
+ Config('checkpoint_manager', '', r'''
+ Configuration options for the checkpoint manager''',
+ type='category', subconfig=checkpoint_manager),
Config('runtime_monitor', '', r'''
Configuration options for the runtime_monitor''',
type='category', subconfig=runtime_monitor),
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data
index 548bead5fca..d96318ab138 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": "5625eb9ce90b3be2c2f8df38187219d5b05c098b"
+ "commit": "fff62519f0d66a140e47f99a317780e29a05fa31"
}
diff --git a/src/third_party/wiredtiger/src/config/test_config.c b/src/third_party/wiredtiger/src/config/test_config.c
index c517ba96f5a..b3ac1be8251 100644
--- a/src/third_party/wiredtiger/src/config/test_config.c
+++ b/src/third_party/wiredtiger/src/config/test_config.c
@@ -2,6 +2,11 @@
#include "wt_internal.h"
+static const WT_CONFIG_CHECK confchk_checkpoint_manager_subconfigs[] = {
+ {"enabled", "boolean", NULL, NULL, NULL, 0},
+ {"interval", "string", NULL, "choices=[\"s\",\"m\",\"h\"]", NULL, 0},
+ {"op_count", "int", NULL, "min=1,max=10000", NULL, 0}, {NULL, NULL, NULL, NULL, NULL, 0}};
+
static const WT_CONFIG_CHECK confchk_stat_cache_size_subconfigs[] = {
{"enabled", "boolean", NULL, NULL, NULL, 0}, {"limit", "int", NULL, "min=0", NULL, 0},
{NULL, NULL, NULL, NULL, NULL, 0}};
@@ -60,6 +65,7 @@ static const WT_CONFIG_CHECK confchk_workload_tracking_subconfigs[] = {
static const WT_CONFIG_CHECK confchk_example_test[] = {
{"cache_size_mb", "int", NULL, "min=0,max=100000000000", NULL, 0},
+ {"checkpoint_manager", "category", NULL, NULL, confchk_checkpoint_manager_subconfigs, 3},
{"duration_seconds", "int", NULL, "min=0,max=1000000", NULL, 0},
{"enable_logging", "boolean", NULL, NULL, NULL, 0},
{"runtime_monitor", "category", NULL, NULL, confchk_runtime_monitor_subconfigs, 4},
@@ -70,6 +76,7 @@ static const WT_CONFIG_CHECK confchk_example_test[] = {
static const WT_CONFIG_CHECK confchk_poc_test[] = {
{"cache_size_mb", "int", NULL, "min=0,max=100000000000", NULL, 0},
+ {"checkpoint_manager", "category", NULL, NULL, confchk_checkpoint_manager_subconfigs, 3},
{"duration_seconds", "int", NULL, "min=0,max=1000000", NULL, 0},
{"enable_logging", "boolean", NULL, NULL, NULL, 0},
{"runtime_monitor", "category", NULL, NULL, confchk_runtime_monitor_subconfigs, 4},
@@ -80,7 +87,8 @@ static const WT_CONFIG_CHECK confchk_poc_test[] = {
static const WT_CONFIG_ENTRY config_entries[] = {
{"example_test",
- "cache_size_mb=0,duration_seconds=0,enable_logging=false,"
+ "cache_size_mb=0,checkpoint_manager=(enabled=true,interval=s,"
+ "op_count=1),duration_seconds=0,enable_logging=false,"
"runtime_monitor=(enabled=true,interval=s,op_count=1,"
"stat_cache_size=(enabled=false,limit=0)),"
"timestamp_manager=(enabled=true,interval=s,oldest_lag=1,"
@@ -91,9 +99,10 @@ static const WT_CONFIG_ENTRY config_entries[] = {
"min=0),read_threads=0,update_config=(interval=s,key_size=5,"
"op_count=1,value_size=5),update_threads=0,value_size=5),"
"workload_tracking=(enabled=true,interval=s,op_count=1)",
- confchk_example_test, 7},
+ confchk_example_test, 8},
{"poc_test",
- "cache_size_mb=0,duration_seconds=0,enable_logging=false,"
+ "cache_size_mb=0,checkpoint_manager=(enabled=true,interval=s,"
+ "op_count=1),duration_seconds=0,enable_logging=false,"
"runtime_monitor=(enabled=true,interval=s,op_count=1,"
"stat_cache_size=(enabled=false,limit=0)),"
"timestamp_manager=(enabled=true,interval=s,oldest_lag=1,"
@@ -104,7 +113,7 @@ static const WT_CONFIG_ENTRY config_entries[] = {
"min=0),read_threads=0,update_config=(interval=s,key_size=5,"
"op_count=1,value_size=5),update_threads=0,value_size=5),"
"workload_tracking=(enabled=true,interval=s,op_count=1)",
- confchk_poc_test, 7},
+ confchk_poc_test, 8},
{NULL, NULL, NULL, 0}};
/*
diff --git a/src/third_party/wiredtiger/test/cppsuite/configs/config_poc_test_default.txt b/src/third_party/wiredtiger/test/cppsuite/configs/config_poc_test_default.txt
index 6caaa4d4456..a53844d00a7 100644
--- a/src/third_party/wiredtiger/test/cppsuite/configs/config_poc_test_default.txt
+++ b/src/third_party/wiredtiger/test/cppsuite/configs/config_poc_test_default.txt
@@ -3,6 +3,11 @@
# Used as a basic test for the framework.
duration_seconds=10,
cache_size_mb=1000,
+checkpoint_manager=
+(
+ op_count=30,
+ interval=m,
+),
runtime_monitor=
(
stat_cache_size=
diff --git a/src/third_party/wiredtiger/test/cppsuite/test_harness/checkpoint_manager.h b/src/third_party/wiredtiger/test/cppsuite/test_harness/checkpoint_manager.h
new file mode 100644
index 00000000000..dc7133f6ca9
--- /dev/null
+++ b/src/third_party/wiredtiger/test/cppsuite/test_harness/checkpoint_manager.h
@@ -0,0 +1,73 @@
+/*-
+ * Public Domain 2014-present MongoDB, Inc.
+ * Public Domain 2008-2014 WiredTiger, Inc.
+ *
+ * This is free and unencumbered software released into the public domain.
+ *
+ * Anyone is free to copy, modify, publish, use, compile, sell, or
+ * distribute this software, either in source code form or as a compiled
+ * binary, for any purpose, commercial or non-commercial, and by any
+ * means.
+ *
+ * In jurisdictions that recognize copyright laws, the author or authors
+ * of this software dedicate any and all copyright interest in the
+ * software to the public domain. We make this dedication for the benefit
+ * of the public at large and to the detriment of our heirs and
+ * successors. We intend this dedication to be an overt act of
+ * relinquishment in perpetuity of all present and future rights to this
+ * software under copyright law.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef CHECKPOINT_MANAGER_H
+#define CHECKPOINT_MANAGER_H
+
+#include "util/api_const.h"
+#include "connection_manager.h"
+
+namespace test_harness {
+
+class checkpoint_manager : public component {
+ public:
+ explicit checkpoint_manager(configuration *configuration)
+ : component(CHECKPOINT_MANAGER, configuration), _session(nullptr)
+ {
+ }
+ virtual ~checkpoint_manager() = default;
+
+ /* Delete the copy constructor and the assignment operator. */
+ checkpoint_manager(const checkpoint_manager &) = delete;
+ checkpoint_manager &operator=(const checkpoint_manager &) = delete;
+
+ void
+ load() override
+ {
+ /* Load the general component things. */
+ component::load();
+
+ /* Create session that we'll use for checkpointing. */
+ if (_enabled)
+ _session = connection_manager::instance().create_session();
+ }
+
+ void
+ do_work() override
+ {
+ debug_print("Running checkpoint", DEBUG_INFO);
+ testutil_check(_session->checkpoint(_session, nullptr));
+ }
+
+ private:
+ WT_SESSION *_session;
+};
+
+} // namespace test_harness
+
+#endif
diff --git a/src/third_party/wiredtiger/test/cppsuite/test_harness/test.h b/src/third_party/wiredtiger/test/cppsuite/test_harness/test.h
index f5049df074d..06337d2a000 100644
--- a/src/third_party/wiredtiger/test/cppsuite/test_harness/test.h
+++ b/src/third_party/wiredtiger/test/cppsuite/test_harness/test.h
@@ -41,6 +41,7 @@ extern "C" {
#include "util/api_const.h"
#include "core/component.h"
#include "core/configuration.h"
+#include "checkpoint_manager.h"
#include "connection_manager.h"
#include "runtime_monitor.h"
#include "timestamp_manager.h"
@@ -57,6 +58,7 @@ class test : public database_operation {
test(const std::string &config, const std::string &name)
{
_config = new configuration(name, config);
+ _checkpoint_manager = new checkpoint_manager(_config->get_subconfig(CHECKPOINT_MANAGER));
_runtime_monitor = new runtime_monitor(_config->get_subconfig(RUNTIME_MONITOR));
_timestamp_manager = new timestamp_manager(_config->get_subconfig(TIMESTAMP_MANAGER));
_workload_tracking = new workload_tracking(_config->get_subconfig(WORKLOAD_TRACKING),
@@ -69,19 +71,21 @@ class test : public database_operation {
* Ordering is not important here, any dependencies between components should be resolved
* internally by the components.
*/
- _components = {
- _workload_tracking, _workload_generator, _timestamp_manager, _runtime_monitor};
+ _components = {_workload_tracking, _workload_generator, _timestamp_manager,
+ _runtime_monitor, _checkpoint_manager};
}
~test()
{
delete _config;
+ delete _checkpoint_manager;
delete _runtime_monitor;
delete _timestamp_manager;
delete _thread_manager;
delete _workload_generator;
delete _workload_tracking;
_config = nullptr;
+ _checkpoint_manager = nullptr;
_runtime_monitor = nullptr;
_timestamp_manager = nullptr;
_thread_manager = nullptr;
@@ -181,6 +185,7 @@ class test : public database_operation {
std::string _name;
std::vector<component *> _components;
configuration *_config;
+ checkpoint_manager *_checkpoint_manager = nullptr;
runtime_monitor *_runtime_monitor = nullptr;
thread_manager *_thread_manager = nullptr;
timestamp_manager *_timestamp_manager = nullptr;
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 2ea702b4848..70d94cd3596 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
@@ -33,6 +33,7 @@
namespace test_harness {
/* Component names. */
+static const char *CHECKPOINT_MANAGER = "checkpoint_manager";
static const char *RUNTIME_MONITOR = "runtime_monitor";
static const char *TIMESTAMP_MANAGER = "timestamp_manager";
static const char *WORKLOAD_GENERATOR = "workload_generator";