-
Notifications
You must be signed in to change notification settings - Fork 593
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
Use remote recovery when topic is configured to use remote data #22908
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7611c78
tests/redpanda: tolerate some nodes not being alive when scrubbing
mmaslankaprv eea417a
c/backend: fixed small typo in log message
mmaslankaprv 313358a
c/partition_manager: added log describing created partition
mmaslankaprv eb4c6ce
c/backend: use recovery when topic configure to use remote data
mmaslankaprv de93ab9
tests: modified remote recovery test to test recovery from cloud storage
mmaslankaprv 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
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 |
---|---|---|
|
@@ -3403,20 +3403,17 @@ def set_cluster_config_to_null(self, | |
name: str, | ||
bashtanov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
expect_restart: bool = False, | ||
admin_client: Optional[Admin] = None, | ||
timeout: int = 10): | ||
if admin_client is None: | ||
admin_client = self._admin | ||
|
||
patch_result = admin_client.patch_cluster_config(upsert={name: None}) | ||
new_version = patch_result['config_version'] | ||
|
||
self._wait_for_config_version(new_version, expect_restart, timeout) | ||
timeout: int = 10, | ||
tolerate_stopped_nodes=False): | ||
def set_cluster_config_to_null(self, *args, **kwargs): | ||
self.set_cluster_config(*args, values={name: None}, *kwargs) | ||
|
||
def set_cluster_config(self, | ||
values: dict, | ||
expect_restart: bool = False, | ||
admin_client: Optional[Admin] = None, | ||
timeout: int = 10): | ||
timeout: int = 10, | ||
tolerate_stopped_nodes=False): | ||
""" | ||
Update cluster configuration and wait for all nodes to report that they | ||
have seen the new config. | ||
|
@@ -3432,23 +3429,30 @@ def set_cluster_config(self, | |
remove=[]) | ||
new_version = patch_result['config_version'] | ||
|
||
self._wait_for_config_version(new_version, | ||
expect_restart, | ||
timeout, | ||
admin_client=admin_client) | ||
self._wait_for_config_version( | ||
new_version, | ||
expect_restart, | ||
timeout, | ||
admin_client=admin_client, | ||
tolerate_stopped_nodes=tolerate_stopped_nodes) | ||
|
||
def _wait_for_config_version(self, | ||
config_version, | ||
expect_restart: bool, | ||
timeout: int, | ||
admin_client: Optional[Admin] = None): | ||
admin_client: Optional[Admin] = None, | ||
tolerate_stopped_nodes=False): | ||
admin_client = admin_client or self._admin | ||
if tolerate_stopped_nodes: | ||
started_node_ids = {self.node_id(n) for n in self.started_nodes()} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TBH I find having a variable declared/undeclared depending on the condition somewhat error-prone and harder to read too. What do you think of something like the following?
|
||
|
||
def is_ready(): | ||
status = admin_client.get_cluster_config_status( | ||
node=self.controller()) | ||
ready = all( | ||
[n['config_version'] >= config_version for n in status]) | ||
ready = all([ | ||
n['config_version'] >= config_version for n in status if | ||
not tolerate_stopped_nodes or n['node_id'] in started_node_ids | ||
]) | ||
|
||
return ready, status | ||
|
||
|
@@ -5020,27 +5024,21 @@ def wait_for_internal_scrub(self, cloud_storage_partitions): | |
if not cloud_storage_partitions: | ||
return None | ||
|
||
self.set_cluster_config({ | ||
"cloud_storage_enable_scrubbing": | ||
True, | ||
"cloud_storage_partial_scrub_interval_ms": | ||
100, | ||
"cloud_storage_full_scrub_interval_ms": | ||
1000 * 60 * 10, | ||
"cloud_storage_scrubbing_interval_jitter_ms": | ||
100, | ||
"cloud_storage_background_jobs_quota": | ||
5000, | ||
"cloud_storage_housekeeping_interval_ms": | ||
100, | ||
# Segment merging may resolve gaps in the log, so disable it | ||
"cloud_storage_enable_segment_merging": | ||
False, | ||
# Leadership moves may perturb the scrub, so disable it to | ||
# streamline the actions below. | ||
"enable_leader_balancer": | ||
False | ||
}) | ||
self.set_cluster_config( | ||
{ | ||
"cloud_storage_enable_scrubbing": True, | ||
"cloud_storage_partial_scrub_interval_ms": 100, | ||
"cloud_storage_full_scrub_interval_ms": 1000 * 60 * 10, | ||
"cloud_storage_scrubbing_interval_jitter_ms": 100, | ||
"cloud_storage_background_jobs_quota": 5000, | ||
"cloud_storage_housekeeping_interval_ms": 100, | ||
# Segment merging may resolve gaps in the log, so disable it | ||
"cloud_storage_enable_segment_merging": False, | ||
# Leadership moves may perturb the scrub, so disable it to | ||
# streamline the actions below. | ||
"enable_leader_balancer": False | ||
}, | ||
tolerate_stopped_nodes=True) | ||
|
||
unavailable = set() | ||
for p in cloud_storage_partitions: | ||
|
Oops, something went wrong.
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.
I'm not too familiar with initial_version perhaps @ztlpn can take another look.