Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tx/group compaction fixes #24637

Open
wants to merge 12 commits into
base: dev
Choose a base branch
from
Open
24 changes: 21 additions & 3 deletions src/v/kafka/server/group_tx_tracker_stm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,30 @@ ss::future<> group_tx_tracker_stm::do_apply(const model::record_batch& b) {

model::offset group_tx_tracker_stm::max_collectible_offset() {
auto result = last_applied_offset();
for (const auto& [_, group_state] : _all_txs) {
for (const auto& [gid, group_state] : _all_txs) {
if (!group_state.begin_offsets.empty()) {
result = std::min(
result, model::prev_offset(*group_state.begin_offsets.begin()));
auto group_least_begin = *group_state.begin_offsets.begin();
result = std::min(result, model::prev_offset(group_least_begin));
vlog(
klog.trace,
"[{}] group: {}, earliest tx begin offset: {}",
_raft->ntp(),
gid,
group_least_begin);
if (klog.is_enabled(ss::log_level::trace)) {
for (auto& [pid, offset] : group_state.producer_to_begin) {
vlog(
klog.trace,
"[{}] group: {}, producer: {}, begin: {}",
_raft->ntp(),
Comment on lines +69 to +70
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can we add more context to this log line ? i.e. it is not known what the begin is

gid,
pid,
offset);
}
}
}
}

return result;
}

Expand Down