2017-05-26 04:48:44 +08:00
/*
2021-06-19 05:48:45 +08:00
* ClientKnobs . cpp
2017-05-26 04:48:44 +08:00
*
* This source file is part of the FoundationDB open source project
*
* Copyright 2013 - 2018 Apple Inc . and the FoundationDB project authors
2018-02-22 02:25:11 +08:00
*
2017-05-26 04:48:44 +08:00
* Licensed under the Apache License , Version 2.0 ( the " License " ) ;
* you may not use this file except in compliance with the License .
* You may obtain a copy of the License at
2018-02-22 02:25:11 +08:00
*
2017-05-26 04:48:44 +08:00
* http : //www.apache.org/licenses/LICENSE-2.0
2018-02-22 02:25:11 +08:00
*
2017-05-26 04:48:44 +08:00
* Unless required by applicable law or agreed to in writing , software
* distributed under the License is distributed on an " AS IS " BASIS ,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied .
* See the License for the specific language governing permissions and
* limitations under the License .
*/
2018-10-20 01:30:13 +08:00
# include "fdbclient/Knobs.h"
# include "fdbclient/FDBTypes.h"
# include "fdbclient/SystemData.h"
2020-04-02 13:04:39 +08:00
# include "flow/UnitTest.h"
2017-05-26 04:48:44 +08:00
2021-08-19 06:47:56 +08:00
# define init(...) KNOB_FN(__VA_ARGS__, INIT_ATOMIC_KNOB, INIT_KNOB)(__VA_ARGS__)
2021-06-10 11:50:00 +08:00
ClientKnobs : : ClientKnobs ( Randomize randomize ) {
initialize ( randomize ) ;
2020-04-02 04:59:06 +08:00
}
2021-07-03 12:41:50 +08:00
void ClientKnobs : : initialize ( Randomize randomize ) {
2020-04-01 07:42:00 +08:00
// clang-format off
2017-05-26 04:48:44 +08:00
init ( TOO_MANY , 1000000 ) ;
init ( SYSTEM_MONITOR_INTERVAL , 5.0 ) ;
2021-03-16 07:23:56 +08:00
init ( NETWORK_BUSYNESS_MONITOR_INTERVAL , 1.0 ) ;
2017-05-26 04:48:44 +08:00
2018-06-28 11:41:18 +08:00
init ( FAILURE_MAX_DELAY , 5.0 ) ;
init ( FAILURE_MIN_DELAY , 4.0 ) ; if ( randomize & & BUGGIFY ) FAILURE_MIN_DELAY = 1.0 ;
2017-05-26 04:48:44 +08:00
init ( FAILURE_TIMEOUT_DELAY , FAILURE_MIN_DELAY ) ;
2017-12-02 05:04:32 +08:00
init ( CLIENT_FAILURE_TIMEOUT_DELAY , FAILURE_MIN_DELAY ) ;
2018-10-06 04:25:54 +08:00
init ( FAILURE_EMERGENCY_DELAY , 30.0 ) ;
init ( FAILURE_MAX_GENERATIONS , 10 ) ;
2020-03-14 01:28:32 +08:00
init ( RECOVERY_DELAY_START_GENERATION , 70 ) ;
init ( RECOVERY_DELAY_SECONDS_PER_GENERATION , 60.0 ) ;
init ( MAX_GENERATIONS , 100 ) ;
init ( MAX_GENERATIONS_OVERRIDE , 0 ) ;
2021-04-29 03:41:48 +08:00
init ( MAX_GENERATIONS_SIM , 50 ) ; //Disable network connections after this many generations in simulation, should be less than RECOVERY_DELAY_START_GENERATION
2017-05-26 04:48:44 +08:00
2019-07-25 06:07:41 +08:00
init ( COORDINATOR_RECONNECTION_DELAY , 1.0 ) ;
2019-07-26 08:15:31 +08:00
init ( CLIENT_EXAMPLE_AMOUNT , 20 ) ;
init ( MAX_CLIENT_STATUS_AGE , 1.0 ) ;
2020-09-11 08:44:15 +08:00
init ( MAX_COMMIT_PROXY_CONNECTIONS , 5 ) ; if ( randomize & & BUGGIFY ) MAX_COMMIT_PROXY_CONNECTIONS = 1 ;
2020-07-15 15:37:41 +08:00
init ( MAX_GRV_PROXY_CONNECTIONS , 3 ) ; if ( randomize & & BUGGIFY ) MAX_GRV_PROXY_CONNECTIONS = 1 ;
2020-01-23 07:41:22 +08:00
init ( STATUS_IDLE_TIMEOUT , 120.0 ) ;
2019-07-25 06:07:41 +08:00
2017-05-26 04:48:44 +08:00
// wrong_shard_server sometimes comes from the only nonfailed server, so we need to avoid a fast spin
2019-05-11 05:01:52 +08:00
init ( WRONG_SHARD_SERVER_DELAY , .01 ) ; if ( randomize & & BUGGIFY ) WRONG_SHARD_SERVER_DELAY = deterministicRandom ( ) - > random01 ( ) ; // FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY; // SOMEDAY: This delay can limit performance of retrieving data when the cache is mostly wrong (e.g. dumping the database after a test)
init ( FUTURE_VERSION_RETRY_DELAY , .01 ) ; if ( randomize & & BUGGIFY ) FUTURE_VERSION_RETRY_DELAY = deterministicRandom ( ) - > random01 ( ) ; // FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY;
2017-09-16 02:01:56 +08:00
init ( REPLY_BYTE_LIMIT , 80000 ) ;
2019-05-11 05:01:52 +08:00
init ( DEFAULT_BACKOFF , .01 ) ; if ( randomize & & BUGGIFY ) DEFAULT_BACKOFF = deterministicRandom ( ) - > random01 ( ) ;
2017-05-26 04:48:44 +08:00
init ( DEFAULT_MAX_BACKOFF , 1.0 ) ;
init ( BACKOFF_GROWTH_RATE , 2.0 ) ;
2018-06-02 06:21:40 +08:00
init ( RESOURCE_CONSTRAINED_MAX_BACKOFF , 30.0 ) ;
2018-11-03 03:52:34 +08:00
init ( PROXY_COMMIT_OVERHEAD_BYTES , 23 ) ; //The size of serializing 7 tags (3 primary, 3 remote, 1 log router) + 2 for the tag length
2020-08-05 11:57:25 +08:00
init ( SHARD_STAT_SMOOTH_AMOUNT , 5.0 ) ;
init ( INIT_MID_SHARD_BYTES , 200000 ) ; if ( randomize & & BUGGIFY ) INIT_MID_SHARD_BYTES = 40000 ; // The same value as SERVER_KNOBS->MIN_SHARD_BYTES
2017-05-26 04:48:44 +08:00
init ( TRANSACTION_SIZE_LIMIT , 1e7 ) ;
init ( KEY_SIZE_LIMIT , 1e4 ) ;
2018-01-04 04:05:12 +08:00
init ( SYSTEM_KEY_SIZE_LIMIT , 3e4 ) ;
2017-05-26 04:48:44 +08:00
init ( VALUE_SIZE_LIMIT , 1e5 ) ;
2021-10-15 03:58:37 +08:00
init ( SPLIT_KEY_SIZE_LIMIT , KEY_SIZE_LIMIT / 2 ) ; if ( randomize & & BUGGIFY ) SPLIT_KEY_SIZE_LIMIT = KEY_SIZE_LIMIT - 31 ; //serverKeysPrefixFor(UID()).size() - 1;
2019-03-01 09:45:00 +08:00
init ( METADATA_VERSION_CACHE_SIZE , 1000 ) ;
2021-10-20 04:56:52 +08:00
init ( CHANGE_FEED_LOCATION_LIMIT , 10000 ) ;
init ( CHANGE_FEED_CACHE_SIZE , 100000 ) ; if ( randomize & & BUGGIFY ) CHANGE_FEED_CACHE_SIZE = 1 ;
init ( CHANGE_FEED_POP_TIMEOUT , 5.0 ) ;
2017-05-26 04:48:44 +08:00
2019-03-19 07:09:57 +08:00
init ( MAX_BATCH_SIZE , 1000 ) ; if ( randomize & & BUGGIFY ) MAX_BATCH_SIZE = 1 ;
2017-05-26 04:48:44 +08:00
init ( GRV_BATCH_TIMEOUT , 0.005 ) ; if ( randomize & & BUGGIFY ) GRV_BATCH_TIMEOUT = 0.1 ;
2019-03-23 07:05:20 +08:00
init ( BROADCAST_BATCH_SIZE , 20 ) ; if ( randomize & & BUGGIFY ) BROADCAST_BATCH_SIZE = 1 ;
2019-11-14 04:49:07 +08:00
init ( TRANSACTION_TIMEOUT_DELAY_INTERVAL , 10.0 ) ; if ( randomize & & BUGGIFY ) TRANSACTION_TIMEOUT_DELAY_INTERVAL = 1.0 ;
2017-05-26 04:48:44 +08:00
2019-10-02 05:31:48 +08:00
init ( LOCATION_CACHE_EVICTION_SIZE , 600000 ) ;
2017-05-26 04:48:44 +08:00
init ( LOCATION_CACHE_EVICTION_SIZE_SIM , 10 ) ; if ( randomize & & BUGGIFY ) LOCATION_CACHE_EVICTION_SIZE_SIM = 3 ;
init ( GET_RANGE_SHARD_LIMIT , 2 ) ;
2018-01-13 02:51:53 +08:00
init ( WARM_RANGE_SHARD_LIMIT , 100 ) ;
init ( STORAGE_METRICS_SHARD_LIMIT , 100 ) ; if ( randomize & & BUGGIFY ) STORAGE_METRICS_SHARD_LIMIT = 3 ;
2020-01-16 01:33:27 +08:00
init ( SHARD_COUNT_LIMIT , 80 ) ; if ( randomize & & BUGGIFY ) SHARD_COUNT_LIMIT = 3 ;
2017-05-26 04:48:44 +08:00
init ( STORAGE_METRICS_UNFAIR_SPLIT_LIMIT , 2.0 / 3.0 ) ;
init ( STORAGE_METRICS_TOO_MANY_SHARDS_DELAY , 15.0 ) ;
2019-03-05 06:16:39 +08:00
init ( AGGREGATE_HEALTH_METRICS_MAX_STALENESS , 0.5 ) ;
init ( DETAILED_HEALTH_METRICS_MAX_STALENESS , 5.0 ) ;
2020-08-10 14:42:30 +08:00
init ( MID_SHARD_SIZE_MAX_STALENESS , 10.0 ) ;
2020-09-01 00:29:46 +08:00
init ( TAG_ENCODE_KEY_SERVERS , false ) ; if ( randomize & & BUGGIFY ) TAG_ENCODE_KEY_SERVERS = true ;
2021-06-20 00:47:13 +08:00
init ( RANGESTREAM_FRAGMENT_SIZE , 1e6 ) ;
init ( RANGESTREAM_BUFFERED_FRAGMENTS_LIMIT , 20 ) ;
2021-06-08 03:54:24 +08:00
init ( QUARANTINE_TSS_ON_MISMATCH , true ) ; if ( randomize & & BUGGIFY ) QUARANTINE_TSS_ON_MISMATCH = false ; // if true, a tss mismatch will put the offending tss in quarantine. If false, it will just be killed
2017-05-26 04:48:44 +08:00
//KeyRangeMap
init ( KRM_GET_RANGE_LIMIT , 1e5 ) ; if ( randomize & & BUGGIFY ) KRM_GET_RANGE_LIMIT = 10 ;
init ( KRM_GET_RANGE_LIMIT_BYTES , 1e8 ) ; if ( randomize & & BUGGIFY ) KRM_GET_RANGE_LIMIT_BYTES = 10000 ; //This must be sufficiently larger than KEY_SIZE_LIMIT to ensure that at least two entries will be returned from an attempt to read a key range map
init ( DEFAULT_MAX_OUTSTANDING_WATCHES , 1e4 ) ;
init ( ABSOLUTE_MAX_WATCHES , 1e6 ) ;
init ( WATCH_POLLING_TIME , 1.0 ) ; if ( randomize & & BUGGIFY ) WATCH_POLLING_TIME = 5.0 ;
2017-10-20 06:36:32 +08:00
init ( NO_RECENT_UPDATES_DURATION , 20.0 ) ; if ( randomize & & BUGGIFY ) NO_RECENT_UPDATES_DURATION = 0.1 ;
init ( FAST_WATCH_TIMEOUT , 20.0 ) ; if ( randomize & & BUGGIFY ) FAST_WATCH_TIMEOUT = 1.0 ;
2020-10-01 02:52:51 +08:00
init ( WATCH_TIMEOUT , 30.0 ) ; if ( randomize & & BUGGIFY ) WATCH_TIMEOUT = 20.0 ;
2017-05-26 04:48:44 +08:00
// Core
init ( CORE_VERSIONSPERSECOND , 1e6 ) ;
2021-06-17 02:34:20 +08:00
init ( LOG_RANGE_BLOCK_SIZE , CORE_VERSIONSPERSECOND ) ;
init ( MUTATION_BLOCK_SIZE , 10000 ) ;
2017-05-26 04:48:44 +08:00
// TaskBucket
2019-11-13 11:15:56 +08:00
init ( TASKBUCKET_LOGGING_DELAY , 5.0 ) ;
2017-05-26 04:48:44 +08:00
init ( TASKBUCKET_MAX_PRIORITY , 1 ) ;
2018-01-25 09:40:02 +08:00
init ( TASKBUCKET_CHECK_TIMEOUT_CHANCE , 0.02 ) ; if ( randomize & & BUGGIFY ) TASKBUCKET_CHECK_TIMEOUT_CHANCE = 1.0 ;
2017-05-26 04:48:44 +08:00
init ( TASKBUCKET_TIMEOUT_JITTER_OFFSET , 0.9 ) ;
init ( TASKBUCKET_TIMEOUT_JITTER_RANGE , 0.2 ) ;
init ( TASKBUCKET_CHECK_ACTIVE_DELAY , 0.5 ) ;
init ( TASKBUCKET_CHECK_ACTIVE_AMOUNT , 10 ) ;
init ( TASKBUCKET_TIMEOUT_VERSIONS , 60 * CORE_VERSIONSPERSECOND ) ; if ( randomize & & BUGGIFY ) TASKBUCKET_TIMEOUT_VERSIONS = 30 * CORE_VERSIONSPERSECOND ;
2018-01-25 09:40:02 +08:00
init ( TASKBUCKET_MAX_TASK_KEYS , 1000 ) ; if ( randomize & & BUGGIFY ) TASKBUCKET_MAX_TASK_KEYS = 20 ;
2017-05-26 04:48:44 +08:00
//Backup
2021-03-11 05:30:47 +08:00
init ( BACKUP_LOCAL_FILE_WRITE_BLOCK , 1024 * 1024 ) ;
2018-03-09 03:27:15 +08:00
init ( BACKUP_CONCURRENT_DELETES , 100 ) ;
2017-05-26 04:48:44 +08:00
init ( BACKUP_SIMULATED_LIMIT_BYTES , 1e6 ) ; if ( randomize & & BUGGIFY ) BACKUP_SIMULATED_LIMIT_BYTES = 1000 ;
init ( BACKUP_GET_RANGE_LIMIT_BYTES , 1e6 ) ;
init ( BACKUP_LOCK_BYTES , 1e8 ) ;
init ( BACKUP_RANGE_TIMEOUT , TASKBUCKET_TIMEOUT_VERSIONS / CORE_VERSIONSPERSECOND / 2.0 ) ;
init ( BACKUP_RANGE_MINWAIT , std : : max ( 1.0 , BACKUP_RANGE_TIMEOUT / 2.0 ) ) ;
2019-03-05 20:00:11 +08:00
init ( BACKUP_SNAPSHOT_DISPATCH_INTERVAL_SEC , 10 * 60 ) ; // 10 minutes
2017-12-20 16:49:08 +08:00
init ( BACKUP_DEFAULT_SNAPSHOT_INTERVAL_SEC , 3600 * 24 * 10 ) ; // 10 days
2017-05-26 04:48:44 +08:00
init ( BACKUP_SHARD_TASK_LIMIT , 1000 ) ; if ( randomize & & BUGGIFY ) BACKUP_SHARD_TASK_LIMIT = 4 ;
init ( BACKUP_AGGREGATE_POLL_RATE_UPDATE_INTERVAL , 60 ) ;
init ( BACKUP_AGGREGATE_POLL_RATE , 2.0 ) ; // polls per second target for all agents on the cluster
init ( BACKUP_LOG_WRITE_BATCH_MAX_SIZE , 1e6 ) ; //Must be much smaller than TRANSACTION_SIZE_LIMIT
init ( BACKUP_LOG_ATOMIC_OPS_SIZE , 1000 ) ;
init ( BACKUP_OPERATION_COST_OVERHEAD , 50 ) ;
init ( BACKUP_MAX_LOG_RANGES , 21 ) ; if ( randomize & & BUGGIFY ) BACKUP_MAX_LOG_RANGES = 4 ;
init ( BACKUP_SIM_COPY_LOG_RANGES , 100 ) ;
init ( BACKUP_VERSION_DELAY , 5 * CORE_VERSIONSPERSECOND ) ;
bool buggifyMapLimits = randomize & & BUGGIFY ;
init ( BACKUP_MAP_KEY_LOWER_LIMIT , 1e4 ) ; if ( buggifyMapLimits ) BACKUP_MAP_KEY_LOWER_LIMIT = 4 ;
init ( BACKUP_MAP_KEY_UPPER_LIMIT , 1e5 ) ; if ( buggifyMapLimits ) BACKUP_MAP_KEY_UPPER_LIMIT = 30 ;
init ( BACKUP_COPY_TASKS , 90 ) ;
init ( BACKUP_BLOCK_SIZE , LOG_RANGE_BLOCK_SIZE / 10 ) ;
2020-07-03 16:36:20 +08:00
init ( COPY_LOG_BLOCK_SIZE , LOG_RANGE_BLOCK_SIZE ) ; // the maximum possible value due the getLogRanges limitations
2020-07-05 02:40:57 +08:00
init ( COPY_LOG_BLOCKS_PER_TASK , 1000 ) ;
init ( COPY_LOG_PREFETCH_BLOCKS , 3 ) ;
2020-07-03 16:36:20 +08:00
init ( COPY_LOG_READ_AHEAD_BYTES , BACKUP_LOCK_BYTES / COPY_LOG_PREFETCH_BLOCKS ) ; // each task will use up to COPY_LOG_PREFETCH_BLOCKS * COPY_LOG_READ_AHEAD_BYTES memory
2020-07-05 02:40:57 +08:00
init ( COPY_LOG_TASK_DURATION_NANOS , 1e10 ) ; // 10 seconds
2018-06-13 04:15:24 +08:00
init ( BACKUP_TASKS_PER_AGENT , 10 ) ;
2020-03-28 08:12:50 +08:00
init ( BACKUP_POLL_PROGRESS_SECONDS , 10 ) ;
init ( VERSIONS_PER_SECOND , 1e6 ) ; // Must be the same as SERVER_KNOBS->VERSIONS_PER_SECOND
2017-05-26 04:48:44 +08:00
init ( SIM_BACKUP_TASKS_PER_AGENT , 10 ) ;
init ( BACKUP_RANGEFILE_BLOCK_SIZE , 1024 * 1024 ) ;
init ( BACKUP_LOGFILE_BLOCK_SIZE , 1024 * 1024 ) ;
2018-01-17 02:45:21 +08:00
init ( BACKUP_DISPATCH_ADDTASK_SIZE , 50 ) ;
2018-01-23 07:04:14 +08:00
init ( RESTORE_DISPATCH_ADDTASK_SIZE , 150 ) ;
2018-05-12 04:26:32 +08:00
init ( RESTORE_DISPATCH_BATCH_SIZE , 30000 ) ; if ( randomize & & BUGGIFY ) RESTORE_DISPATCH_BATCH_SIZE = 20 ;
2017-05-26 04:48:44 +08:00
init ( RESTORE_WRITE_TX_SIZE , 256 * 1024 ) ;
init ( APPLY_MAX_LOCK_BYTES , 1e9 ) ;
init ( APPLY_MIN_LOCK_BYTES , 11e6 ) ; //Must be bigger than TRANSACTION_SIZE_LIMIT
init ( APPLY_BLOCK_SIZE , LOG_RANGE_BLOCK_SIZE / 5 ) ;
init ( APPLY_MAX_DECAY_RATE , 0.99 ) ;
init ( APPLY_MAX_INCREASE_FACTOR , 1.1 ) ;
init ( BACKUP_ERROR_DELAY , 10.0 ) ;
init ( BACKUP_STATUS_DELAY , 40.0 ) ;
init ( BACKUP_STATUS_JITTER , 0.05 ) ;
2019-09-28 09:32:27 +08:00
init ( MIN_CLEANUP_SECONDS , 3600.0 ) ;
2021-05-30 23:28:26 +08:00
init ( FASTRESTORE_ATOMICOP_WEIGHT , 1 ) ; if ( randomize & & BUGGIFY ) { FASTRESTORE_ATOMICOP_WEIGHT = deterministicRandom ( ) - > random01 ( ) * 200 + 1 ; }
2017-05-26 04:48:44 +08:00
// Configuration
2020-09-16 13:29:49 +08:00
init ( DEFAULT_AUTO_COMMIT_PROXIES , 3 ) ;
2020-08-06 15:01:57 +08:00
init ( DEFAULT_AUTO_GRV_PROXIES , 1 ) ;
2017-05-26 04:48:44 +08:00
init ( DEFAULT_AUTO_RESOLVERS , 1 ) ;
init ( DEFAULT_AUTO_LOGS , 3 ) ;
2020-09-26 01:49:56 +08:00
init ( DEFAULT_COMMIT_GRV_PROXIES_RATIO , 3 ) ;
init ( DEFAULT_MAX_GRV_PROXIES , 4 ) ;
2017-05-26 04:48:44 +08:00
init ( IS_ACCEPTABLE_DELAY , 1.5 ) ;
init ( HTTP_READ_SIZE , 128 * 1024 ) ;
init ( HTTP_SEND_SIZE , 32 * 1024 ) ;
init ( HTTP_VERBOSE_LEVEL , 0 ) ;
2019-01-09 06:48:47 +08:00
init ( HTTP_REQUEST_ID_HEADER , " " ) ;
2017-09-30 05:59:24 +08:00
init ( BLOBSTORE_CONNECT_TRIES , 10 ) ;
2017-05-26 04:48:44 +08:00
init ( BLOBSTORE_CONNECT_TIMEOUT , 10 ) ;
2017-10-16 12:51:11 +08:00
init ( BLOBSTORE_MAX_CONNECTION_LIFE , 120 ) ;
2017-05-26 04:48:44 +08:00
init ( BLOBSTORE_REQUEST_TRIES , 10 ) ;
2020-07-20 08:30:58 +08:00
init ( BLOBSTORE_REQUEST_TIMEOUT_MIN , 60 ) ;
2017-05-26 04:48:44 +08:00
2017-09-30 05:59:24 +08:00
init ( BLOBSTORE_CONCURRENT_UPLOADS , BACKUP_TASKS_PER_AGENT * 2 ) ;
2018-01-06 15:06:39 +08:00
init ( BLOBSTORE_CONCURRENT_LISTS , 20 ) ;
init ( BLOBSTORE_CONCURRENT_REQUESTS , BLOBSTORE_CONCURRENT_UPLOADS + BLOBSTORE_CONCURRENT_LISTS + 5 ) ;
2017-05-26 04:48:44 +08:00
2017-10-18 20:51:30 +08:00
init ( BLOBSTORE_CONCURRENT_WRITES_PER_FILE , 5 ) ;
2017-05-26 04:48:44 +08:00
init ( BLOBSTORE_CONCURRENT_READS_PER_FILE , 3 ) ;
init ( BLOBSTORE_READ_BLOCK_SIZE , 1024 * 1024 ) ;
init ( BLOBSTORE_READ_AHEAD_BLOCKS , 0 ) ;
init ( BLOBSTORE_READ_CACHE_BLOCKS_PER_FILE , 2 ) ;
init ( BLOBSTORE_MULTIPART_MAX_PART_SIZE , 20000000 ) ;
init ( BLOBSTORE_MULTIPART_MIN_PART_SIZE , 5242880 ) ;
// These are basically unlimited by default but can be used to reduce blob IO if needed
2017-09-30 05:59:24 +08:00
init ( BLOBSTORE_REQUESTS_PER_SECOND , 200 ) ;
2017-05-26 04:48:44 +08:00
init ( BLOBSTORE_MAX_SEND_BYTES_PER_SECOND , 1e9 ) ;
init ( BLOBSTORE_MAX_RECV_BYTES_PER_SECOND , 1e9 ) ;
2018-08-10 09:43:02 +08:00
init ( BLOBSTORE_LIST_REQUESTS_PER_SECOND , 200 ) ;
2018-06-21 11:34:34 +08:00
init ( BLOBSTORE_WRITE_REQUESTS_PER_SECOND , 50 ) ;
init ( BLOBSTORE_READ_REQUESTS_PER_SECOND , 100 ) ;
2018-06-22 02:13:31 +08:00
init ( BLOBSTORE_DELETE_REQUESTS_PER_SECOND , 200 ) ;
2018-06-21 11:34:34 +08:00
2017-05-26 04:48:44 +08:00
// Client Status Info
init ( CSI_SAMPLING_PROBABILITY , - 1.0 ) ;
init ( CSI_SIZE_LIMIT , std : : numeric_limits < int64_t > : : max ( ) ) ;
if ( randomize & & BUGGIFY ) {
2019-05-11 05:01:52 +08:00
CSI_SAMPLING_PROBABILITY = deterministicRandom ( ) - > random01 ( ) / 10 ; // rand range 0 - 0.1
CSI_SIZE_LIMIT = deterministicRandom ( ) - > randomInt ( 1024 * 1024 , 100 * 1024 * 1024 ) ; // 1 MB - 100 MB
2017-05-26 04:48:44 +08:00
}
init ( CSI_STATUS_DELAY , 10.0 ) ;
2020-01-11 04:51:37 +08:00
init ( CONSISTENCY_CHECK_RATE_LIMIT_MAX , 50e6 ) ; // Limit in per sec
2019-02-08 08:08:39 +08:00
init ( CONSISTENCY_CHECK_ONE_ROUND_TARGET_COMPLETION_TIME , 7 * 24 * 60 * 60 ) ; // 7 days
2020-02-21 02:43:34 +08:00
//fdbcli
init ( CLI_CONNECT_PARALLELISM , 400 ) ;
init ( CLI_CONNECT_TIMEOUT , 10.0 ) ;
2020-04-01 07:42:00 +08:00
// trace
2020-04-04 04:19:13 +08:00
init ( TRACE_LOG_FILE_IDENTIFIER_MAX_LENGTH , 50 ) ;
2020-04-10 07:55:56 +08:00
// transaction tags
2020-05-05 01:37:53 +08:00
init ( MAX_TAGS_PER_TRANSACTION , 5 ) ;
init ( MAX_TRANSACTION_TAG_LENGTH , 16 ) ;
2020-08-13 01:49:12 +08:00
init ( COMMIT_SAMPLE_COST , 100 ) ; if ( randomize & & BUGGIFY ) COMMIT_SAMPLE_COST = 10 ;
2020-08-18 04:01:19 +08:00
init ( WRITE_COST_BYTE_FACTOR , 16384 ) ; if ( randomize & & BUGGIFY ) WRITE_COST_BYTE_FACTOR = 4096 ;
2020-08-04 11:18:05 +08:00
init ( INCOMPLETE_SHARD_PLUS , 4096 ) ;
2020-05-08 00:15:33 +08:00
init ( READ_TAG_SAMPLE_RATE , 0.01 ) ; if ( randomize & & BUGGIFY ) READ_TAG_SAMPLE_RATE = 1.0 ; // Communicated to clients from cluster
2020-04-30 05:26:29 +08:00
init ( TAG_THROTTLE_SMOOTHING_WINDOW , 2.0 ) ;
init ( TAG_THROTTLE_RECHECK_INTERVAL , 5.0 ) ; if ( randomize & & BUGGIFY ) TAG_THROTTLE_RECHECK_INTERVAL = 0.0 ;
2020-04-24 11:50:40 +08:00
init ( TAG_THROTTLE_EXPIRATION_INTERVAL , 60.0 ) ; if ( randomize & & BUGGIFY ) TAG_THROTTLE_EXPIRATION_INTERVAL = 1.0 ;
2020-04-10 07:55:56 +08:00
2021-08-28 07:29:15 +08:00
// busyness reporting
init ( BUSYNESS_SPIKE_START_THRESHOLD , 0.100 ) ;
init ( BUSYNESS_SPIKE_SATURATED_THRESHOLD , 0.500 ) ;
2021-10-14 01:26:27 +08:00
// blob granules
2021-10-15 03:58:37 +08:00
init ( ENABLE_BLOB_GRANULES , false ) ;
2021-10-14 01:26:27 +08:00
2020-04-01 07:42:00 +08:00
// clang-format on
2017-05-26 04:48:44 +08:00
}
2020-04-02 13:04:39 +08:00
TEST_CASE ( " /fdbclient/knobs/initialize " ) {
// This test depends on TASKBUCKET_TIMEOUT_VERSIONS being defined as a constant multiple of CORE_VERSIONSPERSECOND
2021-07-17 15:11:40 +08:00
ClientKnobs clientKnobs ( Randomize : : False ) ;
2021-06-06 23:46:46 +08:00
int64_t initialCoreVersionsPerSecond = clientKnobs . CORE_VERSIONSPERSECOND ;
2020-04-02 13:04:39 +08:00
int initialTaskBucketTimeoutVersions = clientKnobs . TASKBUCKET_TIMEOUT_VERSIONS ;
2021-06-08 05:32:51 +08:00
clientKnobs . setKnob ( " core_versionspersecond " , initialCoreVersionsPerSecond * 2 ) ;
2021-06-06 23:46:46 +08:00
ASSERT_EQ ( clientKnobs . CORE_VERSIONSPERSECOND , initialCoreVersionsPerSecond * 2 ) ;
ASSERT_EQ ( clientKnobs . TASKBUCKET_TIMEOUT_VERSIONS , initialTaskBucketTimeoutVersions ) ;
2021-07-17 15:11:40 +08:00
clientKnobs . initialize ( Randomize : : False ) ;
2021-06-06 23:46:46 +08:00
ASSERT_EQ ( clientKnobs . CORE_VERSIONSPERSECOND , initialCoreVersionsPerSecond * 2 ) ;
ASSERT_EQ ( clientKnobs . TASKBUCKET_TIMEOUT_VERSIONS , initialTaskBucketTimeoutVersions * 2 ) ;
2020-04-02 13:04:39 +08:00
return Void ( ) ;
}