MB-21716: Consistent drift_threshold parameters 83/70083/8
authorJim Walker <jim@couchbase.com>
Fri, 18 Nov 2016 12:53:51 +0000 (12:53 +0000)
committerDave Rigby <daver@couchbase.com>
Mon, 21 Nov 2016 10:01:44 +0000 (10:01 +0000)
Change hlc_ahead to hlc_drift_ahead

Same for behind parameters.

Change-Id: I9331772c736767fecc82350087f581cdf13801a9
Reviewed-on: http://review.couchbase.org/70083
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: buildbot <build@couchbase.com>
configuration.json
src/ep_engine.cc
src/vbucket.h
tests/ep_testsuite.cc
tests/ep_testsuite_xdcr.cc

index dda405e..5c4f6ce 100644 (file)
             "descr": "The maximum timeout for a getl lock in (s)",
             "type": "size_t"
         },
-        "hlc_ahead_threshold_us": {
+        "hlc_drift_ahead_threshold_us": {
             "default": "5000000",
-            "descr": "The μs threshold at which we will increment a vbucket's ahead counter.",
+            "descr": "The μs threshold of drift at which we will increment a vbucket's ahead counter.",
             "type": "size_t"
         },
-        "hlc_behind_threshold_us": {
+        "hlc_drift_behind_threshold_us": {
             "default": "5000000",
-            "descr": "The μs threshold at which we will increment a vbucket's behind counter.",
+            "descr": "The μs threshold of drift at which we will increment a vbucket's behind counter.",
             "type": "size_t"
         },
         "ht_locks": {
index f33f513..0f125f0 100644 (file)
@@ -618,11 +618,11 @@ extern "C" {
             if (strcmp(keyz, "hlc_drift_ahead_threshold_us") == 0) {
                 uint64_t v = std::strtoull(valz, nullptr, 10);
                 checkNumeric(valz);
-                e->getConfiguration().setHlcAheadThresholdUs(v);
+                e->getConfiguration().setHlcDriftAheadThresholdUs(v);
             } else if (strcmp(keyz, "hlc_drift_behind_threshold_us") == 0) {
                 uint64_t v = std::strtoull(valz, nullptr, 10);
                 checkNumeric(valz);
-                e->getConfiguration().setHlcBehindThresholdUs(v);
+                e->getConfiguration().setHlcDriftBehindThresholdUs(v);
             } else if (strcmp(keyz, "max_cas") == 0) {
                 uint64_t v = std::strtoull(valz, nullptr, 10);
                 checkNumeric(valz);
index ede95f4..7ea4b82 100644 (file)
@@ -181,8 +181,8 @@ public:
         tempFilter(NULL),
         rollbackItemCount(0),
         hlc(maxCas,
-            std::chrono::microseconds(config.getHlcAheadThresholdUs()),
-            std::chrono::microseconds(config.getHlcBehindThresholdUs())),
+            std::chrono::microseconds(config.getHlcDriftAheadThresholdUs()),
+            std::chrono::microseconds(config.getHlcDriftBehindThresholdUs())),
         statPrefix("vb_" + std::to_string(i))
     {
         backfill.isBackfillPhase = false;
index b40852c..5a35a99 100644 (file)
@@ -6191,8 +6191,8 @@ static enum test_result test_mb19687_fixed(ENGINE_HANDLE* h,
                 "ep_flushall_enabled",
                 "ep_getl_default_timeout",
                 "ep_getl_max_timeout",
-                "ep_hlc_ahead_threshold_us",
-                "ep_hlc_behind_threshold_us",
+                "ep_hlc_drift_ahead_threshold_us",
+                "ep_hlc_drift_behind_threshold_us",
                 "ep_ht_locks",
                 "ep_ht_size",
                 "ep_initfile",
@@ -6393,8 +6393,8 @@ static enum test_result test_mb19687_fixed(ENGINE_HANDLE* h,
                 "ep_flusher_todo",
                 "ep_getl_default_timeout",
                 "ep_getl_max_timeout",
-                "ep_hlc_ahead_threshold_us",
-                "ep_hlc_behind_threshold_us",
+                "ep_hlc_drift_ahead_threshold_us",
+                "ep_hlc_drift_behind_threshold_us",
                 "ep_ht_locks",
                 "ep_ht_size",
                 "ep_initfile",
index c72af17..7e67169 100644 (file)
@@ -1591,7 +1591,7 @@ static enum test_result test_set_with_meta_and_check_drift_stats(ENGINE_HANDLE *
 
     // grab the drift behind threshold
     uint64_t driftBehindThreshold = get_ull_stat(h, h1,
-                                                 "ep_hlc_ahead_threshold_us",
+                                                 "ep_hlc_drift_ahead_threshold_us",
                                                  nullptr);
     // Create n keys
     const int n_keys = 5;
@@ -1675,7 +1675,7 @@ static enum test_result test_del_with_meta_and_check_drift_stats(ENGINE_HANDLE *
 
     // grab the drift behind threshold
     uint64_t driftBehindThreshold = get_ull_stat(h, h1,
-                                                 "ep_hlc_ahead_threshold_us",
+                                                 "ep_hlc_drift_ahead_threshold_us",
                                                  nullptr);
     // Create n keys * n_vbuckets
     const int n_keys = 5;
@@ -1776,8 +1776,8 @@ static enum test_result test_del_with_meta_and_check_drift_stats(ENGINE_HANDLE *
 static enum test_result test_setting_drift_threshold(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1) {
 
     std::vector<std::pair<std::string, std::string> > configData =
-        {{"ep_hlc_ahead_threshold_us", "hlc_drift_ahead_threshold_us"},
-         {"ep_hlc_behind_threshold_us", "hlc_drift_behind_threshold_us"}};
+        {{"ep_hlc_drift_ahead_threshold_us", "hlc_drift_ahead_threshold_us"},
+         {"ep_hlc_drift_behind_threshold_us", "hlc_drift_behind_threshold_us"}};
 
     std::vector<std::pair<std::string, uint64_t> > values =
         {{"0", 0}, {"1", 1}, {"-1", -1}, {"-0", 0},
@@ -1880,11 +1880,13 @@ BaseTestCase testsuite_testcases[] = {
 
         TestCase("test set_with_meta and drift stats",
                  test_set_with_meta_and_check_drift_stats, test_setup,
-                 teardown, "hlc_ahead_threshold_us=5000000;hlc_behind_threshold_us=0;conflict_resolution_type=lww",
+                 teardown, "hlc_drift_ahead_threshold_us=5000000;"
+                 "hlc_drift_behind_threshold_us=0;conflict_resolution_type=lww",
                  prepare, cleanup),
         TestCase("test del_with_meta and drift stats",
                  test_del_with_meta_and_check_drift_stats, test_setup,
-                 teardown, "hlc_ahead_threshold_us=0;hlc_behind_threshold_us=5000000;conflict_resolution_type=lww",
+                 teardown, "hlc_drift_ahead_threshold_us=0;"
+                 "hlc_drift_behind_threshold_us=5000000;conflict_resolution_type=lww",
                  prepare, cleanup),
         TestCase("test setting drift threshold",
                  test_setting_drift_threshold, test_setup,