From ff1b2df8f65615086f53a0fa1b5927dfa98127ea Mon Sep 17 00:00:00 2001 From: Kevin Hoxha Date: Tue, 4 Oct 2022 15:25:56 -0700 Subject: [PATCH] fdbcli: Add options for knob management - setknob [config_class] - getknob [config_class] - Added new option to begin to specify if it's a configuration txn. Syntax is begin [config-txn] - Added utility function for converting tuples to string - Added knobmanagment test in fdbcli_tests.py --- fdbcli/fdbcli.actor.cpp | 200 ++++++++++++++++++++++++++-- fdbcli/tests/fdbcli_tests.py | 53 ++++++++ fdbclient/ConfigKnobs.cpp | 11 +- fdbclient/Tuple.cpp | 42 ++++++ fdbclient/include/fdbclient/Tuple.h | 1 + fdbserver/worker.actor.cpp | 3 +- flow/Knobs.cpp | 8 +- 7 files changed, 296 insertions(+), 22 deletions(-) diff --git a/fdbcli/fdbcli.actor.cpp b/fdbcli/fdbcli.actor.cpp index a5c2e2e75a..886f5e9620 100644 --- a/fdbcli/fdbcli.actor.cpp +++ b/fdbcli/fdbcli.actor.cpp @@ -499,11 +499,14 @@ void initHelp() { "transaction, and are automatically committed for you. By explicitly beginning a transaction, " "successive operations are all performed as part of a single transaction.\n\nTo commit the " "transaction, use the commit command. To discard the transaction, use the reset command."); - helpMap["commit"] = CommandHelp("commit", + helpMap["commit"] = CommandHelp("commit [description]", "commit the current transaction", "Any sets or clears executed after the start of the current transaction will be " "committed to the database. On success, the committed version number is displayed. " - "If commit fails, the error is displayed and the transaction must be retried."); + "If commit fails, the error is displayed and the transaction must be retried. The " + "command optionally allows for a description in case the transaction targets the " + "configuration database. If no description is provided in the command, a prompt " + "will be shown asking for a relevant description of the configuration change"); helpMap["clear"] = CommandHelp( "clear ", "clear a key from the database", @@ -552,6 +555,14 @@ void initHelp() { helpMap["set"] = CommandHelp("set ", "set a value for a given key", "If KEY is not already present in the database, it will be created." ESCAPINGKV); + + helpMap["setknob"] = CommandHelp("setknob [CONFIG_CLASS]", + "updates a knob to specified value", + "setknob will prompt for a descrption of the changes" ESCAPINGKV); + + helpMap["getknob"] = CommandHelp( + "getknob [CONFIG_CLASS]", "gets the value of the specified knob", "CONFIG_CLASS is optional." ESCAPINGK); + helpMap["option"] = CommandHelp( "option