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 notification details to the repair process #338

Merged
merged 16 commits into from
Aug 22, 2023

Conversation

burmanm
Copy link
Contributor

@burmanm burmanm commented Aug 8, 2023

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

@burmanm burmanm marked this pull request as ready for review August 10, 2023 14:35
@burmanm burmanm closed this Aug 11, 2023
@burmanm burmanm reopened this Aug 11, 2023
@Miles-Garnsey
Copy link
Member

Miles-Garnsey commented Aug 15, 2023

Hi @burmanm, looks like we have failing tests so there are a few preliminary things to do here:

  1. Can we move these endpoints into v2 (all new endpoints are v2 at this point).
  2. We should be able to get these into the new client jar now that this PR is ready.
  3. There are failing tests, can you mark this as draft until it is passing?
  4. Please create an issue on this repo for tracking purposes.

Thanks!

@burmanm
Copy link
Contributor Author

burmanm commented Aug 15, 2023

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).

@burmanm burmanm closed this Aug 15, 2023
@burmanm burmanm reopened this Aug 15, 2023
Copy link
Contributor

@emerkle826 emerkle826 left a 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)
Copy link
Contributor

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.

Copy link
Contributor Author

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?

@burmanm burmanm closed this Aug 16, 2023
@burmanm burmanm reopened this Aug 16, 2023
@burmanm
Copy link
Contributor Author

burmanm commented Aug 16, 2023

I have no idea why the tests are not running without doing close/reopen.

@emerkle826
Copy link
Contributor

I have no idea why the tests are not running without doing close/reopen.

So this is the setup for the workflow:
https://github.com/k8ssandra/management-api-for-apache-cassandra/actions/runs/5875182561/workflow#L3-L6

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....

Copy link
Member

@Miles-Garnsey Miles-Garnsey left a 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.

@burmanm burmanm closed this Aug 21, 2023
@burmanm burmanm reopened this Aug 21, 2023
@burmanm burmanm closed this Aug 21, 2023
@burmanm burmanm reopened this Aug 21, 2023
@burmanm burmanm closed this Aug 21, 2023
@burmanm burmanm reopened this Aug 21, 2023
@Miles-Garnsey Miles-Garnsey changed the base branch from master to feature/client-gen August 22, 2023 07:15
Copy link
Member

@Miles-Garnsey Miles-Garnsey left a 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.

@burmanm burmanm merged commit 4d2a772 into k8ssandra:feature/client-gen Aug 22, 2023
1 check passed
emerkle826 added a commit that referenced this pull request Sep 15, 2023
* 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]>
emerkle826 added a commit that referenced this pull request Sep 15, 2023
* 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]>
emerkle826 added a commit that referenced this pull request Oct 12, 2023
* 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]>
emerkle826 added a commit that referenced this pull request Oct 12, 2023
* 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]>
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.

Allow subscribing to async ProgressEvents from Cassandra
3 participants