Skip to content

Commit

Permalink
Assert and log total_home
Browse files Browse the repository at this point in the history
I have a theory total_home (only set on shard0's service) could be ran
using a service from another shard, but on shard0. We should add
assertions and logs for what total_allowance is because that's what the
stacktrace reported as crashing.
  • Loading branch information
rockwotj committed May 11, 2023
1 parent 8644a82 commit 6baa484
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/v/net/conn_quota.cc
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,12 @@ conn_quota::get_home_allowance(ss::net::inet_address addr) {
assert_on_home(addr);

if (addr == ss::net::inet_address{}) {
#ifndef NDEBUG
vassert(
total_home,
"Wrong shard [{}]- total home is unset",
ss::this_shard_id());
#endif
return total_home;
} else {
auto found = ip_home.find(addr);
Expand Down Expand Up @@ -458,8 +464,11 @@ void conn_quota::do_put(ss::net::inet_address addr) {

auto home_shard = addr_to_shard(addr);
if (home_shard == ss::this_shard_id()) {
vlog(rpc::rpclog.trace, "do_put: release directly to home");
auto allowance = get_home_allowance(addr);
vlog(
rpc::rpclog.trace,
"do_put: release directly to home allowance={}",
allowance);
allowance->put();
if (should_leave_reclaim(*allowance)) {
cancel_reclaim_to(addr, allowance);
Expand Down

0 comments on commit 6baa484

Please sign in to comment.