forked from scylladb/scylladb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge 'Fixes and tests for raft-based topology changes' from Kamil Braun
Fix two issues with the replace operation introduced by recent PRs. Add a test which performs a sequence of basic topology operations (bootstrap, decommission, removenode, replace) in a new suite that enables the `raft` experimental feature (so that the new topology change coordinator code is used). Fixes: scylladb#13651 Closes scylladb#13655 * github.com:scylladb/scylladb: test: new suite for testing raft-based topology test: remove topology_custom/test_custom.py raft topology: don't require new CDC generation UUID to always be present raft topology: include shard_count/ignore_msb during replace
- Loading branch information
Showing
8 changed files
with
79 additions
and
25 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 was deleted.
Oops, something went wrong.
Empty file.
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,9 @@ | ||
# | ||
# Copyright (C) 2023-present ScyllaDB | ||
# | ||
# SPDX-License-Identifier: AGPL-3.0-or-later | ||
# | ||
# This file configures pytest for all tests in this directory, and also | ||
# defines common test fixtures for all of them to use | ||
|
||
from test.topology.conftest import * |
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,9 @@ | ||
[pytest] | ||
asyncio_mode = auto | ||
|
||
log_cli = true | ||
log_format = %(asctime)s.%(msecs)03d %(levelname)s> %(message)s | ||
log_date_format = %H:%M:%S | ||
|
||
markers = | ||
slow: tests that take more than 30 seconds to run |
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,7 @@ | ||
type: Topology | ||
pool_size: 4 | ||
cluster_size: 0 | ||
extra_scylla_config_options: | ||
authenticator: AllowAllAuthenticator | ||
authorizer: AllowAllAuthorizer | ||
experimental_features: ['raft'] |
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,41 @@ | ||
# | ||
# Copyright (C) 2023-present ScyllaDB | ||
# | ||
# SPDX-License-Identifier: AGPL-3.0-or-later | ||
# | ||
from test.pylib.scylla_cluster import ReplaceConfig | ||
from test.pylib.manager_client import ManagerClient | ||
from test.pylib.util import unique_name | ||
from test.topology.util import check_token_ring_and_group0_consistency | ||
|
||
import pytest | ||
import logging | ||
|
||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_topology_ops(request, manager: ManagerClient): | ||
"""Test basic topology operations using the topology coordinator.""" | ||
logger.info("Bootstrapping cluster") | ||
servers = [await manager.server_add(), await manager.server_add(), await manager.server_add()] | ||
|
||
logger.info(f"Stopping node {servers[0]}") | ||
await manager.server_stop_gracefully(servers[0].server_id) | ||
|
||
logger.info(f"Replacing node {servers[0]}") | ||
replace_cfg = ReplaceConfig(replaced_id = servers[0].server_id, reuse_ip_addr = False, use_host_id = False) | ||
servers = servers[1:] + [await manager.server_add(replace_cfg)] | ||
await check_token_ring_and_group0_consistency(manager) | ||
|
||
logger.info(f"Stopping node {servers[0]}") | ||
await manager.server_stop_gracefully(servers[0].server_id) | ||
|
||
logger.info(f"Removing node {servers[0]} using {servers[1]}") | ||
await manager.remove_node(servers[1].server_id, servers[0].server_id) | ||
await check_token_ring_and_group0_consistency(manager) | ||
|
||
logger.info(f"Decommissioning node {servers[1]}") | ||
await manager.decommission_node(servers[1].server_id) | ||
await check_token_ring_and_group0_consistency(manager) |