MB-23267: Hide irrelavant config options 62/75962/14
authorJames Harrison <00jamesh@gmail.com>
Wed, 29 Mar 2017 09:42:38 +0000 (10:42 +0100)
committerDave Rigby <daver@couchbase.com>
Tue, 11 Apr 2017 11:07:03 +0000 (11:07 +0000)
Hides from stats and prevents changing through cbepctl of:
 * item_eviction_policy on ephemeral buckets
 * ep_alog_* on ephemeral buckets
 * ephemeral_full_policy on persistent buckets
 * ep_tap_* if tap is disabled

Change-Id: I70ed89b033b845ac6d02f965fd5dda9ce884185c
Reviewed-on: http://review.couchbase.org/75962
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
configuration.json
tests/ep_testsuite.cc
tests/ep_testsuite_basic.cc
tests/ep_testsuite_dcp.cc

index ce6cbbb..39bf143 100644 (file)
@@ -4,18 +4,27 @@
             "default": "4096",
             "descr": "Logging block size.",
             "dynamic": false,
-            "type": "size_t"
+            "type": "size_t",
+            "requires": {
+                "bucket_type": "persistent"
+            }
         },
         "alog_path": {
             "default": "",
             "descr": "Path to the access log.",
             "dynamic": false,
-            "type": "std::string"
+            "type": "std::string",
+            "requires": {
+                "bucket_type": "persistent"
+            }
         },
         "access_scanner_enabled": {
             "default": "true",
             "descr": "True if access scanner task is enabled",
-            "type": "bool"
+            "type": "bool",
+            "requires": {
+                "bucket_type": "persistent"
+            }
         },
         "alog_sleep_time": {
             "default": "1440",
@@ -26,6 +35,9 @@
                     "max": 4320,
                     "min": 1
                 }
+            },
+            "requires": {
+                "bucket_type": "persistent"
             }
         },
         "alog_task_time": {
@@ -37,6 +49,9 @@
                     "max": 23,
                     "min": 0
                 }
+            },
+            "requires": {
+                "bucket_type": "persistent"
             }
         },
         "alog_resident_ratio_threshold": {
@@ -49,6 +64,9 @@
                     "max": 100,
                     "min": 0
                 }
+            },
+            "requires": {
+                "bucket_type": "persistent"
             }
         },
         "alog_max_stored_items": {
@@ -60,6 +78,9 @@
                 "range": {
                     "min": 1
                 }
+            },
+            "requires": {
+                "bucket_type": "persistent"
             }
         },
         "backend": {
                     "auto_delete",
                     "fail_new_data"
                 ]
+            },
+            "requires": {
+                "bucket_type": "ephemeral"
             }
         },
         "ephemeral_metadata_purge_age": {
                     "value_only",
                     "full_eviction"
                 ]
