foundationdb icon indicating copy to clipboard operation
foundationdb copied to clipboard

Allow setting of knobs when starting a joshua test

Open dlambrig opened this issue 3 years ago • 1 comments

A joshua test is started by pushing a binary and kv list to an FDB server. An "agent" then discovers it and starts a test.

To run a test with a different knob setting than whats in the binary, FDB must be recompiled. This complicates developer and nightly build workflows. For feature testing it would be useful to change knobs at the time a test is started. Something like: FDB_KNOB_FOO=1 j start --tarball=...

Idea 1 (No change to C# code, change FDB source.)

Pass knob settings in environment variables to FDB. When FDB starts, it looks for JOSHUA_FDB_KNOB_xxx environment variables and sets knobs accordingly.

Idea 2 (No change to FDB source, change C#.)

Pass knob settings to the agent, which converts them to FDB command line arguments.


Notes

  1. Could restrict this to test roles.
  2. The JOSHUA_ prefix could be removed from env vars passed to FDB (if that keyword in FDB source is undesirable).
  3. Could add a knob argument to the j command: j start --knobs='foo=1 bar=0' --tarball=...
  4. Option 1 could simplify some future scripting / automation cases. e.g. no need to format command line argument strings when starting FDB.

dlambrig avatar Jul 22 '22 17:07 dlambrig

In community meeting, decided to go with option 1. Look for env variable naming similar to whats already in FDB.

Note - code that handles network options set via environment variable: https://github.com/apple/foundationdb/blob/118c2ae80643b78a7c241b50158fa0a0a5da15d9/fdbclient/MultiVersionTransaction.actor.cpp#L2594 MultiVersionTransaction.actor.cpp void MultiVersionApi::loadEnvironmentVariableNetworkOptions() {

dlambrig avatar Jul 25 '22 20:07 dlambrig