Commit Graph

47 Commits

Author SHA1 Message Date
Lukas Joswiak
bfb1c51299 Add clearknob fdbcli command
The `clearknob` command clears the value that a knob has been set to in
the configuration database. Note that this does not mean the knob value
itself gets cleared - only the value in the configuration database is
cleared. The value of the knob will revert to whatever is hardcoded in
the corresponding `*Knobs.cpp` file.

Sample `fdbcli` session:

```
Welcome to the fdbcli. For help, type `help'.
fdb> getknob min_trace_severity
`min_trace_severity' is not found
fdb> setknob min_trace_severity 20
Please set a description for the change. Description must be non-empty
description: test
Committed (2)
fdb> getknob min_trace_severity
`min_trace_severity' is `20'
fdb> clearknob min_trace_severity
Please set a description for the change. Description must be non-empty
description: clear
Committed (4)
fdb> getknob min_trace_severity
`min_trace_severity' is not found
```

Transactions are also supported with the new `clearknob` command:

```
Welcome to the fdbcli. For help, type `help'.
fdb> begin
Transaction started
fdb> setknob min_trace_severity 20
fdb> clearknob min_trace_severity
fdb> commit
Please set a description for the change. Description must be non-empty.
description: test
Committed (16)
fdb> getknob min_trace_severity
`min_trace_severity' is not found
```
2023-08-31 17:36:05 -07:00
Yanqin Jin
626a8a1a5f SNOW-804199 Support restoring a cluster with a tenant in the error state (#357)
If we restore a cluster and a previously created tenant was not included in the backup, then the tenant will be marked in an error state on the management cluster. It is then up to the operator to resolve the error, generally by deleting the tenant and recreating it if needed.

There is, however, the possibility that we restored a backup that was older than we wanted, and a newer backup would have the tenant. If we tried to restore the newer backup, it would not leave the previously missing tenant in a fully usable state.

We need to have a way to deal with this case. One option is to allow us to clear the error state of a tenant, and that can be performed before (or maybe even after) the second restore.

Test plan:
Joshua test
100K ensemble: 20230613-225414-yajin-439d13ef3c6b3afd fail=0
2023-06-15 22:23:46 -07:00
Jon Fu
b4e2aef58b add tenant_id_prefix to metacluster status (#10455) 2023-06-09 15:03:49 -04:00
Yanqin Jin
01fddb7799 Add ignore_capacity_limit to tenant create (#10173)
Similar to `tenant configure`, this PR adds `ignore_capacity_limit` as an optional argument to `tenant create`.
This allows the user of fdbcli to create a new tenant on an **assigned** cluster, ignoring the tenant group capacity
on that specific cluster.
When creating a tenant with `ignore_capacity_limit`.
- If the user does not specify `assigned_cluster`, this is an error.
- If the user specifies `assigned_cluster`,
  - user does not specify `tenant_group`, then the new tenant will be an ungrouped tenant on the `assigned_cluster` ignoring the capacity limit
  - user specifies `tenant_group`,
    - if `tenant_group` does not exist, then the new tenant will be created on the assigned cluster and the tenant group will be implicitly created.
    - if `tenant_group` already exists, then additional check will make sure the tenant_group's cluster matches what the user specifies.

Test plan:
Simulation and metacluster_fdbcli_tests.py
---------

Co-authored-by: A.J. Beamon <aj.beamon@snowflake.com>
2023-05-10 13:19:32 -07:00
A.J. Beamon
0035d9c519 Merge pull request #10074 from sfc-gh-ajbeamon/apply-black-format
Apply black format to most Python files
2023-05-02 08:20:47 -07:00
Yanqin Jin
8b1fe728be Add configuration option auto_tenant_assignment to data clusters (#10058)
This PR adds auto_tenant_assignment option to register/configure data clusters.
Setting auto_tenant_assignment to disabled means the data cluster is a dedicated one and won't be
used for auto tenant assignment. This option is enabled by default (allowing auto tenant assignment).

Test plan:
simulation tests and metacluster_fdbcli_tests.py
---------

Co-authored-by: A.J. Beamon <aj.beamon@snowflake.com>
2023-05-01 21:58:49 -07:00
A.J. Beamon
182dc93ebd Apply black format to most Python files, excluding a few cases where we have Python 2 files and a few files written externally. Add external files as exclusions to the precommit checks. 2023-04-28 11:46:41 -07:00
Yanqin Jin
2959d07797 Add test coverage for metacluster operations via fdbcli (#9802)
Add test coverage for metacluster operations via fdbcli

Test plan:

```bash
mkdir build && cd build && cmake -G Ninja ..
ninja fdbcli fdbserver fdbmonitor
ctest -R metacluster_fdbcli_tests
```
2023-04-14 07:42:55 -07:00
Chaoguang Lin
b9935ef6b4 Add wait at the end of versionepoch which triggers recovery; add start&end logging of each command test 2023-04-04 17:05:47 -07:00
Jon Fu
b751d0f87c Add tenant getId api to fdbcli (#9658)
* add tenant getId api to fdbcli

* add to fdbcli tests and address review comments

* fix fdbcli tests
2023-03-13 18:06:03 -04:00
Ankita Kejriwal
ffa0aa4a7b Update the expected error message from exclude in fdbcli_tests (#9648) 2023-03-10 19:49:20 -08:00
Chaoguang Lin
e123a51b50 remove the time guard on fdbcli commands in tests 2023-03-01 11:09:47 -08:00
A.J. Beamon
469e77158f Add metacluster support for tenant locking 2023-02-27 16:53:13 -08:00
Markus Pilman
ed1079fc7d Remove wrong comment 2023-02-27 15:27:16 -07:00
Markus Pilman
1689e36d14 Fix uid extraction from lock command output 2023-02-27 15:24:07 -07:00
Markus Pilman
a0e347c7ba Merge remote-tracking branch 'origin/main' into features/tenant-lock-fdbcli 2023-02-27 09:09:20 -07:00
A.J. Beamon
217b52103c Clean up some code for the tenant configure command; Add a second test with an invalid configuration string, this time with an unknown token and a prior valid configuration string 2023-02-25 13:08:02 -08:00
A.J. Beamon
8c3ee768a2 Add an option to allow exceeding the tenant group capacity limit when changing tenant configuration 2023-02-24 21:01:36 -08:00
Nim Wijetunga
836ec1a908 add failure test 2023-02-24 15:42:29 -08:00
Nim Wijetunga
c8b7cff10c fix api test 2023-02-24 15:26:59 -08:00
Markus Pilman
6c15506c36 Fixed tests 2023-02-24 11:32:37 -07:00
Markus Pilman
b1762916fb Merge remote-tracking branch 'origin/main' into features/tenant-lock-fdbcli 2023-02-22 16:27:24 -07:00
Jon Fu
5edf78ddce fix fdbcli_tests 2023-02-21 13:00:57 -08:00
Ankita Kejriwal
bef39ffc64 Merge pull request #9084 from sfc-gh-akejriwal/fdbcli
Add fdbcli commands for checking the status of and clearing old idempotency ids
2023-02-21 08:44:46 -08:00
Yanqin Jin
07cdd34f26 Update metacluster_fdbcli_tests.py (#9406)
Update metacluster_fdbcli_tests.py

This commit has no impact on functionality.

Test plan:
- ctest -R metacluster_fdbcli_tests.py
2023-02-17 12:40:02 -08:00
Yanqin Jin
c3d6ae0213 Throw invalid_tenant_configuration when changing assigned cluster (#9350)
Since we currently do not support tenant movement, we should as well explicitly disallow changing the assigned
cluster of a tenant during configuration by throwing `invalid_tenant_configuration` for now.

Test plan:
- add coverage for changing assigned cluster during tenant configuration
- fdbcli
- simulation tests
2023-02-16 14:20:59 -08:00
Markus Pilman
32684c802b Add tenant lock commands and fdcli tests 2023-02-14 16:05:21 +01:00
Ankita Kejriwal
983f677821 Merge branch 'main' of github.com:apple/foundationdb into fdbcli 2023-02-13 16:13:11 -08:00
Nim Wijetunga
f775116214 fix test 2023-02-10 02:26:32 -08:00
Ankita Kejriwal
27f9c1e06e Merge branch 'main' of github.com:apple/foundationdb into fdbcli 2023-01-27 15:03:27 -08:00
Ankita Kejriwal
f37aeb76e2 Fix the way the usage message is printed by idempotencyids command
This code was written with sfc-gh-anoyes and sfc-gh-clin
2023-01-27 15:00:53 -08:00
Yanqin Jin
d461dbdd7b Extend metacluster status on non-management clusters (#9179)
The metacluster status command in fdbcli currently reports some useful metacluster information when run on a
management cluster. We should update this command to report a status even on data clusters of a metacluster and
standalone clusters that do not belong to any metacluster.

- On data clusters, this would report that the cluster is a data cluster as well its name and the name of the metacluster it is a part of.
- On standalone clusters, status should report that the cluster is not part of a metacluster.

Test plan:
- CI
- Manual test
- Added new test `metacluster_fdbcli_tests.py` that can be run with ctest `ctest -R metacluster_fdbcli_tests`
2023-01-26 13:04:22 -08:00
Ankita Kejriwal
db520d423a Add fdbcli commands for checking the status of and clearing old idempotency ids 2022-12-22 23:56:55 -08:00
Ankita Kejriwal
52319eaa39 Fix formatting in fdbcli_tests.py as per pre-commit hooks 2022-12-22 21:07:31 -08:00
A.J. Beamon
7cc79ccf68 Add tenant name to tenant map entry and remove the encrypted field 2022-12-05 12:26:01 -08:00
Jon Fu
349f5821d7 Merge pull request #8592 from sfc-gh-jfu/tenant-list-filter
Add option to filter the tenant list command for metacluster
2022-11-17 09:04:58 -08:00
Jon Fu
2f53c6ebd8 remove extra test check 2022-11-15 10:32:19 -08:00
Ankita Kejriwal
3deb9a413b Add fdbcli commands to get, set, and clear storage quota 2022-11-14 18:26:54 -08:00
Jon Fu
410b4375d2 change fdbcli_tests.py 2022-11-14 13:08:56 -08:00
Chaoguang Lin
9b1c8ba932 Disable the quota,suspend commands; Add timeout for fdbcli commands (#8785) 2022-11-10 21:25:11 -08:00
sfc-gh-tclinkenbeard
78b6779f11 Update fdbcli_tests.py quota test 2022-10-22 19:37:33 -07:00
sfc-gh-tclinkenbeard
8c082dac4e Expand quota tests in fdbcli_tests.py 2022-10-17 18:56:11 -07:00
sfc-gh-tclinkenbeard
7e4f380423 Add tests for fdbcli quota commands 2022-10-17 16:27:45 -07:00
Kevin Hoxha
2f898fb006 fdbcli: Add documentation for setknob/getknob commands 2022-10-11 15:32:01 -07:00
Kevin Hoxha
ff1b2df8f6 fdbcli: Add options for knob management
- setknob <knob_name> <knob_value> [config_class]
- getknob <knob_name> [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
2022-10-11 15:32:01 -07:00
Junhyun Shim
fd621c0c86 Make TLSConfig check against coordinator addresses one-way
TLS parameters may be loaded by default system paths, which would break
non-TLS cases
2022-09-27 20:57:38 +02:00
A.J. Beamon
2e41eb8a4a Move fdbcli tests into the fdbcli directory 2022-09-22 16:05:56 -07:00