-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
repair: release resources of shard_repair_task_impl
Before integration with task manager the state of one shard repair was kept in repair_info. repair_info object was destroyed immediately after shard repair was finished. In an integration process repair_info's fields were moved to shard_repair_task_impl as the two served the similar purposes. Though, shard_repair_task_impl isn't immediately destoyed, but is kept in task manager for task_ttl seconds after it's complete. Thus, some of repair_info's fields have their lifetime prolonged, which makes the repair state change delayed. Release shard_repair_task_impl resources immediately after shard repair is finished. Fixes: #15505.
- Loading branch information
Showing
6 changed files
with
25 additions
and
3 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 |
---|---|---|
|
@@ -951,6 +951,17 @@ struct repair_options { | |
} | ||
}; | ||
|
||
void repair::shard_repair_task_impl::release_resources() noexcept { | ||
erm = {}; | ||
cfs = {}; | ||
data_centers = {}; | ||
hosts = {}; | ||
ignore_nodes = {}; | ||
neighbors = {}; | ||
dropped_tables = {}; | ||
nodes_down = {}; | ||
} | ||
|
||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Deexie
Author
Contributor
|
||
future<> repair::shard_repair_task_impl::do_repair_ranges() { | ||
// Repair tables in the keyspace one after another | ||
assert(table_names().size() == table_ids.size()); | ||
|
@@ -1272,6 +1283,9 @@ future<> repair::user_requested_repair_task_impl::run() { | |
auto task = co_await local_repair._repair_module->make_and_start_task<repair::shard_repair_task_impl>(parent_data, tasks::task_id::create_random_id(), keyspace, | ||
local_repair, germs->get().shared_from_this(), std::move(ranges), std::move(table_ids), | ||
id, std::move(data_centers), std::move(hosts), std::move(ignore_nodes), streaming::stream_reason::repair, hints_batchlog_flushed, ranges_parallelism); | ||
auto release_task_resources = defer([&] () noexcept { | ||
task->release_resources(); | ||
}); | ||
co_await task->done(); | ||
}); | ||
repair_results.push_back(std::move(f)); | ||
|
@@ -1390,6 +1404,9 @@ future<> repair::data_sync_repair_task_impl::run() { | |
id, std::move(data_centers), std::move(hosts), std::move(ignore_nodes), reason, hints_batchlog_flushed, ranges_parallelism); | ||
task_impl_ptr->neighbors = std::move(neighbors); | ||
auto task = co_await local_repair._repair_module->make_task(std::move(task_impl_ptr), parent_data); | ||
auto release_task_resources = defer([&] () noexcept { | ||
task->release_resources(); | ||
}); | ||
task->start(); | ||
co_await task->done(); | ||
}); | ||
|
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
How does the member fields you set to {} have any impacts on the repair state of the repair? @Deexie What repair states are you talking about exactly?