+            },
+            "requires": {
+                "bucket_type": "persistent"
             }
         },
         "item_num_based_new_chk": {
         },
         "tap_ack_grace_period": {
             "default": "300",
-            "type": "size_t"
+            "type": "size_t",
+            "requires": {
+                "tap": true
+            }
         },
         "tap_ack_initial_sequence_number": {
             "default": "1",
-            "type": "size_t"
+            "type": "size_t",
+            "requires": {
+                "tap": true
+            }
         },
         "tap_ack_interval": {
             "default": "1000",
-            "type": "size_t"
+            "type": "size_t",
+            "requires": {
+                "tap": true
+            }
         },
         "tap_ack_window_size": {
             "default": "10",
-            "type": "size_t"
+            "type": "size_t",
+            "requires": {
+                "tap": true
+            }
         },
         "tap_backfill_resident": {
             "default": "0.9",
-            "type": "float"
+            "type": "float",
+            "requires": {
+                "tap": true
+            }
         },
         "tap_backlog_limit": {
             "default": "5000",
-            "type": "size_t"
+            "type": "size_t",
+            "requires": {
+                "tap": true
+            }
         },
         "tap_backoff_period": {
             "default": "5.0",
-            "type": "float"
+            "type": "float",
+            "requires": {
+                "tap": true
+            }
         },
         "tap_bg_max_pending": {
             "default": "500",
-            "type": "size_t"
+            "type": "size_t",
+            "requires": {
+                "tap": true
+            }
         },
         "tap_keepalive": {
             "default": "0",
-            "type": "size_t"
+            "type": "size_t",
+            "requires": {
+                "tap": true
+            }
         },
         "tap_noop_interval": {
             "default": "200",
             "descr": "Number of seconds between a noop is sent on an idle connection",
-            "type": "size_t"
+            "type": "size_t",
+            "requires": {
+                "tap": true
+            }
         },
         "tap_requeue_sleep_time": {
             "default": "0.1",
-            "type": "float"
+            "type": "float",
+            "requires": {
+                "tap": true
+            }
         },
         "replication_throttle_cap_pcnt": {
             "default": "10",
index 11176d3..f610538 100644 (file)
@@ -3625,7 +3625,7 @@ static enum test_result test_curr_items_add_set(ENGINE_HANDLE *h, ENGINE_HANDLE_
             store(h, h1, NULL, OPERATION_SET,"k3", "v3", &i),
             "Failed to fail to store an item.");
     h1->release(h, NULL, i);
-    if (is_full_eviction(h, h1)) {
+    if (isPersistentBucket(h, h1) && is_full_eviction(h, h1)) {
         // MB-21957: FE mode - curr_items is only valid once we flush documents
         wait_for_flusher_to_settle(h, h1);
     }
@@ -6352,13 +6352,6 @@ static enum test_result test_mb19687_fixed(ENGINE_HANDLE* h,
         },
         {"config",
             {
-                "ep_access_scanner_enabled",
-                "ep_alog_block_size",
-                "ep_alog_max_stored_items",
-                "ep_alog_path",
-                "ep_alog_resident_ratio_threshold",
-                "ep_alog_sleep_time",
-                "ep_alog_task_time",
                 "ep_backend",
                 "ep_backfill_mem_threshold",
                 "ep_bfilter_enabled",
@@ -6406,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_full_policy",
                 "ep_ephemeral_metadata_purge_age",
                 "ep_exp_pager_enabled",
                 "ep_exp_pager_initial_run_time",
@@ -6420,7 +6412,6 @@ static enum test_result test_mb19687_fixed(ENGINE_HANDLE* h,
                 "ep_ht_locks",
                 "ep_ht_size",
                 "ep_initfile",
-                "ep_item_eviction_policy",
                 "ep_item_num_based_new_chk",
                 "ep_keep_closed_chks",
                 "ep_max_checkpoints",
@@ -6449,17 +6440,6 @@ static enum test_result test_mb19687_fixed(ENGINE_HANDLE* h,
                 "ep_replication_throttle_queue_cap",
                 "ep_replication_throttle_threshold",
                 "ep_tap",
-                "ep_tap_ack_grace_period",
-                "ep_tap_ack_initial_sequence_number",
-                "ep_tap_ack_interval",
-                "ep_tap_ack_window_size",
-                "ep_tap_backfill_resident",
-                "ep_tap_backlog_limit",
-                "ep_tap_backoff_period",
-                "ep_tap_bg_max_pending",
-                "ep_tap_keepalive",
-                "ep_tap_noop_interval",
-                "ep_tap_requeue_sleep_time",
                 "ep_time_synchronization",
                 "ep_uuid",
                 "ep_vb0",
@@ -6515,7 +6495,6 @@ static enum test_result test_mb19687_fixed(ENGINE_HANDLE* h,
                 "curr_items",
                 "curr_items_tot",
                 "curr_temp_items",
-                "ep_access_scanner_enabled",
                 "ep_access_scanner_last_runtime",
                 "ep_access_scanner_num_items",
                 "ep_access_scanner_task_time",
@@ -6523,12 +6502,6 @@ static enum test_result test_mb19687_fixed(ENGINE_HANDLE* h,
                 "ep_active_behind_exceptions",
                 "ep_active_hlc_drift",
                 "ep_active_hlc_drift_count",
-                "ep_alog_block_size",
-                "ep_alog_max_stored_items",
-                "ep_alog_path",
-                "ep_alog_resident_ratio_threshold",
-                "ep_alog_sleep_time",
-                "ep_alog_task_time",
                 "ep_backend",
                 "ep_backfill_mem_threshold",
                 "ep_bfilter_enabled",
@@ -6596,7 +6569,6 @@ static enum test_result test_mb19687_fixed(ENGINE_HANDLE* h,
                 "ep_diskqueue_memory",
                 "ep_diskqueue_pending",
                 "ep_enable_chk_merge",
-                "ep_ephemeral_full_policy",
                 "ep_ephemeral_metadata_purge_age",
                 "ep_exp_pager_enabled",
                 "ep_exp_pager_initial_run_time",
@@ -6620,7 +6592,6 @@ static enum test_result test_mb19687_fixed(ENGINE_HANDLE* h,
                 "ep_io_compaction_write_bytes",
                 "ep_io_total_read_bytes",
                 "ep_io_total_write_bytes",
-                "ep_item_eviction_policy",
                 "ep_item_num",
                 "ep_item_num_based_new_chk",
                 "ep_items_rm_from_checkpoints",
@@ -6696,19 +6667,8 @@ static enum test_result test_mb19687_fixed(ENGINE_HANDLE* h,
                 "ep_storedval_overhead",
                 "ep_storedval_size",
                 "ep_tap",
-                "ep_tap_ack_grace_period",
-                "ep_tap_ack_initial_sequence_number",
-                "ep_tap_ack_interval",
-                "ep_tap_ack_window_size",
-                "ep_tap_backfill_resident",
-                "ep_tap_backlog_limit",
-                "ep_tap_backoff_period",
                 "ep_tap_bg_fetch_requeued",
                 "ep_tap_bg_fetched",
-                "ep_tap_bg_max_pending",
-                "ep_tap_keepalive",
-                "ep_tap_noop_interval",
-                "ep_tap_requeue_sleep_time",
                 "ep_time_synchronization",
                 "ep_tmp_oom_errors",
                 "ep_total_cache_size",
@@ -6839,6 +6799,30 @@ static enum test_result test_mb19687_fixed(ENGINE_HANDLE* h,
                           "ep_uncommitted_items",
                           "ep_chk_persistence_timeout"});
 
+        eng_stats.insert(eng_stats.end(),
+                         {"ep_commit_num",
+                          "ep_commit_time",
+                          "ep_commit_time_total",
+                          "ep_item_begin_failed",
+                          "ep_item_commit_failed",
+                          "ep_item_flush_expired",
+                          "ep_item_flush_failed",
+                          "ep_total_persisted",
+                          "ep_uncommitted_items",
+                          "ep_chk_persistence_timeout"});
+
+        // Config variables only valid for persistent
+        eng_stats.insert(eng_stats.end(),
+                         {"ep_access_scanner_enabled",
+                          "ep_alog_block_size",
+                          "ep_alog_max_stored_items",
+                          "ep_alog_path",
+                          "ep_alog_resident_ratio_threshold",
+                          "ep_alog_sleep_time",
+                          "ep_alog_task_time",
+                          "ep_item_eviction_policy",
+                          "ep_tap_requeue_sleep_time"});
+
         // 'diskinfo and 'diskinfo detail' keys should be present now.
         statsKeys["diskinfo"] = {"ep_db_data_size", "ep_db_file_size"};
         statsKeys["diskinfo detail"] = {"vb_0:data_size", "vb_0:file_size"};
@@ -6857,12 +6841,38 @@ static enum test_result test_mb19687_fixed(ENGINE_HANDLE* h,
         auto& vb_details = statsKeys.at("vbucket-details 0");
         vb_details.push_back("vb_0:db_data_size");
         vb_details.push_back("vb_0:db_file_size");
+
+        auto& config_stats = statsKeys.at("config");
+
+        // Config variables only valid for persistent
+        config_stats.insert(config_stats.end(),
+                            {"ep_access_scanner_enabled",
+                             "ep_alog_block_size",
+                             "ep_alog_max_stored_items",
+                             "ep_alog_path",
+                             "ep_alog_resident_ratio_threshold",
+                             "ep_alog_sleep_time",
+                             "ep_alog_task_time",
+                             "ep_item_eviction_policy",
+                             "ep_tap_ack_grace_period",
+                             "ep_tap_ack_initial_sequence_number",
+                             "ep_tap_ack_interval",
+                             "ep_tap_ack_window_size",
+                             "ep_tap_backfill_resident",
+                             "ep_tap_backlog_limit",
+                             "ep_tap_backoff_period",
+                             "ep_tap_bg_max_pending",
+                             "ep_tap_keepalive",
+                             "ep_tap_noop_interval",
+                             "ep_tap_requeue_sleep_time"});
     }
 
     if (isEphemeralBucket(h, h1)) {
         auto& eng_stats = statsKeys.at("");
         eng_stats.insert(eng_stats.end(),
-                         {"vb_active_auto_delete_count",
+                         {"ep_ephemeral_full_policy",
+
+                          "vb_active_auto_delete_count",
                           "vb_active_seqlist_count",
                           "vb_active_seqlist_deleted_count",
                           "vb_active_seqlist_read_range_count",
@@ -6899,6 +6909,9 @@ static enum test_result test_mb19687_fixed(ENGINE_HANDLE* h,
                            "vb_0:seqlist_stale_count",
                            "vb_0:seqlist_stale_metadata_bytes",
                            "vb_0:seqlist_stale_value_bytes"});
+
+        auto& config_stats = statsKeys.at("config");
+        config_stats.insert(config_stats.end(), {"ep_ephemeral_full_policy"});
     }
 
     if (isTapEnabled(h, h1)) {
index 4b399e3..7cd02c5 100644 (file)
@@ -261,7 +261,10 @@ static enum test_result test_whitespace_db(ENGINE_HANDLE *h,
            "Failed to get stats.");
 
     std::string dbname;
-    std::string policy = vals.find("ep_item_eviction_policy")->second;
+    std::string policy;
+    policy = isPersistentBucket(h, h1)
+                     ? vals.find("ep_item_eviction_policy")->second
+                     : "ephemeral";
     dbname.assign(policy + std::string(WHITESPACE_DB));
 
     std::string oldparam("dbname=" + vals["ep_dbname"]);
@@ -706,7 +709,14 @@ static enum test_result test_unl(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1) {
     checkeq(ENGINE_SUCCESS,
             h1->get_stats(h, NULL, NULL, 0, add_stats),
             "Failed to get stats.");
-    std::string eviction_policy = vals.find("ep_item_eviction_policy")->second;
+
+    std::string eviction_policy;
+    auto itr = vals.find("ep_item_eviction_policy");
+    if (itr != vals.end()) {
+        eviction_policy = itr->second;
+    } else {
+        eviction_policy = "value_only";
+    }
 
     if (eviction_policy == "full_eviction") {
         checkeq(ENGINE_TMPFAIL,
index 448be8a..a6d61d4 100644 (file)
@@ -1003,7 +1003,7 @@ static void dcp_waiting_step(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1,
 static enum test_result test_dcp_vbtakeover_no_stream(ENGINE_HANDLE *h,
                                                       ENGINE_HANDLE_V1 *h1) {
     write_items(h, h1, 10);
-    if (is_full_eviction(h, h1)) {
+    if (isPersistentBucket(h, h1) && is_full_eviction(h, h1)) {
         // MB-21646: FE mode - curr_items (which is part of "estimate") is
         // updated as part of flush, and thus if the writes are flushed in
         // blocks < 10 we may see an estimate < 10
@@ -4793,7 +4793,7 @@ static enum test_result test_dcp_erroneous_mutations(ENGINE_HANDLE *h,
 
     // Full Evictions: must wait for all items to have been flushed before
     // asserting item counts
-    if (is_full_eviction(h, h1)) {
+    if (isPersistentBucket(h, h1) && is_full_eviction(h, h1)) {
         wait_for_flusher_to_settle(h, h1);
     }