-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(upgrade): upgrade with raft topology procedure
After upgrade to latest master(6.0) raft topology feature or tablets + raft topology features will be enabled by default To switch cluster from gossiper to raft topology, raft topology procedure should be executed. It is described here: https://github.com/scylladb/scylladb/blob/c5601a749e21fc710958a7c84316ecdf5943022c/docs/dev/topology-over-raft.md section: Upgrade from legacy topology to raft-based topology
- Loading branch information
1 parent
f99d288
commit 8b75680
Showing
7 changed files
with
95 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as published by | ||
# the Free Software Foundation; either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
# | ||
# See LICENSE for more details. | ||
# | ||
# Copyright (c) 2022 ScyllaDB | ||
import json | ||
from sdcm.cluster import BaseNode | ||
from sdcm.rest.remote_curl_client import RemoteCurlClient | ||
from sdcm.wait import wait_for | ||
|
||
|
||
class RaftUpgradeProcedure(RemoteCurlClient): | ||
def __init__(self, node: BaseNode): | ||
super().__init__(host="localhost:10000", endpoint="storage_service", node=node) | ||
|
||
def start_upgrade_procedure(self) -> str: | ||
path = "raft_topology/upgrade" | ||
return self.run_remoter_curl(method="POST", path=path, params=None, timeout=30).stdout.strip() | ||
|
||
def get_upgrade_procedure_status(self) -> str: | ||
""" rest api return json string""" | ||
path = "raft_topology/upgrade" | ||
return json.loads(self.run_remoter_curl(method="GET", path=path, params=None, timeout=30).stdout.strip()) | ||
|
||
def wait_upgrade_procedure_done(self): | ||
wait_for(lambda: self.get_upgrade_procedure_status().lower() == "done", | ||
step=5, text="Check raft upgrade procedure state", timeout=60) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters