Skip to content

Commit

Permalink
treewide: Hide unsupported arguments
Browse files Browse the repository at this point in the history
There are many configuration arguments that we do not expend users to
set. This change hides these arguments from appearing when a user runs
`--help`. These arguments can still be set by users that know about
them.

Release-Note-Core: Removes references to arguments that are either not
  well support or not recommended for general use from the output of
  `--help`.
Change-Id: If1a343c89fdcbc05fb50670c2e307c12cba79913
Reviewed-on: https://gerrit.readyset.name/c/readyset/+/5784
Reviewed-by: Aspen Smith <aspen@readyset.io>
Tested-by: Buildkite CI
  • Loading branch information
Dan Wilbanks committed Aug 21, 2023
1 parent bbeb948 commit ec5ee70
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 21 deletions.
10 changes: 5 additions & 5 deletions database-utils/src/lib.rs
Expand Up @@ -47,7 +47,7 @@ pub struct UpstreamConfig {
/// trusted, any certificate for any site will be trusted for use, including expired
/// certificates. This introduces significant vulnerabilities, and should only be used as a
/// last resort.
#[clap(long, env = "DISABLE_UPSTREAM_SSL_VERIFICATION")]
#[clap(long, env = "DISABLE_UPSTREAM_SSL_VERIFICATION", hide = true)]
#[serde(default)]
pub disable_upstream_ssl_verification: bool,

Expand All @@ -59,15 +59,15 @@ pub struct UpstreamConfig {
/// Disable running DDL Streaming Replication Setup for PostgreSQL. If this flag is set
/// the DDL Streaming Replication Setup SQL queries will need to be manually run on the
/// primary server before streaming replication will start.
#[clap(long, env = "DISABLE_SETUP_DDL_REPLICATION")]
#[clap(long, env = "DISABLE_SETUP_DDL_REPLICATION", hide = true)]
#[serde(default)]
pub disable_setup_ddl_replication: bool,

/// Server ID to use when registering as a replication follower with the upstream db
///
/// This can be used to differentiate different ReadySet deployments connected to the same
/// upstream DB.
#[clap(long, env = "REPLICATION_SERVER_ID")]
#[clap(long, env = "REPLICATION_SERVER_ID", hide = true)]
#[serde(default)]
pub replication_server_id: Option<u32>,

Expand All @@ -82,12 +82,12 @@ pub struct UpstreamConfig {

/// Sets the time (in seconds) between reports of progress snapshotting the database. A value
/// of 0 disables reporting.
#[clap(long, default_value = "30")]
#[clap(long, default_value = "30", hide = true)]
#[serde(default = "default_snapshot_report_interval_secs")]
pub snapshot_report_interval_secs: u16,

/// Sets the connection count for the pool that is used for replication and snapshotting.
#[clap(long, default_value = "50")]
#[clap(long, default_value = "50", hide = true)]
#[serde(default)]
pub replication_pool_size: usize,
}
Expand Down
18 changes: 12 additions & 6 deletions readyset-server/src/lib.rs
Expand Up @@ -545,11 +545,11 @@ pub struct WorkerOptions {
/// on disk, but `ephemeral` deletes the data when the ReadySet Server is stopped.
/// `memory` stores base tables entirely in memory. `ephemeral` and `memory` are
/// suitable for testing only. Use `persistent` for production deployments.
#[clap(long, default_value = "persistent")]
#[clap(long, default_value = "persistent", hide = true)]
pub durability: DurabilityMode,

/// Number of background threads used by RocksDB
#[clap(long, default_value = "6")]
#[clap(long, default_value = "6", hide = true)]
pub persistence_threads: i32,

/// Memory high water mark, in bytes. If process heap memory exceeds this value, we
Expand All @@ -562,20 +562,21 @@ pub struct WorkerOptions {
#[clap(
long = "memory-check-every",
default_value = "1",
env = "MEMORY_CHECK_EVERY"
env = "MEMORY_CHECK_EVERY",
hide = true
)]
pub memory_check_freq: u64,

/// The strategy to use when memory is freed from reader nodes
#[clap(long = "eviction-policy", default_value_t = dataflow::EvictionKind::LRU)]
#[clap(long = "eviction-policy", default_value_t = dataflow::EvictionKind::LRU, hide = true)]
pub eviction_kind: dataflow::EvictionKind,

/// Disable partial
#[clap(long = "nopartial", hide = true)]
pub no_partial: bool,

/// Allow the creation of fully materialized nodes.
#[clap(long, env = "ALLOW_FULL_MATERIALIZATION")]
#[clap(long, env = "ALLOW_FULL_MATERIALIZATION", hide = true)]
pub allow_full_materialization: bool,

/// Enable packet filters in egresses before readers
Expand Down Expand Up @@ -623,7 +624,12 @@ pub struct WorkerOptions {
pub replicator_config: UpstreamConfig,

/// Timeout in seconds for all requests made from the controller to workers
#[clap(long, env = "WORKER_REQUEST_TIMEOUT_SECONDS", default_value = "1800")]
#[clap(
long,
env = "WORKER_REQUEST_TIMEOUT_SECONDS",
default_value = "1800",
hide = true
)]
pub worker_request_timeout_seconds: u64,
}

