-
Notifications
You must be signed in to change notification settings - Fork 51
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 notification details to the repair process #338
Conversation
Hi @burmanm, looks like we have failing tests so there are a few preliminary things to do here:
Thanks! |
There are no v2 endpoints in the current mgmt-api master or any structures to them. And this is basically just v0, but added String return result (I was actually considering just changing v0, but since the meta has been v1 for these type of changes, this goes better with v1). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fine. Not sure why the tests aren't running with the formatting changes.
@RpcParam(name = "keyspaceName") String keyspace, | ||
@RpcParam(name = "tables") List<String> tables, | ||
@RpcParam(name = "full") Boolean full) | ||
@RpcParam(name = "full") Boolean full, | ||
@RpcParam(name = "async") boolean notifications) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question:
Why name the parameter "async" but call the variable "notifications"? It would be less confusing if they were named the same or similarly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed. Although I'm not sure if the RpcParam's name is used anywhere?
I have no idea why the tests are not running without doing close/reopen. |
So this is the setup for the workflow: It should run on any commit push, or when a PR is opened or re-opened. I changed that recently as it would run CI twice on a commit push, which is a waste, once for the commit push, once for the update tho the PR. Maybe I'm not understanding how to set this up correctly.... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments/requested changes, mostly to do with the return types.
management-api-agent-common/src/main/java/com/datastax/mgmtapi/util/Job.java
Show resolved
Hide resolved
management-api-server/src/main/java/com/datastax/mgmtapi/resources/v1/NodeOpsResources.java
Show resolved
Hide resolved
management-api-server/src/main/java/com/datastax/mgmtapi/resources/v1/NodeOpsResources.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks good. Please rebase against the integration branch and feel free to merge.
…l - should fix the test also which can not be run otherwise on single node cluster
This is just trying to get GHA flakes out of the way.. slow down the HTTP client call return
* Add repair job version which follows notifications * Add new getStatusChanges and message * Fix formatting * Add tests for the async endpoint in v1 also * Change setStatusChange * Fix test indentation * Rename RpcParam * Fix rebase * Add back the payload in the IT test to the request * Update openapi.json, make special case for return id 0 to the Rpc call - should fix the test also which can not be run otherwise on single node cluster * Disable the test, throw exception if Cassandra refuses to repair * Fix repair test to run repair for a keyspace with RF 2 (#351) * Update openapi.json after rebase --------- Co-authored-by: Erik Merkle <[email protected]>
* Add repair job version which follows notifications * Add new getStatusChanges and message * Fix formatting * Add tests for the async endpoint in v1 also * Change setStatusChange * Fix test indentation * Rename RpcParam * Fix rebase * Add back the payload in the IT test to the request * Update openapi.json, make special case for return id 0 to the Rpc call - should fix the test also which can not be run otherwise on single node cluster * Disable the test, throw exception if Cassandra refuses to repair * Fix repair test to run repair for a keyspace with RF 2 (#351) * Update openapi.json after rebase --------- Co-authored-by: Erik Merkle <[email protected]>
* Add repair job version which follows notifications * Add new getStatusChanges and message * Fix formatting * Add tests for the async endpoint in v1 also * Change setStatusChange * Fix test indentation * Rename RpcParam * Fix rebase * Add back the payload in the IT test to the request * Update openapi.json, make special case for return id 0 to the Rpc call - should fix the test also which can not be run otherwise on single node cluster * Disable the test, throw exception if Cassandra refuses to repair * Fix repair test to run repair for a keyspace with RF 2 (#351) * Update openapi.json after rebase --------- Co-authored-by: Erik Merkle <[email protected]>
* Add repair job version which follows notifications * Add new getStatusChanges and message * Fix formatting * Add tests for the async endpoint in v1 also * Change setStatusChange * Fix test indentation * Rename RpcParam * Fix rebase * Add back the payload in the IT test to the request * Update openapi.json, make special case for return id 0 to the Rpc call - should fix the test also which can not be run otherwise on single node cluster * Disable the test, throw exception if Cassandra refuses to repair * Fix repair test to run repair for a keyspace with RF 2 (#351) * Update openapi.json after rebase --------- Co-authored-by: Erik Merkle <[email protected]>
This provides a /api/v1 version of the /api/v0/ops/node/repair. Adds a new parameter to the Rpc method to indicate if the notifications should be received and stored in the job details.
The /api/v0/ops/node/repair was already async in execution, so /v1 simply adds the ability to follow notifications (and returns the job number to track it). Otherwise they're similar.
Fixes #342