MB-23719: Add dynamic change of ephemeral_metadata_purge_age 41/76541/7
authorDave Rigby <daver@couchbase.com>
Mon, 10 Apr 2017 08:53:34 +0000 (09:53 +0100)
committerDave Rigby <daver@couchbase.com>
Thu, 13 Apr 2017 17:04:59 +0000 (17:04 +0000)
Add ephemeral_metadata_purge_age to setFlushParam() so its value can
be changed dynamically via SET_PARAM.

Also add a requirement on bucket_type==ephemeral, as it's not valid
for other bucket types.

Change-Id: I0fecb5ced449c672dd95a4b196bdab9f6aaa7347
Reviewed-on: http://review.couchbase.org/76541
Reviewed-by: Manu Dhundi <manu@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>
configuration.json
src/ep_engine.cc
tests/ep_testsuite.cc

index dd7b777..76e9368 100644 (file)
         "ephemeral_metadata_purge_age": {
             "default": "60",
             "descr": "Age in seconds after which Ephemeral metadata is purged entirely from memory. Purging disabled if set to -1.",
-            "type": "ssize_t"
+            "type": "ssize_t",
+            "requires": {
+                "bucket_type": "ephemeral"
+            }
         },
         "ephemeral_metadata_purge_interval": {
             "default": "60",
index af448d6..d82beda 100644 (file)
@@ -583,6 +583,10 @@ protocol_binary_response_status EventuallyPersistentEngine::setFlushParam(
         } else if (strcmp(keyz, "ephemeral_full_policy") == 0) {
             getConfiguration().requirementsMetOrThrow("ephemeral_full_policy");
             getConfiguration().setEphemeralFullPolicy(valz);
+        } else if (strcmp(keyz, "ephemeral_metadata_purge_age") == 0) {
+            getConfiguration().requirementsMetOrThrow(
+                    "ephemeral_metadata_purge_age");
+            getConfiguration().setEphemeralMetadataPurgeAge(std::stoull(valz));
         } else if (strcmp(keyz, "ephemeral_metadata_purge_interval") == 0) {
             getConfiguration().requirementsMetOrThrow("ephemeral_metadata_purge_interval");
             getConfiguration().setEphemeralMetadataPurgeInterval(
index d0f8618..80eb217 100644 (file)
@@ -6399,7 +6399,6 @@ static enum test_result test_mb19687_fixed(ENGINE_HANDLE* h,
                 "ep_defragmenter_enabled",
                 "ep_defragmenter_interval",
                 "ep_enable_chk_merge",
-                "ep_ephemeral_metadata_purge_age",
                 "ep_exp_pager_enabled",
                 "ep_exp_pager_initial_run_time",
                 "ep_exp_pager_stime",
@@ -6577,7 +6576,6 @@ static enum test_result test_mb19687_fixed(ENGINE_HANDLE* h,
                 "ep_diskqueue_memory",
                 "ep_diskqueue_pending",
                 "ep_enable_chk_merge",
-                "ep_ephemeral_metadata_purge_age",
                 "ep_exp_pager_enabled",
                 "ep_exp_pager_initial_run_time",
                 "ep_exp_pager_stime",
@@ -6887,6 +6885,7 @@ static enum test_result test_mb19687_fixed(ENGINE_HANDLE* h,
         auto& eng_stats = statsKeys.at("");
         eng_stats.insert(eng_stats.end(),
                          {"ep_ephemeral_full_policy",
+                          "ep_ephemeral_metadata_purge_age",
                           "ep_ephemeral_metadata_purge_interval",
 
                           "vb_active_auto_delete_count",
@@ -6929,9 +6928,9 @@ static enum test_result test_mb19687_fixed(ENGINE_HANDLE* h,
 
         auto& config_stats = statsKeys.at("config");
         config_stats.insert(config_stats.end(),
-                            std::initializer_list<std::string>{
-                                    "ep_ephemeral_full_policy",
-                                    "ep_ephemeral_metadata_purge_interval"});
+                            {"ep_ephemeral_full_policy",
+                             "ep_ephemeral_metadata_purge_age",
+                             "ep_ephemeral_metadata_purge_interval"});
     }
 
     if (isTapEnabled(h, h1)) {