Expand Down
33 changes: 23 additions & 10 deletions readyset/src/lib.rs
Expand Up @@ -174,7 +174,8 @@ pub struct Options {
long,
env = "DATABASE_TYPE",
value_enum,
required_unless_present("upstream_db_url")
required_unless_present("upstream_db_url"),
hide = true
)]
pub database_type: Option<DatabaseType>,

Expand All @@ -183,11 +184,13 @@ pub struct Options {
standalone: bool,

/// The authority to use
// NOTE: hidden because the value can be derived from `--standalone`
#[clap(
long,
env = "AUTHORITY",
default_value_if("standalone", "true", Some("standalone")),
default_value = "consul"
default_value = "consul",
hide = true
)]
authority: AuthorityType,

Expand All @@ -208,7 +211,7 @@ pub struct Options {
log_slow: bool,

/// Don't require authentication for any client connections
#[clap(long, env = "ALLOW_UNAUTHENTICATED_CONNECTIONS")]
#[clap(long, env = "ALLOW_UNAUTHENTICATED_CONNECTIONS", hide = true)]
allow_unauthenticated_connections: bool,

/// Specify the migration mode for ReadySet to use. The default "explicit" mode is the only
Expand All @@ -230,7 +233,12 @@ pub struct Options {
max_processing_minutes: u64,

/// Sets the migration handlers's loop interval in milliseconds.
#[clap(long, env = "MIGRATION_TASK_INTERVAL", default_value = "20000")]
#[clap(
long,
env = "MIGRATION_TASK_INTERVAL",
default_value = "20000",
hide = true
)]
migration_task_interval: u64,

/// IP:PORT to host endpoint for scraping metrics from the adapter.
Expand Down Expand Up @@ -291,7 +299,7 @@ pub struct Options {
/// Allow executing, but ignore, unsupported `SET` statements.
///
/// Takes precedence over any value passed to `--unsupported-set-mode`
#[clap(long, hide = true, env = "ALLOW_UNSUPPORTED_SET")]
#[clap(long, hide = true, env = "ALLOW_UNSUPPORTED_SET", hide = true)]
allow_unsupported_set: bool,

/// Configure how ReadySet behaves when receiving unsupported SET statements.
Expand All @@ -302,12 +310,17 @@ pub struct Options {
/// * "proxy" - proxy all subsequent statements
// NOTE: In order to keep `allow_unsupported_set` hidden, we're keeping these two flags separate
// and *not* marking them as conflicting with each other.
#[clap(long, env = "UNSUPPORTED_SET_MODE", default_value = "error")]
#[clap(
long,
env = "UNSUPPORTED_SET_MODE",
default_value = "error",
hide = true
)]
unsupported_set_mode: UnsupportedSetMode,

// TODO(DAN): require explicit migrations
/// Specifies the polling interval in seconds for requesting views from the Leader.
#[clap(long, env = "VIEWS_POLLING_INTERVAL", default_value = "5")]
#[clap(long, env = "VIEWS_POLLING_INTERVAL", default_value = "5", hide = true)]
views_polling_interval: u64,

/// The time to wait before canceling a migration request. Defaults to 30 minutes.
Expand Down Expand Up @@ -344,7 +357,7 @@ pub struct Options {
fallback_recovery_seconds: u64,

/// Whether to use non-blocking or blocking reads against the cache.
#[clap(long, env = "NON_BLOCKING_READS")]
#[clap(long, env = "NON_BLOCKING_READS", hide = true)]
non_blocking_reads: bool,

/// Run ReadySet in embedded readers mode, running reader replicas (and only reader replicas)
Expand Down Expand Up @@ -377,14 +390,14 @@ pub struct Options {
///
/// If set, we will create a cache with literals inlined in the unsupported placeholder
/// positions every time the statement is executed with a new set of parameters.
#[clap(long, env = "EXPERIMENTAL_PLACEHOLDER_INLINING")]
#[clap(long, env = "EXPERIMENTAL_PLACEHOLDER_INLINING", hide = true)]
experimental_placeholder_inlining: bool,

/// Don't make connections to the upstream aatabase for new client connections.
///
/// If this flag is set queries will never be proxied upstream - even if they are unsupported,
/// fail to execute, or are run in a transaction.
#[clap(long, env = "NO_UPSTREAM_CONNECTIONS")]
#[clap(long, env = "NO_UPSTREAM_CONNECTIONS", hide = true)]
no_upstream_connections: bool,

/// If supplied we will clean up assets for the supplied deployment. If an upstream url is
Expand Down

0 comments on commit ec5ee70

Please sign in to comment.