Skip to content

Commit

Permalink
[#14945] Replace DEFINE_ with DEFINE_NON_RUNTIME_
Browse files Browse the repository at this point in the history
Summary:
Replace DEFINE_ with DEFINE_NON_RUNTIME_

GH PR for easier review: #14946

Created with https://gist.githubusercontent.com/hari90/760596c0c8cb1d9b5b6fd99d643dba01/raw/0d967aec5c6cded897b462021648d183482c93df/gistfile1.txt

And fixed some minor lint errors

Fixes #14945

Test Plan: All jenkins tests

Reviewers: bogdan

Subscribers: asrivastava, ybase

Differential Revision: https://phabricator.dev.yugabyte.com/D21023
  • Loading branch information
hari90 committed Nov 10, 2022
1 parent dd40a67 commit 12a052a
Show file tree
Hide file tree
Showing 245 changed files with 1,215 additions and 1,076 deletions.
4 changes: 2 additions & 2 deletions ent/src/yb/cdc/cdc_producer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@

#include "yb/yql/cql/ql/util/statement_result.h"

DEFINE_int32(cdc_transaction_timeout_ms, 0,
DEFINE_UNKNOWN_int32(cdc_transaction_timeout_ms, 0,
"Don't check for an aborted transaction unless its original write is lagging by this duration.");

DEFINE_bool(cdc_enable_replicate_intents, true,
DEFINE_UNKNOWN_bool(cdc_enable_replicate_intents, true,
"Enable replication of intents before they've been committed.");

DEFINE_test_flag(bool, xcluster_simulate_have_more_records, false,
Expand Down
34 changes: 18 additions & 16 deletions ent/src/yb/cdc/cdc_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,68 +85,70 @@ using std::pair;

constexpr uint32_t kUpdateIntervalMs = 15 * 1000;

DEFINE_int32(cdc_read_rpc_timeout_ms, 30 * 1000,
DEFINE_UNKNOWN_int32(cdc_read_rpc_timeout_ms, 30 * 1000,
"Timeout used for CDC read rpc calls. Reads normally occur cross-cluster.");
TAG_FLAG(cdc_read_rpc_timeout_ms, advanced);

DEFINE_int32(cdc_write_rpc_timeout_ms, 30 * 1000,
DEFINE_UNKNOWN_int32(cdc_write_rpc_timeout_ms, 30 * 1000,
"Timeout used for CDC write rpc calls. Writes normally occur intra-cluster.");
TAG_FLAG(cdc_write_rpc_timeout_ms, advanced);

DEFINE_int32(cdc_ybclient_reactor_threads, 50,
DEFINE_UNKNOWN_int32(cdc_ybclient_reactor_threads, 50,
"The number of reactor threads to be used for processing ybclient "
"requests for CDC.");
TAG_FLAG(cdc_ybclient_reactor_threads, advanced);

DEFINE_int32(cdc_state_checkpoint_update_interval_ms, kUpdateIntervalMs,
DEFINE_UNKNOWN_int32(cdc_state_checkpoint_update_interval_ms, kUpdateIntervalMs,
"Rate at which CDC state's checkpoint is updated.");

DEFINE_string(certs_for_cdc_dir, "",
DEFINE_UNKNOWN_string(certs_for_cdc_dir, "",
"The parent directory of where all certificates for xCluster producer universes will "
"be stored, for when the producer and consumer clusters use different certificates. "
"Place the certificates for each producer cluster in "
"<certs_for_cdc_dir>/<producer_cluster_id>/*.");

DEFINE_int32(update_min_cdc_indices_interval_secs, 60,
DEFINE_UNKNOWN_int32(update_min_cdc_indices_interval_secs, 60,
"How often to read cdc_state table to get the minimum applied index for each tablet "
"across all streams. This information is used to correctly keep log files that "
"contain unapplied entries. This is also the rate at which a tablet's minimum "
"replicated index across all streams is sent to the other peers in the configuration. "
"If flag enable_log_retention_by_op_idx is disabled, this flag has no effect.");

DEFINE_int32(update_metrics_interval_ms, kUpdateIntervalMs,
DEFINE_UNKNOWN_int32(update_metrics_interval_ms, kUpdateIntervalMs,
"How often to update xDC cluster metrics.");

DEFINE_bool(enable_cdc_state_table_caching, true, "Enable caching the cdc_state table schema.");
DEFINE_UNKNOWN_bool(enable_cdc_state_table_caching, true,
"Enable caching the cdc_state table schema.");

DEFINE_bool(enable_cdc_client_tablet_caching, false, "Enable caching the tablets found by client.");
DEFINE_UNKNOWN_bool(enable_cdc_client_tablet_caching, false,
"Enable caching the tablets found by client.");

DEFINE_bool(enable_collect_cdc_metrics, true, "Enable collecting cdc metrics.");
DEFINE_UNKNOWN_bool(enable_collect_cdc_metrics, true, "Enable collecting cdc metrics.");

DEFINE_double(cdc_read_safe_deadline_ratio, .10,
DEFINE_UNKNOWN_double(cdc_read_safe_deadline_ratio, .10,
"When the heartbeat deadline has this percentage of time remaining, "
"the master should halt tablet report processing so it can respond in time.");

DEFINE_double(cdc_get_changes_free_rpc_ratio, .10,
DEFINE_UNKNOWN_double(cdc_get_changes_free_rpc_ratio, .10,
"When the TServer only has this percentage of RPCs remaining because the rest are "
"GetChanges, reject additional requests to throttle/backoff and prevent deadlocks.");

DEFINE_bool(enable_update_local_peer_min_index, false,
DEFINE_UNKNOWN_bool(enable_update_local_peer_min_index, false,
"Enable each local peer to update its own log checkpoint instead of the leader "
"updating all peers.");

DEFINE_bool(parallelize_bootstrap_producer, true,
DEFINE_UNKNOWN_bool(parallelize_bootstrap_producer, true,
"When this is true, use the version of BootstrapProducer with batched and "
"parallelized rpc calls. This is recommended for large input sizes");

DEFINE_test_flag(uint64, cdc_log_init_failure_timeout_seconds, 0,
"Timeout in seconds for CDCServiceImpl::SetCDCCheckpoint to return log init failure");

DEFINE_int32(wait_replication_drain_tserver_max_retry, 3,
DEFINE_UNKNOWN_int32(wait_replication_drain_tserver_max_retry, 3,
"Maximum number of retry that a tserver will poll its tablets until the tablets"
"are all caught-up in the replication, before responding to the caller.");

DEFINE_int32(wait_replication_drain_tserver_retry_interval_ms, 100,
DEFINE_UNKNOWN_int32(wait_replication_drain_tserver_retry_interval_ms, 100,
"Time in microseconds that a tserver will sleep between each iteration of polling "
"its tablets until the tablets are all caught-up in the replication.");

Expand Down
2 changes: 1 addition & 1 deletion ent/src/yb/master/master_ent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "yb/util/ntp_clock.h"
#include "yb/util/result.h"

DEFINE_int32(master_backup_svc_queue_length, 50,
DEFINE_UNKNOWN_int32(master_backup_svc_queue_length, 50,
"RPC queue length for master backup service");
TAG_FLAG(master_backup_svc_queue_length, advanced);

Expand Down
22 changes: 12 additions & 10 deletions ent/src/yb/server/secure.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,41 +25,43 @@
#include "yb/util/net/net_util.h"
#include "yb/util/path_util.h"
#include "yb/util/result.h"
#include "yb/util/flags.h"

using std::string;

DEFINE_bool(use_node_to_node_encryption, false, "Use node to node encryption.");
DEFINE_UNKNOWN_bool(use_node_to_node_encryption, false, "Use node to node encryption.");

DEFINE_bool(node_to_node_encryption_use_client_certificates, false,
DEFINE_UNKNOWN_bool(node_to_node_encryption_use_client_certificates, false,
"Should client certificates be sent and verified for encrypted node to node "
"communication.");

DEFINE_string(node_to_node_encryption_required_uid, "",
DEFINE_UNKNOWN_string(node_to_node_encryption_required_uid, "",
"Allow only certificates with specified uid. Empty to allow any.");

DEFINE_string(certs_dir, "",
DEFINE_UNKNOWN_string(certs_dir, "",
"Directory that contains certificate authority, private key and certificates for "
"this server. By default 'certs' subdir in data folder is used.");

DEFINE_bool(use_client_to_server_encryption, false, "Use client to server encryption");
DEFINE_UNKNOWN_bool(use_client_to_server_encryption, false, "Use client to server encryption");

DEFINE_string(certs_for_client_dir, "",
DEFINE_UNKNOWN_string(certs_for_client_dir, "",
"Directory that contains certificate authority, private key and certificates for "
"this server that should be used for client to server communications. "
"When empty, the same dir as for server to server communications is used.");

DEFINE_string(cert_node_filename, "",
DEFINE_UNKNOWN_string(cert_node_filename, "",
"The file name that will be used in the names of the node "
"certificates and keys. These files will be named : "
"'node.{cert_node_filename}.{key|crt}'. "
"If this flag is not set, then --server_broadcast_addresses will be "
"used if it is set, and if not, --rpc_bind_addresses will be used.");

DEFINE_string(key_file_pattern, "node.$0.key", "Pattern used for key file");
DEFINE_UNKNOWN_string(key_file_pattern, "node.$0.key", "Pattern used for key file");

DEFINE_string(cert_file_pattern, "node.$0.crt", "Pattern used for certificate file");
DEFINE_UNKNOWN_string(cert_file_pattern, "node.$0.crt", "Pattern used for certificate file");

DEFINE_bool(enable_stream_compression, true, "Whether it is allowed to use stream compression.");
DEFINE_UNKNOWN_bool(enable_stream_compression, true,
"Whether it is allowed to use stream compression.");

namespace yb {
namespace server {
Expand Down
2 changes: 1 addition & 1 deletion ent/src/yb/tserver/cdc_consumer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

using std::string;

DEFINE_int32(cdc_consumer_handler_thread_pool_size, 0,
DEFINE_UNKNOWN_int32(cdc_consumer_handler_thread_pool_size, 0,
"Override the max thread pool size for CDCConsumerHandler, which is used by "
"CDCPollers. If set to 0, then the thread pool will use the default size (number of "
"cpus on the system).");
Expand Down
6 changes: 3 additions & 3 deletions ent/src/yb/tserver/tablet_server_ent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@

using std::string;

DEFINE_int32(ts_backup_svc_num_threads, 4,
DEFINE_UNKNOWN_int32(ts_backup_svc_num_threads, 4,
"Number of RPC worker threads for the TS backup service");
TAG_FLAG(ts_backup_svc_num_threads, advanced);

DEFINE_int32(ts_backup_svc_queue_length, 50,
DEFINE_UNKNOWN_int32(ts_backup_svc_queue_length, 50,
"RPC queue length for the TS backup service");
TAG_FLAG(ts_backup_svc_queue_length, advanced);

DEFINE_int32(xcluster_svc_queue_length, 5000,
DEFINE_UNKNOWN_int32(xcluster_svc_queue_length, 5000,
"RPC queue length for the xCluster service");
TAG_FLAG(xcluster_svc_queue_length, advanced);

Expand Down
17 changes: 9 additions & 8 deletions src/yb/client/async_rpc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,18 @@ DEFINE_RUNTIME_int32(ybclient_print_trace_every_n, 0,
"disables printing the collected traces.");
TAG_FLAG(ybclient_print_trace_every_n, advanced);

DEFINE_bool(forward_redis_requests, true, "If false, the redis op will not be served if it's not "
"a local request. The op response will be set to the redis error "
"'-MOVED partition_key 0.0.0.0:0'. This works with jedis which only looks at the MOVED "
"part of the reply and ignores the rest. For now, if this flag is true, we will only "
"attempt to read from leaders, so redis_allow_reads_from_followers will be ignored.");

DEFINE_bool(detect_duplicates_for_retryable_requests, true,
DEFINE_UNKNOWN_bool(forward_redis_requests, true,
"If false, the redis op will not be served if it's not "
"a local request. The op response will be set to the redis error "
"'-MOVED partition_key 0.0.0.0:0'. This works with jedis which only looks at the MOVED "
"part of the reply and ignores the rest. For now, if this flag is true, we will only "
"attempt to read from leaders, so redis_allow_reads_from_followers will be ignored.");

DEFINE_UNKNOWN_bool(detect_duplicates_for_retryable_requests, true,
"Enable tracking of write requests that prevents the same write from being applied "
"twice.");

DEFINE_bool(ysql_forward_rpcs_to_local_tserver, false,
DEFINE_UNKNOWN_bool(ysql_forward_rpcs_to_local_tserver, false,
"DEPRECATED. Feature has been removed");

DEFINE_CAPABILITY(PickReadTimeAtTabletServer, 0x8284d67b);
Expand Down
7 changes: 4 additions & 3 deletions src/yb/client/auto_flags_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
#include "yb/server/secure.h"
#include "yb/util/flags/auto_flags.h"
#include "yb/util/net/net_util.h"
#include "yb/util/flags.h"

using std::string;

DEFINE_bool(disable_auto_flags_management, false,
DEFINE_UNKNOWN_bool(disable_auto_flags_management, false,
"Disables AutoFlags management. A safety switch to turn off automatic promotion of AutoFlags. "
"More information about AutoFlags can be found in "
"https://github.com/yugabyte/yugabyte-db/blob/master/architecture/design/auto_flags.md. Use at "
Expand All @@ -37,14 +38,14 @@ DEFINE_RUNTIME_AUTO_bool(
"AutoFlag that indicates initialization of AutoFlags. Not meant to be overridden.");
TAG_FLAG(TEST_auto_flags_initialized, hidden);

DEFINE_int32(
DEFINE_UNKNOWN_int32(
auto_flags_load_from_master_backoff_increment_ms, 100,
"Number of milliseconds added to the delay between reties of fetching AutoFlags config from "
"master leader. This delay is applied after the RPC reties have been exhausted.");
TAG_FLAG(auto_flags_load_from_master_backoff_increment_ms, stable);
TAG_FLAG(auto_flags_load_from_master_backoff_increment_ms, advanced);

DEFINE_int32(
DEFINE_UNKNOWN_int32(
auto_flags_load_from_master_max_backoff_sec, 3,
"Maximum number of seconds to delay between reties of fetching AutoFlags config from master "
"leader. This delay is applied after the RPC reties have been exhausted.");
Expand Down
2 changes: 1 addition & 1 deletion src/yb/client/client-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ DECLARE_int32(max_create_tablets_per_ts);
DECLARE_int32(tablet_server_svc_queue_length);
DECLARE_int32(replication_factor);

DEFINE_int32(test_scan_num_rows, 1000, "Number of rows to insert and scan");
DEFINE_UNKNOWN_int32(test_scan_num_rows, 1000, "Number of rows to insert and scan");
DECLARE_int32(min_backoff_ms_exponent);
DECLARE_int32(max_backoff_ms_exponent);
DECLARE_bool(TEST_force_master_lookup_all_tablets);
Expand Down
4 changes: 2 additions & 2 deletions src/yb/client/client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,12 @@ constexpr int kDefaultBackfillIndexClientRpcTimeoutMs = 24 * 60 * 60 * 1000; //

}

DEFINE_bool(client_suppress_created_logs, false,
DEFINE_UNKNOWN_bool(client_suppress_created_logs, false,
"Suppress 'Created table ...' messages");
TAG_FLAG(client_suppress_created_logs, advanced);
TAG_FLAG(client_suppress_created_logs, hidden);

DEFINE_int32(backfill_index_client_rpc_timeout_ms, kDefaultBackfillIndexClientRpcTimeoutMs,
DEFINE_UNKNOWN_int32(backfill_index_client_rpc_timeout_ms, kDefaultBackfillIndexClientRpcTimeoutMs,
"Timeout for BackfillIndex RPCs from client to master.");
TAG_FLAG(backfill_index_client_rpc_timeout_ms, advanced);

Expand Down
5 changes: 3 additions & 2 deletions src/yb/client/client_builder-internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@
#include "yb/util/metrics_fwd.h"
#include "yb/util/status_fwd.h"
#include "yb/util/metric_entity.h"
#include "yb/util/flags.h"

DEFINE_int32(yb_client_num_reactors, 16,
DEFINE_UNKNOWN_int32(yb_client_num_reactors, 16,
"Number of reactor threads for the yb client to communicate with different tservers.");

DEFINE_int32(yb_client_admin_operation_timeout_sec, 120,
DEFINE_UNKNOWN_int32(yb_client_admin_operation_timeout_sec, 120,
"The number of seconds after which an admin operation should timeout.");

namespace yb {
Expand Down
3 changes: 2 additions & 1 deletion src/yb/client/client_master_rpc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
#include "yb/rpc/rpc_header.pb.h"

#include "yb/util/logging.h"
#include "yb/util/flags.h"

DEFINE_int64(reset_master_leader_timeout_ms, 15000,
DEFINE_UNKNOWN_int64(reset_master_leader_timeout_ms, 15000,
"Timeout to reset master leader in milliseconds.");

using namespace std::literals;
Expand Down
8 changes: 4 additions & 4 deletions src/yb/client/meta_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,20 @@ using strings::Substitute;
using namespace std::literals;
using namespace std::placeholders;

DEFINE_int32(max_concurrent_master_lookups, 500,
DEFINE_UNKNOWN_int32(max_concurrent_master_lookups, 500,
"Maximum number of concurrent tablet location lookups from YB client to master");

DEFINE_test_flag(bool, verify_all_replicas_alive, false,
"If set, when a RemoteTablet object is destroyed, we will verify that all its "
"replicas are not marked as failed");

DEFINE_int32(retry_failed_replica_ms, 60 * 1000,
DEFINE_UNKNOWN_int32(retry_failed_replica_ms, 60 * 1000,
"Time in milliseconds to wait for before retrying a failed replica");

DEFINE_int64(meta_cache_lookup_throttling_step_ms, 5,
DEFINE_UNKNOWN_int64(meta_cache_lookup_throttling_step_ms, 5,
"Step to increment delay between calls during lookup throttling.");

DEFINE_int64(meta_cache_lookup_throttling_max_delay_ms, 1000,
DEFINE_UNKNOWN_int64(meta_cache_lookup_throttling_max_delay_ms, 1000,
"Max delay between calls during lookup throttling.");

DEFINE_test_flag(bool, force_master_lookup_all_tablets, false,
Expand Down
3 changes: 2 additions & 1 deletion src/yb/client/meta_data_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@
#include "yb/util/result.h"
#include "yb/util/status_format.h"
#include "yb/util/status_log.h"
#include "yb/util/flags.h"

using std::string;

DEFINE_int32(update_permissions_cache_msecs, 2000,
DEFINE_UNKNOWN_int32(update_permissions_cache_msecs, 2000,
"How often the roles' permissions cache should be updated. 0 means never update it");

namespace yb {
Expand Down
4 changes: 3 additions & 1 deletion src/yb/client/session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@
#include "yb/util/logging.h"
#include "yb/util/metrics.h"
#include "yb/util/status_log.h"
#include "yb/util/flags.h"

using namespace std::literals;
using namespace std::placeholders;

DEFINE_int32(client_read_write_timeout_ms, 60000, "Timeout for client read and write operations.");
DEFINE_UNKNOWN_int32(client_read_write_timeout_ms, 60000,
"Timeout for client read and write operations.");

namespace yb {
namespace client {
Expand Down
3 changes: 2 additions & 1 deletion src/yb/client/table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@
#include "yb/util/shared_lock.h"
#include "yb/util/status_format.h"
#include "yb/util/unique_lock.h"
#include "yb/util/flags.h"

using std::string;

DEFINE_int32(
DEFINE_UNKNOWN_int32(
max_num_tablets_for_table, 5000,
"Max number of tablets that can be specified in a CREATE TABLE statement");

Expand Down
9 changes: 5 additions & 4 deletions src/yb/client/tablet_rpc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@ DEFINE_test_flag(bool, assert_local_op, false,
DEFINE_RUNTIME_bool(update_all_tablets_upon_network_failure, true,
"If this is enabled, then pon receiving a network error, we mark the remote server as being "
"unreachable for all tablets in metacache, instead of the single tablet which issued the rpc.");
DEFINE_int32(force_lookup_cache_refresh_secs, 0, "When non-zero, specifies how often we send a "
"GetTabletLocations request to the master leader to update the tablet replicas cache. "
"This request is only sent if we are processing a ConsistentPrefix read.");
DEFINE_UNKNOWN_int32(force_lookup_cache_refresh_secs, 0,
"When non-zero, specifies how often we send a "
"GetTabletLocations request to the master leader to update the tablet replicas cache. "
"This request is only sent if we are processing a ConsistentPrefix read.");

DEFINE_int32(lookup_cache_refresh_secs, 60, "When non-zero, specifies how often we send a "
DEFINE_UNKNOWN_int32(lookup_cache_refresh_secs, 60, "When non-zero, specifies how often we send a "
"GetTabletLocations request to the master leader to update the tablet replicas cache. "
"This request is only sent if we are processing a ConsistentPrefix read and the RPC "
"layer has determined that its view of the replicas is inconsistent with what the "
Expand Down
7 changes: 4 additions & 3 deletions src/yb/client/transaction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,13 @@ DEFINE_RUNTIME_int32(txn_slow_op_threshold_ms, 0,
"disables printing the collected traces.");
TAG_FLAG(txn_slow_op_threshold_ms, advanced);

DEFINE_uint64(transaction_heartbeat_usec, 500000 * yb::kTimeMultiplier,
DEFINE_UNKNOWN_uint64(transaction_heartbeat_usec, 500000 * yb::kTimeMultiplier,
"Interval of transaction heartbeat in usec.");
DEFINE_bool(transaction_disable_heartbeat_in_tests, false, "Disable heartbeat during test.");
DEFINE_UNKNOWN_bool(transaction_disable_heartbeat_in_tests, false,
"Disable heartbeat during test.");
DECLARE_uint64(max_clock_skew_usec);

DEFINE_bool(auto_promote_nonlocal_transactions_to_global, true,
DEFINE_UNKNOWN_bool(auto_promote_nonlocal_transactions_to_global, true,
"Automatically promote transactions touching data outside of region to global.");

DEFINE_test_flag(int32, transaction_inject_flushed_delay_ms, 0,
Expand Down
Loading

0 comments on commit 12a052a

Please sign in to comment.