Skip to content

Commit

Permalink
cluster: Fix for rm_stm holding up stm at startup
Browse files Browse the repository at this point in the history
- This stm has a conditional in its last_stable_offset() method that
returns an invalid offset in the case it hasn't completed bootstrapping.

- The issue is that this bootstrap phase isn't considered finished after
bootstrapping from apply_snapshot(). This would cause other stms to
pause thinking the rm_stm had work to do at an offset at 0, causing
that other stm to timeout and fail processing of said event.

- Solution is simple, to set `_boostrap_committed_offset`within the
`apply_snapshot()` method

- Fixes: redpanda-data#11131

- Fixes: redpanda-data#11130
  • Loading branch information
Rob Blafford committed Jun 20, 2023
1 parent 900f943 commit 5549f5b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/v/cluster/rm_stm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2761,6 +2761,7 @@ rm_stm::apply_snapshot(stm_snapshot_header hdr, iobuf&& tx_ss_buf) {
_log_state.lru_idempotent_pids.push_back(it->second);
}

_bootstrap_committed_offset = data.offset;
_last_snapshot_offset = data.offset;
_insync_offset = data.offset;
}
Expand Down

0 comments on commit 5549f5b

Please sign in to comment.