2017-05-26 04:48:44 +08:00
|
|
|
/*
|
|
|
|
* Knobs.h
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef FDBCLIENT_KNOBS_H
|
|
|
|
#define FDBCLIENT_KNOBS_H
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "flow/Knobs.h"
|
|
|
|
#include "flow/flow.h"
|
|
|
|
|
|
|
|
class ClientKnobs : public Knobs {
|
|
|
|
public:
|
|
|
|
int TOO_MANY; // FIXME: this should really be split up so we can control these more specifically
|
|
|
|
|
|
|
|
double SYSTEM_MONITOR_INTERVAL;
|
2021-03-18 02:16:18 +08:00
|
|
|
double NETWORK_BUSYNESS_MONITOR_INTERVAL; // The interval in which we should update the network busyness metric
|
2017-05-26 04:48:44 +08:00
|
|
|
|
|
|
|
double FAILURE_MAX_DELAY;
|
|
|
|
double FAILURE_MIN_DELAY;
|
|
|
|
double FAILURE_TIMEOUT_DELAY;
|
2017-12-02 05:04:32 +08:00
|
|
|
double CLIENT_FAILURE_TIMEOUT_DELAY;
|
2018-09-01 01:51:55 +08:00
|
|
|
double FAILURE_EMERGENCY_DELAY;
|
|
|
|
double FAILURE_MAX_GENERATIONS;
|
2020-03-14 01:28:32 +08:00
|
|
|
double RECOVERY_DELAY_START_GENERATION;
|
|
|
|
double RECOVERY_DELAY_SECONDS_PER_GENERATION;
|
|
|
|
double MAX_GENERATIONS;
|
|
|
|
double MAX_GENERATIONS_OVERRIDE;
|
2021-04-29 03:41:48 +08:00
|
|
|
double MAX_GENERATIONS_SIM;
|
2017-05-26 04:48:44 +08:00
|
|
|
|
2019-07-25 06:07:41 +08:00
|
|
|
double COORDINATOR_RECONNECTION_DELAY;
|
2019-07-26 08:15:31 +08:00
|
|
|
int CLIENT_EXAMPLE_AMOUNT;
|
|
|
|
double MAX_CLIENT_STATUS_AGE;
|
2020-09-11 08:44:15 +08:00
|
|
|
int MAX_COMMIT_PROXY_CONNECTIONS;
|
2020-07-15 15:37:41 +08:00
|
|
|
int MAX_GRV_PROXY_CONNECTIONS;
|
2020-01-23 07:41:22 +08:00
|
|
|
double STATUS_IDLE_TIMEOUT;
|
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
|
2021-03-11 02:06:03 +08:00
|
|
|
double WRONG_SHARD_SERVER_DELAY; // SOMEDAY: This delay can limit performance of retrieving data when the cache is
|
|
|
|
// mostly wrong (e.g. dumping the database after a test)
|
2017-05-26 04:48:44 +08:00
|
|
|
double FUTURE_VERSION_RETRY_DELAY;
|
|
|
|
int REPLY_BYTE_LIMIT;
|
|
|
|
double DEFAULT_BACKOFF;
|
|
|
|
double DEFAULT_MAX_BACKOFF;
|
|
|
|
double BACKOFF_GROWTH_RATE;
|
2018-06-02 06:21:40 +08:00
|
|
|
double RESOURCE_CONSTRAINED_MAX_BACKOFF;
|
2018-11-03 03:52:34 +08:00
|
|
|
int PROXY_COMMIT_OVERHEAD_BYTES;
|
2020-08-05 11:57:25 +08:00
|
|
|
double SHARD_STAT_SMOOTH_AMOUNT;
|
|
|
|
int INIT_MID_SHARD_BYTES;
|
2017-05-26 04:48:44 +08:00
|
|
|
|
2019-06-19 22:40:54 +08:00
|
|
|
int TRANSACTION_SIZE_LIMIT;
|
2017-05-26 04:48:44 +08:00
|
|
|
int64_t KEY_SIZE_LIMIT;
|
|
|
|
int64_t SYSTEM_KEY_SIZE_LIMIT;
|
|
|
|
int64_t VALUE_SIZE_LIMIT;
|
|
|
|
int64_t SPLIT_KEY_SIZE_LIMIT;
|
2019-03-01 09:45:00 +08:00
|
|
|
int METADATA_VERSION_CACHE_SIZE;
|
2017-05-26 04:48:44 +08:00
|
|
|
|
|
|
|
int MAX_BATCH_SIZE;
|
|
|
|
double GRV_BATCH_TIMEOUT;
|
2019-03-23 07:05:20 +08:00
|
|
|
int BROADCAST_BATCH_SIZE;
|
2019-11-14 04:49:07 +08:00
|
|
|
double TRANSACTION_TIMEOUT_DELAY_INTERVAL;
|
2017-05-26 04:48:44 +08:00
|
|
|
|
|
|
|
// When locationCache in DatabaseContext gets to be this size, items will be evicted
|
|
|
|
int LOCATION_CACHE_EVICTION_SIZE;
|
|
|
|
int LOCATION_CACHE_EVICTION_SIZE_SIM;
|
|
|
|
|
|
|
|
int GET_RANGE_SHARD_LIMIT;
|
|
|
|
int WARM_RANGE_SHARD_LIMIT;
|
|
|
|
int STORAGE_METRICS_SHARD_LIMIT;
|
2020-01-16 01:33:27 +08:00
|
|
|
int SHARD_COUNT_LIMIT;
|
2017-05-26 04:48:44 +08:00
|
|
|
double STORAGE_METRICS_UNFAIR_SPLIT_LIMIT;
|
|
|
|
double STORAGE_METRICS_TOO_MANY_SHARDS_DELAY;
|
2019-03-05 06:16:39 +08:00
|
|
|
double AGGREGATE_HEALTH_METRICS_MAX_STALENESS;
|
|
|
|
double DETAILED_HEALTH_METRICS_MAX_STALENESS;
|
2020-08-05 11:57:25 +08:00
|
|
|
double MID_SHARD_SIZE_MAX_STALENESS;
|
2020-05-23 00:25:32 +08:00
|
|
|
bool TAG_ENCODE_KEY_SERVERS;
|
2017-05-26 04:48:44 +08:00
|
|
|
|
2021-03-11 02:06:03 +08:00
|
|
|
// KeyRangeMap
|
2017-05-26 04:48:44 +08:00
|
|
|
int KRM_GET_RANGE_LIMIT;
|
2021-03-11 02:06:03 +08:00
|
|
|
int KRM_GET_RANGE_LIMIT_BYTES; // 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
|
2017-05-26 04:48:44 +08:00
|
|
|
|
|
|
|
int DEFAULT_MAX_OUTSTANDING_WATCHES;
|
2021-03-11 02:06:03 +08:00
|
|
|
int ABSOLUTE_MAX_WATCHES; // The client cannot set the max outstanding watches higher than this
|
2017-05-26 04:48:44 +08:00
|
|
|
double WATCH_POLLING_TIME;
|
2017-10-20 06:36:32 +08:00
|
|
|
double NO_RECENT_UPDATES_DURATION;
|
|
|
|
double FAST_WATCH_TIMEOUT;
|
|
|
|
double WATCH_TIMEOUT;
|
2017-05-26 04:48:44 +08:00
|
|
|
|
|
|
|
double IS_ACCEPTABLE_DELAY;
|
|
|
|
|
|
|
|
// Core
|
2021-03-11 02:06:03 +08:00
|
|
|
int64_t CORE_VERSIONSPERSECOND; // This is defined within the server but used for knobs based on server value
|
2017-05-26 04:48:44 +08:00
|
|
|
int LOG_RANGE_BLOCK_SIZE;
|
|
|
|
int MUTATION_BLOCK_SIZE;
|
|
|
|
|
|
|
|
// Taskbucket
|
2019-11-13 11:15:56 +08:00
|
|
|
double TASKBUCKET_LOGGING_DELAY;
|
2017-05-26 04:48:44 +08:00
|
|
|
int TASKBUCKET_MAX_PRIORITY;
|
|
|
|
double TASKBUCKET_CHECK_TIMEOUT_CHANCE;
|
|
|
|
double TASKBUCKET_TIMEOUT_JITTER_OFFSET;
|
|
|
|
double TASKBUCKET_TIMEOUT_JITTER_RANGE;
|
|
|
|
double TASKBUCKET_CHECK_ACTIVE_DELAY;
|
|
|
|
int TASKBUCKET_CHECK_ACTIVE_AMOUNT;
|
|
|
|
int TASKBUCKET_TIMEOUT_VERSIONS;
|
|
|
|
int TASKBUCKET_MAX_TASK_KEYS;
|
|
|
|
|
|
|
|
// Backup
|
2021-01-09 23:03:47 +08:00
|
|
|
int BACKUP_LOCAL_FILE_WRITE_BLOCK;
|
2018-03-09 03:27:15 +08:00
|
|
|
int BACKUP_CONCURRENT_DELETES;
|
2017-05-26 04:48:44 +08:00
|
|
|
int BACKUP_SIMULATED_LIMIT_BYTES;
|
|
|
|
int BACKUP_GET_RANGE_LIMIT_BYTES;
|
|
|
|
int BACKUP_LOCK_BYTES;
|
|
|
|
double BACKUP_RANGE_TIMEOUT;
|
|
|
|
double BACKUP_RANGE_MINWAIT;
|
2017-12-14 17:44:38 +08:00
|
|
|
int BACKUP_SNAPSHOT_DISPATCH_INTERVAL_SEC;
|
2017-12-20 16:49:08 +08:00
|
|
|
int BACKUP_DEFAULT_SNAPSHOT_INTERVAL_SEC;
|
2017-05-26 04:48:44 +08:00
|
|
|
int BACKUP_SHARD_TASK_LIMIT;
|
|
|
|
double BACKUP_AGGREGATE_POLL_RATE;
|
|
|
|
double BACKUP_AGGREGATE_POLL_RATE_UPDATE_INTERVAL;
|
|
|
|
int BACKUP_LOG_WRITE_BATCH_MAX_SIZE;
|
|
|
|
int BACKUP_LOG_ATOMIC_OPS_SIZE;
|
|
|
|
int BACKUP_MAX_LOG_RANGES;
|
|
|
|
int BACKUP_SIM_COPY_LOG_RANGES;
|
|
|
|
int BACKUP_OPERATION_COST_OVERHEAD;
|
|
|
|
int BACKUP_VERSION_DELAY;
|
|
|
|
int BACKUP_MAP_KEY_LOWER_LIMIT;
|
|
|
|
int BACKUP_MAP_KEY_UPPER_LIMIT;
|
|
|
|
int BACKUP_COPY_TASKS;
|
|
|
|
int BACKUP_BLOCK_SIZE;
|
2020-06-16 18:59:47 +08:00
|
|
|
int COPY_LOG_BLOCK_SIZE;
|
|
|
|
int COPY_LOG_BLOCKS_PER_TASK;
|
|
|
|
int COPY_LOG_PREFETCH_BLOCKS;
|
2020-07-03 16:36:20 +08:00
|
|
|
int COPY_LOG_READ_AHEAD_BYTES;
|
2020-06-16 18:59:47 +08:00
|
|
|
double COPY_LOG_TASK_DURATION_NANOS;
|
2017-05-26 04:48:44 +08:00
|
|
|
int BACKUP_TASKS_PER_AGENT;
|
2020-03-28 08:12:50 +08:00
|
|
|
int BACKUP_POLL_PROGRESS_SECONDS;
|
|
|
|
int64_t VERSIONS_PER_SECOND; // Copy of SERVER_KNOBS, as we can't link with it
|
2017-05-26 04:48:44 +08:00
|
|
|
int SIM_BACKUP_TASKS_PER_AGENT;
|
|
|
|
int BACKUP_RANGEFILE_BLOCK_SIZE;
|
|
|
|
int BACKUP_LOGFILE_BLOCK_SIZE;
|
2018-01-17 02:45:21 +08:00
|
|
|
int BACKUP_DISPATCH_ADDTASK_SIZE;
|
2017-05-26 04:48:44 +08:00
|
|
|
int RESTORE_DISPATCH_ADDTASK_SIZE;
|
|
|
|
int RESTORE_DISPATCH_BATCH_SIZE;
|
|
|
|
int RESTORE_WRITE_TX_SIZE;
|
|
|
|
int APPLY_MAX_LOCK_BYTES;
|
|
|
|
int APPLY_MIN_LOCK_BYTES;
|
|
|
|
int APPLY_BLOCK_SIZE;
|
|
|
|
double APPLY_MAX_DECAY_RATE;
|
|
|
|
double APPLY_MAX_INCREASE_FACTOR;
|
|
|
|
double BACKUP_ERROR_DELAY;
|
|
|
|
double BACKUP_STATUS_DELAY;
|
|
|
|
double BACKUP_STATUS_JITTER;
|
2019-09-28 09:32:27 +08:00
|
|
|
double MIN_CLEANUP_SECONDS;
|
2017-05-26 04:48:44 +08:00
|
|
|
|
|
|
|
// Configuration
|
2020-09-11 08:44:15 +08:00
|
|
|
int32_t DEFAULT_AUTO_COMMIT_PROXIES;
|
2020-08-06 15:01:57 +08:00
|
|
|
int32_t DEFAULT_AUTO_GRV_PROXIES;
|
2020-09-26 01:49:56 +08:00
|
|
|
int32_t DEFAULT_COMMIT_GRV_PROXIES_RATIO;
|
|
|
|
int32_t DEFAULT_MAX_GRV_PROXIES;
|
2017-05-26 04:48:44 +08:00
|
|
|
int32_t DEFAULT_AUTO_RESOLVERS;
|
|
|
|
int32_t DEFAULT_AUTO_LOGS;
|
|
|
|
|
|
|
|
// Client Status Info
|
|
|
|
double CSI_SAMPLING_PROBABILITY;
|
|
|
|
int64_t CSI_SIZE_LIMIT;
|
|
|
|
double CSI_STATUS_DELAY;
|
|
|
|
|
|
|
|
int HTTP_SEND_SIZE;
|
|
|
|
int HTTP_READ_SIZE;
|
|
|
|
int HTTP_VERBOSE_LEVEL;
|
2019-01-09 06:48:47 +08:00
|
|
|
std::string HTTP_REQUEST_ID_HEADER;
|
2017-05-26 04:48:44 +08:00
|
|
|
int BLOBSTORE_CONNECT_TRIES;
|
|
|
|
int BLOBSTORE_CONNECT_TIMEOUT;
|
2017-10-16 12:51:11 +08:00
|
|
|
int BLOBSTORE_MAX_CONNECTION_LIFE;
|
2017-05-26 04:48:44 +08:00
|
|
|
int BLOBSTORE_REQUEST_TRIES;
|
2020-07-20 08:30:58 +08:00
|
|
|
int BLOBSTORE_REQUEST_TIMEOUT_MIN;
|
2017-05-26 04:48:44 +08:00
|
|
|
int BLOBSTORE_REQUESTS_PER_SECOND;
|
2018-06-21 11:34:34 +08:00
|
|
|
int BLOBSTORE_LIST_REQUESTS_PER_SECOND;
|
|
|
|
int BLOBSTORE_WRITE_REQUESTS_PER_SECOND;
|
|
|
|
int BLOBSTORE_READ_REQUESTS_PER_SECOND;
|
|
|
|
int BLOBSTORE_DELETE_REQUESTS_PER_SECOND;
|
2017-05-26 04:48:44 +08:00
|
|
|
int BLOBSTORE_CONCURRENT_REQUESTS;
|
|
|
|
int BLOBSTORE_MULTIPART_MAX_PART_SIZE;
|
|
|
|
int BLOBSTORE_MULTIPART_MIN_PART_SIZE;
|
|
|
|
int BLOBSTORE_CONCURRENT_UPLOADS;
|
2018-01-06 15:06:39 +08:00
|
|
|
int BLOBSTORE_CONCURRENT_LISTS;
|
2017-10-18 20:51:30 +08:00
|
|
|
int BLOBSTORE_CONCURRENT_WRITES_PER_FILE;
|
2017-05-26 04:48:44 +08:00
|
|
|
int BLOBSTORE_CONCURRENT_READS_PER_FILE;
|
|
|
|
int BLOBSTORE_READ_BLOCK_SIZE;
|
|
|
|
int BLOBSTORE_READ_AHEAD_BLOCKS;
|
|
|
|
int BLOBSTORE_READ_CACHE_BLOCKS_PER_FILE;
|
|
|
|
int BLOBSTORE_MAX_SEND_BYTES_PER_SECOND;
|
|
|
|
int BLOBSTORE_MAX_RECV_BYTES_PER_SECOND;
|
|
|
|
|
2019-02-08 08:08:39 +08:00
|
|
|
int CONSISTENCY_CHECK_RATE_LIMIT_MAX;
|
|
|
|
int CONSISTENCY_CHECK_ONE_ROUND_TARGET_COMPLETION_TIME;
|
2020-02-21 02:43:34 +08:00
|
|
|
|
2020-03-01 05:45:00 +08:00
|
|
|
// fdbcli
|
2020-02-21 02:43:34 +08:00
|
|
|
int CLI_CONNECT_PARALLELISM;
|
|
|
|
double CLI_CONNECT_TIMEOUT;
|
2020-03-01 05:45:00 +08:00
|
|
|
|
2020-04-01 07:42:00 +08:00
|
|
|
// trace
|
|
|
|
int TRACE_LOG_FILE_IDENTIFIER_MAX_LENGTH;
|
|
|
|
|
2020-04-10 07:55:56 +08:00
|
|
|
// transaction tags
|
|
|
|
int MAX_TRANSACTION_TAG_LENGTH;
|
|
|
|
int MAX_TAGS_PER_TRANSACTION;
|
2020-08-11 06:29:59 +08:00
|
|
|
int COMMIT_SAMPLE_COST; // The expectation of sampling is every COMMIT_SAMPLE_COST sample once
|
2020-08-18 04:01:19 +08:00
|
|
|
int WRITE_COST_BYTE_FACTOR;
|
2020-08-04 11:18:05 +08:00
|
|
|
int INCOMPLETE_SHARD_PLUS; // The size of (possible) incomplete shard when estimate clear range
|
2020-04-10 07:55:56 +08:00
|
|
|
double READ_TAG_SAMPLE_RATE; // Communicated to clients from cluster
|
2020-04-17 05:43:22 +08:00
|
|
|
double TAG_THROTTLE_SMOOTHING_WINDOW;
|
2020-04-22 02:56:58 +08:00
|
|
|
double TAG_THROTTLE_RECHECK_INTERVAL;
|
2020-04-24 11:50:40 +08:00
|
|
|
double TAG_THROTTLE_EXPIRATION_INTERVAL;
|
2020-04-10 07:55:56 +08:00
|
|
|
|
2020-04-02 04:59:06 +08:00
|
|
|
ClientKnobs();
|
|
|
|
void initialize(bool randomize = false);
|
2017-05-26 04:48:44 +08:00
|
|
|
};
|
|
|
|
|
2020-11-22 04:55:03 +08:00
|
|
|
extern std::unique_ptr<ClientKnobs> globalClientKnobs;
|
2017-05-26 04:48:44 +08:00
|
|
|
extern ClientKnobs const* CLIENT_KNOBS;
|
|
|
|
|
|
|
|
#endif
|