Skip to content

Commit 45a2d8f

Browse files
committed
replicaset: drop unused worker:remove_service() function
The function was used incorrectly in the router and did nothing, since the newly created replicasets cannot have the service, which has not been added there, and consequently, there's nothing to drop. The commit also drops the `remove_service` function, because we don't have use case, where the service should be removed from the replicaset. NO_DOC=refactoring NO_TEST=refactoring
1 parent eb1fca1 commit 45a2d8f

File tree

3 files changed

+1
-12
lines changed

3 files changed

+1
-12
lines changed

test/replicaset-luatest/replicaset_3_test.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ test_group.test_worker_service_info = function()
837837
end
838838

839839
-- Check info of replicas only.
840-
rs.worker:remove_service(rs_service_name)
840+
rs.worker.services[rs_service_name] = nil
841841
info = rs:service_info(service_name)
842842
t.assert_equals(info.name, nil)
843843
t.assert_not_equals(info.replicas, nil)

vshard/replicaset.lua

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2160,16 +2160,10 @@ local function worker_wakeup_service(worker, service_name)
21602160
pcall(worker.fiber.wakeup, worker.fiber)
21612161
end
21622162

2163-
local function worker_remove_service(worker, service_name)
2164-
-- On the next iteration of worker service won't run.
2165-
worker.services[service_name] = nil
2166-
end
2167-
21682163
local worker_mt = {
21692164
__index = {
21702165
add_service = worker_add_service,
21712166
wakeup_service = worker_wakeup_service,
2172-
remove_service = worker_remove_service,
21732167
}
21742168
}
21752169

vshard/router/init.lua

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,12 +1214,7 @@ local function master_search_set(router)
12141214
end
12151215
end
12161216
else
1217-
-- Do not make users pay for what they do not use - when the search is
1218-
-- disabled for all replicasets, there should not be any fiber.
12191217
log.info('Master auto search is disabled')
1220-
for _, replicaset in pairs(router.replicasets) do
1221-
replicaset.worker:remove_service(service_name)
1222-
end
12231218
end
12241219
end
12251220

0 commit comments

Comments
 (0)