Skip to content

[v23.2.x] cluster/tests: add test case for eviction of the tx coordinator#17530

Open
andrwng wants to merge 1 commit intoredpanda-data:v23.2.xfrom
andrwng:v23.2.x-tx-stm-eviction
Open

[v23.2.x] cluster/tests: add test case for eviction of the tx coordinator#17530
andrwng wants to merge 1 commit intoredpanda-data:v23.2.xfrom
andrwng:v23.2.x-tx-stm-eviction

Conversation

@andrwng
Copy link
Copy Markdown
Contributor

@andrwng andrwng commented Apr 1, 2024

Backport of #17379
Fixes #17393

CONFLICT:

  • different CMakeLists surroundings

We've seen in older versions of Redpanda that despite the 'delete' cleanup policy being enabled, eviction may not be triggered. This is because in older versions of Redpanda[1], we would not register the eviction STM for tx coordinator partitions.

[1]

if (is_tx_manager_topic(_raft->ntp()) && _is_tx_enabled) {
_tm_stm = builder.create_stm<cluster::tm_stm>(
clusterlog,
_raft.get(),
_feature_table,
_tm_stm_cache_manager.local().get(_raft->ntp().tp.partition));
_raft->log()->stm_manager()->add_stm(_tm_stm);
co_return co_await _raft->start(std::move(builder));
}
if (is_transform_offsets_topic(_raft->ntp())) {
vassert(
topic_cfg.has_value(),
"No topic configuration passed, stm requires configuration for "
"partition count.");
_transform_offsets_stm = builder.create_stm<transform_offsets_stm_t>(
topic_cfg->partition_count, clusterlog, _raft.get());
}
/**
* Data partitions
*/
if (!storage::deletion_exempt(_raft->ntp())) {
_log_eviction_stm = builder.create_stm<cluster::log_eviction_stm>(
_raft.get(), clusterlog, _kvstore);
_raft->log()->stm_manager()->add_stm(_log_eviction_stm);
}

(cherry picked from commit 761dfe9) (cherry picked from commit c45abbd)

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v23.3.x
  • v23.2.x

Release Notes

  • none

@andrwng andrwng changed the title cluster/tests: add test case for eviction of the tx coordinator [v23.2.x] cluster/tests: add test case for eviction of the tx coordinator Apr 1, 2024
@piyushredpanda
Copy link
Copy Markdown
Contributor

/ci-repeat 1

CONFLICT:
- different CMakeLists surroundings
- swapped out RPTEST macros for boost_require_eventually

We've seen in older versions of Redpanda that despite the 'delete'
cleanup policy being enabled, eviction may not be triggered. This is
because in older versions of Redpanda[1], we would not register the
eviction STM for tx coordinator partitions.

[1] https://github.com/redpanda-data/redpanda/blob/3ce012f9ccb64810eafcc4b8b2e0df7340172879/src/v/cluster/partition.cc#L446-L471

(cherry picked from commit 761dfe9)
(cherry picked from commit c45abbd)
@andrwng andrwng force-pushed the v23.2.x-tx-stm-eviction branch from d1d1680 to 242cb6d Compare April 27, 2024 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants