-
Notifications
You must be signed in to change notification settings - Fork 577
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
tests: add mixed-version test for sending Raft snapshot RPCs #5488
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Copyright 2022 Redpanda Data, Inc. | ||
# | ||
# Use of this software is governed by the Business Source License | ||
# included in the file licenses/BSL.md | ||
# | ||
# As of the Change Date specified in that file, in accordance with | ||
# the Business Source License, use of this software will be governed | ||
# by the Apache License, Version 2.0 | ||
|
||
from rptest.services.redpanda import RedpandaService, RESTART_LOG_ALLOW_LIST | ||
from rptest.services.redpanda_installer import RedpandaInstaller | ||
|
||
|
||
class MixedVersionWorkloadRunner(): | ||
ALLOWED_LOGS = RESTART_LOG_ALLOW_LIST | ||
|
||
# For testing RPC compatibility, pick a version that doesn't have serde | ||
# enabled. | ||
PRE_SERDE_VERSION = (22, 1, 4) | ||
|
||
@staticmethod | ||
def upgrade_with_workload(redpanda: RedpandaService, initial_version, | ||
workload_fn): | ||
""" | ||
Runs through an upgrade while running the given workload during the | ||
intermediate mixed-cluster stages. | ||
|
||
It's expected that before starting, the version from which Redpanda is | ||
being upgraded has already been installed and deployed (nodes started | ||
with new bits) on the service. | ||
|
||
'workload_fn' is a function that takes two nodes and deterministically | ||
performs work between nodes, for instance, by having RPCs go from one | ||
node to the other. | ||
""" | ||
num_nodes = len(redpanda.nodes) | ||
assert num_nodes >= 2, f"Expected at least two nodes, got {num_nodes}" | ||
installer: RedpandaInstaller = redpanda._installer | ||
nodes = redpanda.nodes | ||
node0 = nodes[0] | ||
node1 = nodes[1] | ||
andrwng marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# Upgrade one node and send RPCs in both directions. | ||
installer.install([node0], RedpandaInstaller.HEAD) | ||
redpanda.restart_nodes([node0]) | ||
workload_fn(node0, node1) | ||
workload_fn(node1, node0) | ||
|
||
# Continue on with the upgrade. The versions are identical at this | ||
# point so just run the workload in one direction. | ||
installer.install([node1], RedpandaInstaller.HEAD) | ||
redpanda.restart_nodes([node1]) | ||
workload_fn(node0, node1) | ||
|
||
# Partial roll back and make sure we can still run the workload. | ||
installer.install([node1], initial_version) | ||
redpanda.restart_nodes([node1]) | ||
workload_fn(node0, node1) | ||
workload_fn(node1, node0) | ||
|
||
# Complete the upgrade. The versions are identical again so just run | ||
# through the workload in one direction. | ||
installer.install(nodes, RedpandaInstaller.HEAD) | ||
redpanda.restart_nodes(nodes) | ||
workload_fn(node0, node1) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice