From 932d5da66f8aa8d56d87eea6c3026e10236bd5bd Mon Sep 17 00:00:00 2001 From: Manan Gupta Date: Wed, 29 May 2024 10:41:04 +0530 Subject: [PATCH 1/2] feat: fix documentation for lock-timeout Signed-off-by: Manan Gupta --- changelog/20.0/20.0.0/summary.md | 5 +++++ go/flags/endtoend/vtbackup.txt | 2 +- go/flags/endtoend/vtcombo.txt | 2 +- go/flags/endtoend/vtctld.txt | 2 +- go/flags/endtoend/vtgate.txt | 2 +- go/flags/endtoend/vtorc.txt | 2 +- go/flags/endtoend/vttablet.txt | 2 +- go/vt/topo/locks.go | 2 +- 8 files changed, 12 insertions(+), 7 deletions(-) diff --git a/changelog/20.0/20.0.0/summary.md b/changelog/20.0/20.0.0/summary.md index 6d2d9f18b2e..5612ad6c6ce 100644 --- a/changelog/20.0/20.0.0/summary.md +++ b/changelog/20.0/20.0.0/summary.md @@ -33,6 +33,7 @@ - [New `healthcheck-dial-concurrency` flag](#healthcheck-dial-concurrency-flag) - [New minimum for `--buffer_min_time_between_failovers`](#buffer_min_time_between_failovers-flag) - [New `track-udfs` vtgate flag](#vtgate-track-udfs-flag) + - [Documentation fix for `--lock-timeout`](#documentation-lock-timeout) - **[Minor Changes](#minor-changes)** - **[New Stats](#new-stats)** - [VTTablet Query Cache Hits and Misses](#vttablet-query-cache-hits-and-misses) @@ -333,6 +334,10 @@ The `--buffer_min_time_between_failovers` `vttablet` flag now has a minimum valu The new `--track-udfs` flag enables VTGate to track user defined functions for better planning. +#### Documentation fix for `--lock-timeout` + +The documentation for the flag `--lock-timeout` was noticed to be incorrect. We were documenting it as a flag that controlled the duration for which the shard lock was acquired for. It is actually the duration for which we wait while acquiring a lock from the topology server. + ## Minor Changes ### New Stats diff --git a/go/flags/endtoend/vtbackup.txt b/go/flags/endtoend/vtbackup.txt index a814cd80342..73e2cae5382 100644 --- a/go/flags/endtoend/vtbackup.txt +++ b/go/flags/endtoend/vtbackup.txt @@ -147,7 +147,7 @@ Flags: --keep-alive-timeout duration Wait until timeout elapses after a successful backup before shutting down. --keep_logs duration keep logs for this long (using ctime) (zero to keep forever) --keep_logs_by_mtime duration keep logs for this long (using mtime) (zero to keep forever) - --lock-timeout duration Maximum time for which a shard/keyspace lock can be acquired for (default 45s) + --lock-timeout duration Maximum time to wait for while acquiring a lock from the topo server (default 45s) --log_backtrace_at traceLocations when logging hits line file:N, emit a stack trace --log_dir string If non-empty, write log files in this directory --log_err_stacks log stack traces for errors diff --git a/go/flags/endtoend/vtcombo.txt b/go/flags/endtoend/vtcombo.txt index fd09f940b76..9787d3f3709 100644 --- a/go/flags/endtoend/vtcombo.txt +++ b/go/flags/endtoend/vtcombo.txt @@ -189,7 +189,7 @@ Flags: --keep_logs_by_mtime duration keep logs for this long (using mtime) (zero to keep forever) --keyspaces_to_watch strings Specifies which keyspaces this vtgate should have access to while routing queries or accessing the vschema. --lameduck-period duration keep running at least this long after SIGTERM before stopping (default 50ms) - --lock-timeout duration Maximum time for which a shard/keyspace lock can be acquired for (default 45s) + --lock-timeout duration Maximum time to wait for while acquiring a lock from the topo server (default 45s) --lock_heartbeat_time duration If there is lock function used. This will keep the lock connection active by using this heartbeat (default 5s) --lock_tables_timeout duration How long to keep the table locked before timing out (default 1m0s) --log_backtrace_at traceLocations when logging hits line file:N, emit a stack trace diff --git a/go/flags/endtoend/vtctld.txt b/go/flags/endtoend/vtctld.txt index 969e4f9774e..4d036bc98fb 100644 --- a/go/flags/endtoend/vtctld.txt +++ b/go/flags/endtoend/vtctld.txt @@ -91,7 +91,7 @@ Flags: --keep_logs duration keep logs for this long (using ctime) (zero to keep forever) --keep_logs_by_mtime duration keep logs for this long (using mtime) (zero to keep forever) --lameduck-period duration keep running at least this long after SIGTERM before stopping (default 50ms) - --lock-timeout duration Maximum time for which a shard/keyspace lock can be acquired for (default 45s) + --lock-timeout duration Maximum time to wait for while acquiring a lock from the topo server (default 45s) --log_backtrace_at traceLocations when logging hits line file:N, emit a stack trace --log_dir string If non-empty, write log files in this directory --log_err_stacks log stack traces for errors diff --git a/go/flags/endtoend/vtgate.txt b/go/flags/endtoend/vtgate.txt index 7d0b3272cc8..04698307adf 100644 --- a/go/flags/endtoend/vtgate.txt +++ b/go/flags/endtoend/vtgate.txt @@ -106,7 +106,7 @@ Flags: --keyspaces_to_watch strings Specifies which keyspaces this vtgate should have access to while routing queries or accessing the vschema. --lameduck-period duration keep running at least this long after SIGTERM before stopping (default 50ms) --legacy_replication_lag_algorithm Use the legacy algorithm when selecting vttablets for serving. (default true) - --lock-timeout duration Maximum time for which a shard/keyspace lock can be acquired for (default 45s) + --lock-timeout duration Maximum time to wait for while acquiring a lock from the topo server (default 45s) --lock_heartbeat_time duration If there is lock function used. This will keep the lock connection active by using this heartbeat (default 5s) --log_backtrace_at traceLocations when logging hits line file:N, emit a stack trace --log_dir string If non-empty, write log files in this directory diff --git a/go/flags/endtoend/vtorc.txt b/go/flags/endtoend/vtorc.txt index 187426a4afa..fb351758852 100644 --- a/go/flags/endtoend/vtorc.txt +++ b/go/flags/endtoend/vtorc.txt @@ -48,7 +48,7 @@ Flags: --keep_logs duration keep logs for this long (using ctime) (zero to keep forever) --keep_logs_by_mtime duration keep logs for this long (using mtime) (zero to keep forever) --lameduck-period duration keep running at least this long after SIGTERM before stopping (default 50ms) - --lock-timeout duration Maximum time for which a shard/keyspace lock can be acquired for (default 45s) + --lock-timeout duration Maximum time to wait for while acquiring a lock from the topo server (default 45s) --log_backtrace_at traceLocations when logging hits line file:N, emit a stack trace --log_dir string If non-empty, write log files in this directory --log_err_stacks log stack traces for errors diff --git a/go/flags/endtoend/vttablet.txt b/go/flags/endtoend/vttablet.txt index 38b30f46ffa..a44ac5878f8 100644 --- a/go/flags/endtoend/vttablet.txt +++ b/go/flags/endtoend/vttablet.txt @@ -212,7 +212,7 @@ Flags: --keep_logs duration keep logs for this long (using ctime) (zero to keep forever) --keep_logs_by_mtime duration keep logs for this long (using mtime) (zero to keep forever) --lameduck-period duration keep running at least this long after SIGTERM before stopping (default 50ms) - --lock-timeout duration Maximum time for which a shard/keyspace lock can be acquired for (default 45s) + --lock-timeout duration Maximum time to wait for while acquiring a lock from the topo server (default 45s) --lock_tables_timeout duration How long to keep the table locked before timing out (default 1m0s) --log_backtrace_at traceLocations when logging hits line file:N, emit a stack trace --log_dir string If non-empty, write log files in this directory diff --git a/go/vt/topo/locks.go b/go/vt/topo/locks.go index 6325124c429..01598c7f874 100644 --- a/go/vt/topo/locks.go +++ b/go/vt/topo/locks.go @@ -70,7 +70,7 @@ func init() { func registerTopoLockFlags(fs *pflag.FlagSet) { fs.DurationVar(&RemoteOperationTimeout, "remote_operation_timeout", RemoteOperationTimeout, "time to wait for a remote operation") - fs.DurationVar(&LockTimeout, "lock-timeout", LockTimeout, "Maximum time for which a shard/keyspace lock can be acquired for") + fs.DurationVar(&LockTimeout, "lock-timeout", LockTimeout, "Maximum time to wait for while acquiring a lock from the topo server") } // newLock creates a new Lock. From cbe8a9da53148446fdb2d2a255e2d3fddeb953e5 Mon Sep 17 00:00:00 2001 From: Manan Gupta Date: Thu, 30 May 2024 16:08:36 +0530 Subject: [PATCH 2/2] address review comments Signed-off-by: Manan Gupta --- changelog/20.0/20.0.0/summary.md | 7 ++++--- go/flags/endtoend/vtbackup.txt | 2 +- go/flags/endtoend/vtcombo.txt | 2 +- go/flags/endtoend/vtctld.txt | 2 +- go/flags/endtoend/vtgate.txt | 2 +- go/flags/endtoend/vtorc.txt | 2 +- go/flags/endtoend/vttablet.txt | 2 +- go/vt/topo/locks.go | 2 +- 8 files changed, 11 insertions(+), 10 deletions(-) diff --git a/changelog/20.0/20.0.0/summary.md b/changelog/20.0/20.0.0/summary.md index 5612ad6c6ce..f01e036471f 100644 --- a/changelog/20.0/20.0.0/summary.md +++ b/changelog/20.0/20.0.0/summary.md @@ -1,3 +1,4 @@ + ## Summary ### Table of Contents @@ -33,7 +34,7 @@ - [New `healthcheck-dial-concurrency` flag](#healthcheck-dial-concurrency-flag) - [New minimum for `--buffer_min_time_between_failovers`](#buffer_min_time_between_failovers-flag) - [New `track-udfs` vtgate flag](#vtgate-track-udfs-flag) - - [Documentation fix for `--lock-timeout`](#documentation-lock-timeout) + - [Help text fix for `--lock-timeout`](#documentation-lock-timeout) - **[Minor Changes](#minor-changes)** - **[New Stats](#new-stats)** - [VTTablet Query Cache Hits and Misses](#vttablet-query-cache-hits-and-misses) @@ -334,9 +335,9 @@ The `--buffer_min_time_between_failovers` `vttablet` flag now has a minimum valu The new `--track-udfs` flag enables VTGate to track user defined functions for better planning. -#### Documentation fix for `--lock-timeout` +#### Help text fix for `--lock-timeout` -The documentation for the flag `--lock-timeout` was noticed to be incorrect. We were documenting it as a flag that controlled the duration for which the shard lock was acquired for. It is actually the duration for which we wait while acquiring a lock from the topology server. +The help text for the flag `--lock-timeout` was incorrect. We were documenting it as a flag that controlled the duration for which the shard lock was acquired. It is actually the maximum duration for which we wait while attempting to acquire a lock from the topology server. ## Minor Changes diff --git a/go/flags/endtoend/vtbackup.txt b/go/flags/endtoend/vtbackup.txt index 73e2cae5382..004871d7c09 100644 --- a/go/flags/endtoend/vtbackup.txt +++ b/go/flags/endtoend/vtbackup.txt @@ -147,7 +147,7 @@ Flags: --keep-alive-timeout duration Wait until timeout elapses after a successful backup before shutting down. --keep_logs duration keep logs for this long (using ctime) (zero to keep forever) --keep_logs_by_mtime duration keep logs for this long (using mtime) (zero to keep forever) - --lock-timeout duration Maximum time to wait for while acquiring a lock from the topo server (default 45s) + --lock-timeout duration Maximum time to wait when attempting to acquire a lock from the topo server (default 45s) --log_backtrace_at traceLocations when logging hits line file:N, emit a stack trace --log_dir string If non-empty, write log files in this directory --log_err_stacks log stack traces for errors diff --git a/go/flags/endtoend/vtcombo.txt b/go/flags/endtoend/vtcombo.txt index 9787d3f3709..d5c95e750c9 100644 --- a/go/flags/endtoend/vtcombo.txt +++ b/go/flags/endtoend/vtcombo.txt @@ -189,7 +189,7 @@ Flags: --keep_logs_by_mtime duration keep logs for this long (using mtime) (zero to keep forever) --keyspaces_to_watch strings Specifies which keyspaces this vtgate should have access to while routing queries or accessing the vschema. --lameduck-period duration keep running at least this long after SIGTERM before stopping (default 50ms) - --lock-timeout duration Maximum time to wait for while acquiring a lock from the topo server (default 45s) + --lock-timeout duration Maximum time to wait when attempting to acquire a lock from the topo server (default 45s) --lock_heartbeat_time duration If there is lock function used. This will keep the lock connection active by using this heartbeat (default 5s) --lock_tables_timeout duration How long to keep the table locked before timing out (default 1m0s) --log_backtrace_at traceLocations when logging hits line file:N, emit a stack trace diff --git a/go/flags/endtoend/vtctld.txt b/go/flags/endtoend/vtctld.txt index 4d036bc98fb..f8e680da0f0 100644 --- a/go/flags/endtoend/vtctld.txt +++ b/go/flags/endtoend/vtctld.txt @@ -91,7 +91,7 @@ Flags: --keep_logs duration keep logs for this long (using ctime) (zero to keep forever) --keep_logs_by_mtime duration keep logs for this long (using mtime) (zero to keep forever) --lameduck-period duration keep running at least this long after SIGTERM before stopping (default 50ms) - --lock-timeout duration Maximum time to wait for while acquiring a lock from the topo server (default 45s) + --lock-timeout duration Maximum time to wait when attempting to acquire a lock from the topo server (default 45s) --log_backtrace_at traceLocations when logging hits line file:N, emit a stack trace --log_dir string If non-empty, write log files in this directory --log_err_stacks log stack traces for errors diff --git a/go/flags/endtoend/vtgate.txt b/go/flags/endtoend/vtgate.txt index 04698307adf..619e7eb0ec8 100644 --- a/go/flags/endtoend/vtgate.txt +++ b/go/flags/endtoend/vtgate.txt @@ -106,7 +106,7 @@ Flags: --keyspaces_to_watch strings Specifies which keyspaces this vtgate should have access to while routing queries or accessing the vschema. --lameduck-period duration keep running at least this long after SIGTERM before stopping (default 50ms) --legacy_replication_lag_algorithm Use the legacy algorithm when selecting vttablets for serving. (default true) - --lock-timeout duration Maximum time to wait for while acquiring a lock from the topo server (default 45s) + --lock-timeout duration Maximum time to wait when attempting to acquire a lock from the topo server (default 45s) --lock_heartbeat_time duration If there is lock function used. This will keep the lock connection active by using this heartbeat (default 5s) --log_backtrace_at traceLocations when logging hits line file:N, emit a stack trace --log_dir string If non-empty, write log files in this directory diff --git a/go/flags/endtoend/vtorc.txt b/go/flags/endtoend/vtorc.txt index fb351758852..841cfc8b556 100644 --- a/go/flags/endtoend/vtorc.txt +++ b/go/flags/endtoend/vtorc.txt @@ -48,7 +48,7 @@ Flags: --keep_logs duration keep logs for this long (using ctime) (zero to keep forever) --keep_logs_by_mtime duration keep logs for this long (using mtime) (zero to keep forever) --lameduck-period duration keep running at least this long after SIGTERM before stopping (default 50ms) - --lock-timeout duration Maximum time to wait for while acquiring a lock from the topo server (default 45s) + --lock-timeout duration Maximum time to wait when attempting to acquire a lock from the topo server (default 45s) --log_backtrace_at traceLocations when logging hits line file:N, emit a stack trace --log_dir string If non-empty, write log files in this directory --log_err_stacks log stack traces for errors diff --git a/go/flags/endtoend/vttablet.txt b/go/flags/endtoend/vttablet.txt index a44ac5878f8..ef050f21e00 100644 --- a/go/flags/endtoend/vttablet.txt +++ b/go/flags/endtoend/vttablet.txt @@ -212,7 +212,7 @@ Flags: --keep_logs duration keep logs for this long (using ctime) (zero to keep forever) --keep_logs_by_mtime duration keep logs for this long (using mtime) (zero to keep forever) --lameduck-period duration keep running at least this long after SIGTERM before stopping (default 50ms) - --lock-timeout duration Maximum time to wait for while acquiring a lock from the topo server (default 45s) + --lock-timeout duration Maximum time to wait when attempting to acquire a lock from the topo server (default 45s) --lock_tables_timeout duration How long to keep the table locked before timing out (default 1m0s) --log_backtrace_at traceLocations when logging hits line file:N, emit a stack trace --log_dir string If non-empty, write log files in this directory diff --git a/go/vt/topo/locks.go b/go/vt/topo/locks.go index 01598c7f874..040dff6ea91 100644 --- a/go/vt/topo/locks.go +++ b/go/vt/topo/locks.go @@ -70,7 +70,7 @@ func init() { func registerTopoLockFlags(fs *pflag.FlagSet) { fs.DurationVar(&RemoteOperationTimeout, "remote_operation_timeout", RemoteOperationTimeout, "time to wait for a remote operation") - fs.DurationVar(&LockTimeout, "lock-timeout", LockTimeout, "Maximum time to wait for while acquiring a lock from the topo server") + fs.DurationVar(&LockTimeout, "lock-timeout", LockTimeout, "Maximum time to wait when attempting to acquire a lock from the topo server") } // newLock creates a new Lock.