-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BACKPORT pg15-cherrypicks][#22950] DocDB: Add ValidateFlagValue RPC
Summary: Original commit: 507d287 / D36157 Added `ValidateFlagValue` RPC that will check if the given flag value is valid for use, without setting it. Make sure we do not log flag values that are sensitive, or send them back in Status messages. Added `yb-ts-cli validate_flag_value <flag> <value>` command to validate the flag value using the cli tool. Also fixed the `vmodule` flag validator. **Upgrade/Rollback safety:** Proto changes are new RPC which is only used by yb-ts-cli which is always run as the same yb server version, and YBA which will check db version numbers. Fixes #22950 Jira: DB-11865 Test Plan: FlagsTest.ValidateFlagValue ``` $ ./build/latest/bin/yb-ts-cli -server_address 127.0.0.1:9100 validate_flag_value v 3 Flag value is valid ``` ``` $ ./build/latest/bin/yb-ts-cli -server_address 127.0.0.1:9100 validate_flag_value na_flag na_value Invalid flag value: Remote error (yb/rpc/outbound_call.cc:561): Invalid argument (yb/util/flags/flags.cc:746): Unknown command line flag 'na_flag' : Bad value (rpc error 1) ``` ``` $ ./build/latest/bin/yb-ts-cli -server_address 127.0.0.1:9100 validate_flag_value v hari Invalid flag value: Remote error (yb/rpc/outbound_call.cc:561): Invalid argument (yb/util/flags/flags.cc:746): ERROR: illegal value 'hari' specified for int32 flag 'v' : Bad value (rpc error 1) ``` ``` $ ./build/latest/bin/yb-ts-cli -server_address 127.0.0.1:9100 validate_flag_value rpc_throttle_threshold_bytes 1 Invalid flag value: Remote error (yb/rpc/outbound_call.cc:561): Invalid argument (yb/util/flags/flags.cc:746): ERROR: failed validation of new value '1' for flag 'rpc_throttle_threshold_bytes' : common_flags.cc:155] Invalid value '1' for flag 'rpc_throttle_threshold_bytes': Must be at least 16 (rpc error 1) ``` ``` $ ./build/latest/bin/yb-ts-cli -server_address 127.0.0.1:9100 validate_flag_value vmodule asd- Invalid flag value: Remote error (yb/rpc/outbound_call.cc:561): Invalid argument (yb/util/flags/flags.cc:753): ERROR: failed validation of new value 'asd-' for flag 'vmodule' : flags.cc:478] Invalid value 'asd-' for flag 'vmodule': 'asd-' is not valid. vmodule should be a comma list of <module_pattern>=<logging_level> (rpc error 1) ``` Reviewers: jason, tfoucher Reviewed By: jason Subscribers: ybase Tags: #jenkins-ready Differential Revision: https://phorge.dev.yugabyte.com/D36223
- Loading branch information
Showing
7 changed files
with
227 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.