-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(new_dc): Add new node with zero node dc
Test checks that in multidc symetric configuration: DC1: 3, DC2: 3, we lost raft quorum if all nodes in any dc will die (stopped, killed, etc) and with adding new DC with zero node only allow to save raft quroum and restore failed dc with topology operations
- Loading branch information
1 parent
72a67ce
commit a8d2eae
Showing
8 changed files
with
275 additions
and
14 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
13 changes: 13 additions & 0 deletions
13
jenkins-pipelines/oss/features/features-add-new-dc-with-zero-nodes.jenkinsfile
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,13 @@ | ||
#!groovy | ||
|
||
// trick from https://github.com/jenkinsci/workflow-cps-global-lib-plugin/pull/43 | ||
def lib = library identifier: 'sct@snapshot', retriever: legacySCM(scm) | ||
|
||
longevityPipeline( | ||
backend: 'aws', | ||
region: '''["eu-west-1", "eu-west-2", "eu-north-1"]''', | ||
test_name: 'add_new_dc_test.TestAddNewDc.test_add_new_dc_with_zero_nodes', | ||
test_config: 'test-cases/features/add-new-dc-with-zero-nodes.yaml', | ||
|
||
timeout: [time: 120, unit: 'MINUTES'] | ||
) |
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,26 @@ | ||
# 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) 2024 ScyllaDB | ||
from sdcm.rest.remote_curl_client import RemoteCurlClient | ||
|
||
|
||
class RaftApi(RemoteCurlClient): | ||
"""Raft api commands""" | ||
|
||
def __init__(self, node: "BaseNode"): # noqa: F821 | ||
super().__init__(host="localhost:10000", endpoint="raft", node=node) | ||
|
||
def read_barrier(self, group_id: str, timeout: int = 60) -> str: | ||
path = f"read_barrier?group_id={group_id}&timeout={timeout}" | ||
return self.run_remoter_curl(method="POST", | ||
path=path, | ||
params={}, timeout=timeout + 30).stdout.strip() |
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
16 changes: 16 additions & 0 deletions
16
test-cases/features/add-new-dc-with-zero-node-in-multidc.yaml
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,16 @@ | ||
prepare_write_cmd: "cassandra-stress write cl=QUORUM n=20900 -schema 'replication(strategy=NetworkTopologyStrategy,replication_factor=3) compaction(strategy=SizeTieredCompactionStrategy)' -mode cql3 native -rate threads=8 -pop seq=1..20900 -col 'n=FIXED(10) size=FIXED(512)' -log interval=5" | ||
|
||
stress_cmd: ["cassandra-stress read cl=LOCAL_QUORUM duration=20m -mode cql3 native -rate threads=8 -pop seq=1..20900 -col 'n=FIXED(10) size=FIXED(512)' -log interval=5", | ||
"cassandra-stress write cl=LOCAL_QUORUM duration=20m -mode cql3 native -rate threads=8 -pop seq=1..20900 -col 'n=FIXED(10) size=FIXED(512)' -log interval=5" | ||
] | ||
verify_data_after_entire_test: "cassandra-stress read cl=LOCAL_ONE n=20900 -mode cql3 native -rate threads=8 -pop seq=1..20900 -col 'n=FIXED(10) size=FIXED(512)' -log interval=5" | ||
|
||
n_db_nodes: '3 3 0' # make n_db_nodes configured as multi-dc with last dc set to 0 (so later easily new node can be added) | ||
region_name: 'eu-west-1 eu-west-2 eu-north-1' | ||
n_loaders: 1 | ||
n_monitor_nodes: 1 | ||
|
||
instance_type_db: 'i4i.xlarge' | ||
seeds_num: 3 | ||
|
||
user_prefix: 'add-new-dc' |
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,20 @@ | ||
prepare_write_cmd: "cassandra-stress write cl=QUORUM n=20900 -schema 'replication(strategy=NetworkTopologyStrategy,replication_factor=3) compaction(strategy=SizeTieredCompactionStrategy)' -mode cql3 native -rate threads=8 -pop seq=1..20900 -col 'n=FIXED(10) size=FIXED(512)' -log interval=5" | ||
|
||
stress_cmd: ["cassandra-stress read cl=LOCAL_QUORUM duration=20m -mode cql3 native -rate threads=8 -pop seq=1..20900 -col 'n=FIXED(10) size=FIXED(512)' -log interval=5", | ||
"cassandra-stress write cl=LOCAL_QUORUM duration=20m -mode cql3 native -rate threads=8 -pop seq=1..20900 -col 'n=FIXED(10) size=FIXED(512)' -log interval=5" | ||
] | ||
verify_data_after_entire_test: "cassandra-stress read cl=LOCAL_QUORUM n=20900 -mode cql3 native -rate threads=8 -pop seq=1..20900 -col 'n=FIXED(10) size=FIXED(512)' -log interval=5" | ||
|
||
n_db_nodes: '3 3 0' # make n_db_nodes configured as multi-dc with last dc set to 0 (so later easily new node can be added) | ||
region_name: 'eu-west-1 eu-west-2 eu-north-1' | ||
n_loaders: 1 | ||
n_monitor_nodes: 1 | ||
|
||
instance_type_db: 'i4i.xlarge' | ||
seeds_num: 3 | ||
|
||
user_prefix: 'add-new-dc' | ||
|
||
n_db_zero_token_nodes: '0 0 0' | ||
zero_token_instance_type_db: 'i4i.large' | ||
use_zero_nodes: true |