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

[v24.3.x] r/utils: fixed setting log start delta in snapshot #24628

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/v/raft/consensus_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,8 @@ ss::future<> create_raft_state_for_pre_existing_partition(
model::offset min_rp_offset,
model::offset max_rp_offset,
model::term_id last_included_term,
std::vector<model::broker> initial_nodes) {
std::vector<model::broker> initial_nodes,
model::offset_delta log_start_delta) {
// Prepare Raft state in kvstore
vlog(
raftlog.debug,
Expand All @@ -403,7 +404,7 @@ ss::future<> create_raft_state_for_pre_existing_partition(
.version = raft::snapshot_metadata::current_version,
.latest_configuration = std::move(group_config),
.cluster_time = ss::lowres_clock::now(),
.log_start_delta = raft::offset_translator_delta{0},
.log_start_delta = offset_translator_delta{log_start_delta},
};

vlog(
Expand Down Expand Up @@ -458,7 +459,8 @@ ss::future<> bootstrap_pre_existing_partition(
min_rp_offset,
max_rp_offset,
last_included_term,
initial_nodes);
initial_nodes,
model::offset_delta{ot_state->delta(min_rp_offset)});
}

} // namespace raft::details
Loading