Skip to content

Commit

Permalink
Make --pprof-http default to false (#15260)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Mason <andrew@planetscale.com>
  • Loading branch information
Andrew Mason committed Feb 15, 2024
1 parent 1c9388e commit f82fb7c
Show file tree
Hide file tree
Showing 20 changed files with 28 additions and 25 deletions.
10 changes: 10 additions & 0 deletions changelog/20.0/20.0.0/summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
- [Vindex Hints](#vindex-hints)
- [Update with Limit Support](#update-limit)
- [Update with Multi Table Support](#multi-table-update)
- **[Flag changes](#flag-changes)**
- [`pprof-http` default change](#pprof-http-default)
- **[Minor Changes](#minor-changes)**


Expand Down Expand Up @@ -43,6 +45,14 @@ Example: `update t1 join t2 on t1.id = t2.id join t3 on t1.col = t3.col set t1.b

More details about how it works is available in [MySQL Docs](https://dev.mysql.com/doc/refman/8.0/en/update.html)

### <a id="flag-changes"/>Flag Changes

#### <a id="pprof-http-default"/> `pprof-http` Default Change

The `--pprof-http` flag, which was introduced in v19 with a default of `true`, has now been changed to default to `false`.
This makes HTTP `pprof` endpoints now an *opt-in* feature, rather than opt-out.
To continue enabling these endpoints, explicitly set `--pprof-http` when starting up Vitess components.


## <a id="minor-changes"/>Minor Changes

2 changes: 1 addition & 1 deletion go/flags/endtoend/mysqlctl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Flags:
--pid_file string If set, the process will write its pid to the named file, and delete it on graceful shutdown.
--pool_hostname_resolve_interval duration if set force an update to all hostnames and reconnect if changed, defaults to 0 (disabled)
--pprof strings enable profiling
--pprof-http enable pprof http endpoints (default true)
--pprof-http enable pprof http endpoints
--purge_logs_interval duration how often try to remove old logs (default 1h0m0s)
--replication_connect_retry duration how long to wait in between replica reconnect attempts. Only precise to the second. (default 10s)
--security_policy string the name of a registered security policy to use for controlling access to URLs - empty means allow all for anyone (built-in policies: deny-all, read-only)
Expand Down
2 changes: 1 addition & 1 deletion go/flags/endtoend/mysqlctld.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Flags:
--pool_hostname_resolve_interval duration if set force an update to all hostnames and reconnect if changed, defaults to 0 (disabled)
--port int port for the server
--pprof strings enable profiling
--pprof-http enable pprof http endpoints (default true)
--pprof-http enable pprof http endpoints
--purge_logs_interval duration how often try to remove old logs (default 1h0m0s)
--replication_connect_retry duration how long to wait in between replica reconnect attempts. Only precise to the second. (default 10s)
--security_policy string the name of a registered security policy to use for controlling access to URLs - empty means allow all for anyone (built-in policies: deny-all, read-only)
Expand Down
2 changes: 1 addition & 1 deletion go/flags/endtoend/topo2topo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Flags:
--log_rotate_max_size uint size in bytes at which logs are rotated (glog.MaxSize) (default 1887436800)
--logtostderr log to standard error instead of files
--pprof strings enable profiling
--pprof-http enable pprof http endpoints (default true)
--pprof-http enable pprof http endpoints
--purge_logs_interval duration how often try to remove old logs (default 1h0m0s)
--security_policy string the name of a registered security policy to use for controlling access to URLs - empty means allow all for anyone (built-in policies: deny-all, read-only)
--stderrthreshold severityFlag logs at or above this threshold go to stderr (default 1)
Expand Down
2 changes: 1 addition & 1 deletion go/flags/endtoend/vtaclcheck.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Flags:
--log_rotate_max_size uint size in bytes at which logs are rotated (glog.MaxSize) (default 1887436800)
--logtostderr log to standard error instead of files
--pprof strings enable profiling
--pprof-http enable pprof http endpoints (default true)
--pprof-http enable pprof http endpoints
--purge_logs_interval duration how often try to remove old logs (default 1h0m0s)
--security_policy string the name of a registered security policy to use for controlling access to URLs - empty means allow all for anyone (built-in policies: deny-all, read-only)
--static-auth-file string The path of the auth_server_static JSON file to check
Expand Down
2 changes: 1 addition & 1 deletion go/flags/endtoend/vtbackup.txt
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ Flags:
--opentsdb_uri string URI of opentsdb /api/put method
--port int port for the server
--pprof strings enable profiling
--pprof-http enable pprof http endpoints (default true)
--pprof-http enable pprof http endpoints
--purge_logs_interval duration how often try to remove old logs (default 1h0m0s)
--remote_operation_timeout duration time to wait for a remote operation (default 15s)
--restart_before_backup Perform a mysqld clean/full restart after applying binlogs, but before taking the backup. Only makes sense to work around xtrabackup bugs.
Expand Down
2 changes: 1 addition & 1 deletion go/flags/endtoend/vtbench.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Flags:
--mysql_server_version string MySQL server version to advertise. (default "8.0.30-Vitess")
--port int VTGate port
--pprof strings enable profiling
--pprof-http enable pprof http endpoints (default true)
--pprof-http enable pprof http endpoints
--protocol string Client protocol, either mysql (default), grpc-vtgate, or grpc-vttablet (default "mysql")
--purge_logs_interval duration how often try to remove old logs (default 1h0m0s)
--security_policy string the name of a registered security policy to use for controlling access to URLs - empty means allow all for anyone (built-in policies: deny-all, read-only)
Expand Down
2 changes: 1 addition & 1 deletion go/flags/endtoend/vtclient.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Flags:
--mysql_server_version string MySQL server version to advertise. (default "8.0.30-Vitess")
--parallel int DMLs only: Number of threads executing the same query in parallel. Useful for simple load testing. (default 1)
--pprof strings enable profiling
--pprof-http enable pprof http endpoints (default true)
--pprof-http enable pprof http endpoints
--purge_logs_interval duration how often try to remove old logs (default 1h0m0s)
--qps int queries per second to throttle each thread at.
--security_policy string the name of a registered security policy to use for controlling access to URLs - empty means allow all for anyone (built-in policies: deny-all, read-only)
Expand Down
2 changes: 1 addition & 1 deletion go/flags/endtoend/vtcombo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ Flags:
--pool_hostname_resolve_interval duration if set force an update to all hostnames and reconnect if changed, defaults to 0 (disabled)
--port int port for the server
--pprof strings enable profiling
--pprof-http enable pprof http endpoints (default true)
--pprof-http enable pprof http endpoints
--proto_topo vttest.TopoData vttest proto definition of the topology, encoded in compact text format. See vttest.proto for more information.
--proxy_protocol Enable HAProxy PROXY protocol on MySQL listener socket
--proxy_tablets Setting this true will make vtctld proxy the tablet status instead of redirecting to them
Expand Down
2 changes: 1 addition & 1 deletion go/flags/endtoend/vtctlclient.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Usage of vtctlclient:
--logbuflevel int Buffer log messages logged at this level or lower (-1 means don't buffer; 0 means buffer INFO only; ...). Has limited applicability on non-prod platforms.
--logtostderr log to standard error instead of files
--pprof strings enable profiling
--pprof-http enable pprof http endpoints (default true)
--pprof-http enable pprof http endpoints
--purge_logs_interval duration how often try to remove old logs (default 1h0m0s)
--security_policy string the name of a registered security policy to use for controlling access to URLs - empty means allow all for anyone (built-in policies: deny-all, read-only)
--server string server to use for connection
Expand Down
2 changes: 1 addition & 1 deletion go/flags/endtoend/vtctld.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Flags:
--pid_file string If set, the process will write its pid to the named file, and delete it on graceful shutdown.
--port int port for the server
--pprof strings enable profiling
--pprof-http enable pprof http endpoints (default true)
--pprof-http enable pprof http endpoints
--proxy_tablets Setting this true will make vtctld proxy the tablet status instead of redirecting to them
--purge_logs_interval duration how often try to remove old logs (default 1h0m0s)
--remote_operation_timeout duration time to wait for a remote operation (default 15s)
Expand Down
2 changes: 1 addition & 1 deletion go/flags/endtoend/vtexplain.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Flags:
--output-mode string Output in human-friendly text or json (default "text")
--planner-version string Sets the default planner to use. Valid values are: Gen4, Gen4Greedy, Gen4Left2Right
--pprof strings enable profiling
--pprof-http enable pprof http endpoints (default true)
--pprof-http enable pprof http endpoints
--purge_logs_interval duration how often try to remove old logs (default 1h0m0s)
--replication-mode string The replication mode to simulate -- must be set to either ROW or STATEMENT (default "ROW")
--schema string The SQL table schema
Expand Down
2 changes: 1 addition & 1 deletion go/flags/endtoend/vtgate.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ Flags:
--planner-version string Sets the default planner to use when the session has not changed it. Valid values are: Gen4, Gen4Greedy, Gen4Left2Right
--port int port for the server
--pprof strings enable profiling
--pprof-http enable pprof http endpoints (default true)
--pprof-http enable pprof http endpoints
--proxy_protocol Enable HAProxy PROXY protocol on MySQL listener socket
--purge_logs_interval duration how often try to remove old logs (default 1h0m0s)
--query-timeout int Sets the default query timeout (in ms). Can be overridden by session variable (query_timeout) or comment directive (QUERY_TIMEOUT_MS)
Expand Down
2 changes: 1 addition & 1 deletion go/flags/endtoend/vtgateclienttest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Flags:
--pid_file string If set, the process will write its pid to the named file, and delete it on graceful shutdown.
--port int port for the server
--pprof strings enable profiling
--pprof-http enable pprof http endpoints (default true)
--pprof-http enable pprof http endpoints
--purge_logs_interval duration how often try to remove old logs (default 1h0m0s)
--security_policy string the name of a registered security policy to use for controlling access to URLs - empty means allow all for anyone (built-in policies: deny-all, read-only)
--service_map strings comma separated list of services to enable (or disable if prefixed with '-') Example: grpc-queryservice
Expand Down
2 changes: 1 addition & 1 deletion go/flags/endtoend/vtorc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Flags:
--pid_file string If set, the process will write its pid to the named file, and delete it on graceful shutdown.
--port int port for the server
--pprof strings enable profiling
--pprof-http enable pprof http endpoints (default true)
--pprof-http enable pprof http endpoints
--prevent-cross-cell-failover Prevent VTOrc from promoting a primary in a different cell than the current primary in case of a failover
--purge_logs_interval duration how often try to remove old logs (default 1h0m0s)
--reasonable-replication-lag duration Maximum replication lag on replicas which is deemed to be acceptable (default 10s)
Expand Down
2 changes: 1 addition & 1 deletion go/flags/endtoend/vttablet.txt
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ Flags:
--pool_hostname_resolve_interval duration if set force an update to all hostnames and reconnect if changed, defaults to 0 (disabled)
--port int port for the server
--pprof strings enable profiling
--pprof-http enable pprof http endpoints (default true)
--pprof-http enable pprof http endpoints
--pt-osc-path string override default pt-online-schema-change binary full path
--publish_retry_interval duration how long vttablet waits to retry publishing the tablet record (default 30s)
--purge_logs_interval duration how often try to remove old logs (default 1h0m0s)
Expand Down
2 changes: 1 addition & 1 deletion go/flags/endtoend/vttestserver.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Flags:
--pool_hostname_resolve_interval duration if set force an update to all hostnames and reconnect if changed, defaults to 0 (disabled)
--port int Port to use for vtcombo. If this is 0, a random port will be chosen.
--pprof strings enable profiling
--pprof-http enable pprof http endpoints (default true)
--pprof-http enable pprof http endpoints
--proto_topo string Define the fake cluster topology as a compact text format encoded vttest proto. See vttest.proto for more information.
--purge_logs_interval duration how often try to remove old logs (default 1h0m0s)
--queryserver-config-transaction-timeout float query server transaction timeout (in seconds), a transaction will be killed if it takes longer than this value
Expand Down
2 changes: 1 addition & 1 deletion go/flags/endtoend/zkctl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Flags:
--log_rotate_max_size uint size in bytes at which logs are rotated (glog.MaxSize) (default 1887436800)
--logtostderr log to standard error instead of files
--pprof strings enable profiling
--pprof-http enable pprof http endpoints (default true)
--pprof-http enable pprof http endpoints
--purge_logs_interval duration how often try to remove old logs (default 1h0m0s)
--stderrthreshold severityFlag logs at or above this threshold go to stderr (default 1)
--v Level log level for V logs
Expand Down
7 changes: 0 additions & 7 deletions go/vt/servenv/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ import (
"net/http"
"net/http/pprof"

"github.com/spf13/pflag"

"vitess.io/vitess/go/vt/log"
"vitess.io/vitess/go/vt/servenv/internal/mux"
)

Expand Down Expand Up @@ -53,10 +50,6 @@ func HTTPRegisterProfile() {
return
}

if !pflag.Lookup("pprof-http").Changed {
log.Warning("Beginning in v20, pprof-http will default to `false`; to continue enabling pprof endpoints, please manually set this flag before upgrading.")
}

HTTPHandleFunc("/debug/pprof/", pprof.Index)
HTTPHandleFunc("/debug/pprof/cmdline", pprof.Cmdline)
HTTPHandleFunc("/debug/pprof/profile", pprof.Profile)
Expand Down
2 changes: 1 addition & 1 deletion go/vt/servenv/pprof.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (

var (
pprofFlag []string
httpPprof = true
httpPprof bool
)

type profmode string
Expand Down

0 comments on commit f82fb7c

Please sign in to comment.