Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tenant emergency move to SansShell fdbcli modules #285

Merged
merged 36 commits into from
Aug 11, 2023

Conversation

sfc-gh-jfu
Copy link
Collaborator

@sfc-gh-jfu sfc-gh-jfu commented Aug 2, 2023

After merge: update permissions list to restrict which group of people can run these commands
Provide wrappers for new fdbcli command of the form tenant emergency_move <start|switch|finish|abort|status>
Also add sansshell module

service FDBMove {
rpc FDBMoveDataCopy(FDBMoveDataCopyRequest) returns (FDBMoveDataCopyResponse);
rpc FDBMoveDataWait(FDBMoveDataWaitRequest) returns (FDBMoveDataWaitResponse);
}

to call and wait for fdb_move_orchestrator.py

[jfu@awsuswest2temptest000032 ~]$ ./sanssh --targets localhost:50042 fdb fdbmovedata copy "/etc/foundationdb/fdb.cluster" "\x02awsuswest2temptest000032\x00\x15\x04\x16\x04\x04" "awsuswest2temptest000032_jfu_dst_cluster_1" "awsuswest2temptest000032_jfu_src_cluster_1"

Run fdbmovedata wait 1987524441901984307 to wait for the process to complete

[jfu@awsuswest2temptest000032 ~]$ ./sanssh --targets localhost:50042 fdb fdbmovedata copy "/etc/foundationdb/fdb.cluster" "\x02awsuswest2temptest000032\x00\x15\x04\x16\x04\x04" "awsuswest2temptest000032_jfu_dst_cluster_1" "awsuswest2temptest000032_jfu_src_cluster_1"

An existing command is already running on the server.
Run fdbmovedata wait 1987524441901984307 to wait for the process to complete

[jfu@awsuswest2temptest000032 ~]$ ./sanssh --targets localhost:50042 fdb fdbmovedata copy "/etc/foundationdb/fdb.cluster" "\x02awsuswest2temptest000032\x00\x15\x04\x16\x04\x04" "awsuswest2temptest000032_jfu_dst_cluster_1" "awsuswest2temptest000032_jfu_src_cluster_1"

An existing command is already running on the server.
Run fdbmovedata wait 1987524441901984307 to wait for the process to complete

[jfu@awsuswest2temptest000032 ~]$ ./sanssh --targets localhost:50042 fdb fdbmovedata wait 1723579472755794943

Command execution failure - rpc error: code = Internal desc = Provided ID 1723579472755794943 does not match stored ID 1987524441901984307

[jfu@awsuswest2temptest000032 ~]$ ./sanssh --targets localhost:50042 fdb fdbmovedata wait 1987524441901984307

Management Cluster FDBCLI Commands: ['/usr/bin/fdbcli', '-C', '/etc/foundationdb/fdb.cluster', '--tls_certificate_file', '/etc/foundationdb/fdb.pem', '--tls_ca_file', '/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem', '--tls_key_file', '/etc/foundationdb/fdb.pem', '--exec', 'metacluster get awsuswest2temptest000032_jfu_dst_cluster_1 JSON']
....

@sfc-gh-srhodes sfc-gh-srhodes self-requested a review August 7, 2023 16:27
Copy link
Collaborator

@sfc-gh-srhodes sfc-gh-srhodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy with the grpc interface.

Please add a test for the server before we merge this. The logic around the asynchronous command is complex enough to deserve testing.

services/fdb/server/fdbcli.go Outdated Show resolved Hide resolved
services/fdb/server/fdbmovedata.go Show resolved Hide resolved
services/fdb/server/fdbmovedata.go Show resolved Hide resolved
services/fdb/server/fdbmovedata.go Outdated Show resolved Hide resolved
@sfc-gh-elinardi
Copy link
Collaborator

Let's add some manual test results to the PR description.
For example, running fdbmovedata copy while server's still processing the previous request should result in server returning the previous request id.

@sfc-gh-jfu sfc-gh-jfu merged commit bc4f6da into main Aug 11, 2023
3 checks passed
@sfc-gh-jfu sfc-gh-jfu deleted the jfu-tenant-emergency-move branch August 11, 2023 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants