From 60cbb700ef2d69646a400511418da3bcbc7ec8bc Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Thu, 13 May 2021 11:58:31 +0300 Subject: [PATCH] repair: Move unused db captures Similarly to previous patch -- the db captures can also be relaxed in some places. Signed-off-by: Pavel Emelyanov --- repair/repair.cc | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/repair/repair.cc b/repair/repair.cc index cd7b9c8356..e61d64a1be 100644 --- a/repair/repair.cc +++ b/repair/repair.cc @@ -1389,10 +1389,9 @@ future<> repair_service::do_sync_data_using_repair( } future<> repair_service::bootstrap_with_repair(locator::token_metadata_ptr tmptr, std::unordered_set bootstrap_tokens) { - seastar::sharded& db = get_db(); - using inet_address = gms::inet_address; - return seastar::async([this, &db, tmptr = std::move(tmptr), tokens = std::move(bootstrap_tokens)] () mutable { + return seastar::async([this, tmptr = std::move(tmptr), tokens = std::move(bootstrap_tokens)] () mutable { + seastar::sharded& db = get_db(); auto keyspaces = db.local().get_non_system_keyspaces(); auto myip = utils::fb_utilities::get_broadcast_address(); auto reason = streaming::stream_reason::bootstrap; @@ -1562,10 +1561,9 @@ future<> repair_service::bootstrap_with_repair(locator::token_metadata_ptr tmptr } future<> repair_service::do_decommission_removenode_with_repair(locator::token_metadata_ptr tmptr, gms::inet_address leaving_node, shared_ptr ops) { - seastar::sharded& db = get_db(); - using inet_address = gms::inet_address; - return seastar::async([this, &db, tmptr = std::move(tmptr), leaving_node = std::move(leaving_node), ops] () mutable { + return seastar::async([this, tmptr = std::move(tmptr), leaving_node = std::move(leaving_node), ops] () mutable { + seastar::sharded& db = get_db(); auto myip = utils::fb_utilities::get_broadcast_address(); auto keyspaces = db.local().get_non_system_keyspaces(); bool is_removenode = myip != leaving_node; @@ -1780,9 +1778,8 @@ future<> abort_repair_node_ops(utils::UUID ops_uuid) { } future<> repair_service::do_rebuild_replace_with_repair(locator::token_metadata_ptr tmptr, sstring op, sstring source_dc, streaming::stream_reason reason) { - seastar::sharded& db = get_db(); - - return seastar::async([this, &db, tmptr = std::move(tmptr), source_dc = std::move(source_dc), op = std::move(op), reason] () mutable { + return seastar::async([this, tmptr = std::move(tmptr), source_dc = std::move(source_dc), op = std::move(op), reason] () mutable { + seastar::sharded& db = get_db(); auto keyspaces = db.local().get_non_system_keyspaces(); auto myip = utils::fb_utilities::get_broadcast_address(); size_t nr_ranges_total = 0;