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

[DNM] MCOL-5133: Stage3 stand alone cli tool. #3397

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

mariadb-AlanMologorsky
Copy link
Contributor

MAJOR: Some logic inside node remove changed significantly using active
nodes list from Columnstore.xml to broadcast config after remove.

  • [fix] remove node logic to use Transaction manager
  • [fix] cluster set api key call using totp on a top level cli call
  • [add] missed docstrings

[add] cluster api client class
[fix] cli cluster_app using cluster api client
[add] ClusterAction Enum
[add] toggle_cluster_state function to reduce code duplication
[fix] client class methods
[fix] Transaction management at endpoint handling level
[fix] add_node and set_mode methods to use TransactionManager
    MAJOR: Some logic inside node remove changed significantly using active
    nodes list from Columnstore.xml to broadcast config after remove.

 [fix] remove node logic to use Transaction manager
 [fix] cluster set api key call using totp on a top level cli call
 [add] missed docstrings
@mariadb-AlanMologorsky mariadb-AlanMologorsky changed the title MCOL-5133: Stage3 stand alone cli tool. [DNM] MCOL-5133: Stage3 stand alone cli tool. Jan 31, 2025
raise CMAPIBasicError('Error while removing node.') from err

response['node_id'] = node
if len(txn_nodes) > 0:
active_nodes = get_active_nodes(config)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you elaborate on the reasons for this change @mariadb-AlanMologorsky ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. Now TransactionManager class used and this value is out of inner function scope.
  2. While I investigate how to make it visible I made a valuable conclusion that all the time it was wrong logic:
    Checking number of nodes which had successful start of transaction after removing one of them is invalid by default. At least there are corner case with removing last one node. I used active nodes from updated MCS configuration instead.

)
response.raise_for_status()
return response.json()
# TODO: different handler for timeout exception?
Copy link
Collaborator

Choose a reason for hiding this comment

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

Good idea.
Could you point me where do we release the lock if something went south during execution of a command on a cluster ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Api client itself just calling remote endpoint, thansaction mechanics never used here. Otherwise it's used on a top level. For eg. here

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