Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rystsov committed Jul 28, 2023
1 parent a60b2b6 commit d40bdda
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 7 additions & 1 deletion src/v/cluster/tm_stm_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ void tm_stm_cache::clear_log() {
vlog(txlog.trace, "clearing log");

for (const auto& entry : _log_txes) {
unlink_lru_tx(entry.second.tx);
unlink_lru_tx(entry.second);
}
_log_txes.clear();
vassert(
Expand Down Expand Up @@ -299,4 +299,10 @@ std::optional<tm_transaction> tm_stm_cache::oldest_log_transaction() {

size_t tm_stm_cache::tx_cache_size() { return lru_txes.size(); }

void tm_stm_cache::unlink_lru_tx(const tx_wrapper& entry) {
if (entry._hook.is_linked()) {
lru_txes.erase(lru_txes.iterator_to(entry));
}
}

} // namespace cluster
6 changes: 1 addition & 5 deletions src/v/cluster/tm_stm_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,7 @@ class tm_stm_cache {
// dentally update records in the past after the re-election
std::optional<model::term_id> _sealed_term;

void unlink_lru_tx(const tx_wrapper& entry) {
if (entry._hook.is_linked()) {
lru_txes.erase(lru_txes.iterator_to(entry));
}
}
void unlink_lru_tx(const tx_wrapper&);
};

// Updates in v1.
Expand Down

0 comments on commit d40bdda

Please sign in to comment.