[TE][EndpointStore]: Fix hand_ assignment after evict (#768)

Signed-off-by: Zheming Li <lizheming@msh.team>
Co-authored-by: Zheming Li <lizheming@msh.team>
This commit is contained in:
Zheming Li 2025-08-25 10:27:24 +08:00 committed by GitHub
parent 9acf12080f
commit 494fe8a43a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions

View File

@ -84,7 +84,7 @@ void FIFOEndpointStore::evictEndpoint() {
std::string victim = fifo_list_.front();
fifo_list_.pop_front();
fifo_map_.erase(victim);
// LOG(INFO) << victim << " evicted";
LOG(INFO) << victim << " evicted";
waiting_list_.insert(endpoint_map_[victim]);
endpoint_map_.erase(victim);
return;
@ -202,10 +202,10 @@ void SIEVEEndpointStore::evictEndpoint() {
break;
}
}
hand_ = (o == fifo_list_.begin() ? --fifo_list_.end() : std::prev(o));
o == fifo_list_.begin() ? hand_ = std::nullopt : hand_ = std::prev(o);
fifo_list_.erase(o);
fifo_map_.erase(victim);
// LOG(INFO) << victim << " evicted";
LOG(INFO) << victim << " evicted";
auto victim_instance = endpoint_map_[victim].first;
victim_instance->set_active(false);
waiting_list_len_++;
@ -255,4 +255,4 @@ size_t SIEVEEndpointStore::getTotalQPNumber() {
return total_qps;
}
} // namespace mooncake
} // namespace mooncake