-
Notifications
You must be signed in to change notification settings - Fork 599
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
Always use the latest configuration for followers metadata #19964
Always use the latest configuration for followers metadata #19964
Conversation
Removed comment mentioning that we should add applying snapshot to stm as this is already being done Signed-off-by: Michał Maślanka <michal@redpanda.com>
When install snapshot request in processed by the follower it may not always replace the follower log content. If the snapshot last included offset is smaller than the follower dirty offset the follower should prefix truncate all the data up to the snapshot last included offset but keep all the entries which offset is greater than snapshot last included offset. Fixed the update of follower metadata state as it was always using the snapshot configuration instead the latest from the configuration manager. Fixes: #core-internal/issues/1310 Signed-off-by: Michał Maślanka <michal@redpanda.com>
When install snapshot request is received by the current leader it must unconditionally step down. This is the same behavior as in the case of receiving an append entries request. Signed-off-by: Michał Maślanka <michal@redpanda.com>
ad11e77
to
4d47efa
Compare
When install snapshot request is delayed and deliver to the node after it already made progress it can not lead to state inconsistencies. Added test validating handing of delayed `install_snapshot` requests. The test is validating behavior of both follower and the leader. Signed-off-by: Michał Maślanka <michal@redpanda.com>
@@ -2247,6 +2247,7 @@ ss::future<> consensus::hydrate_snapshot() { | |||
co_await truncate_to_latest_snapshot(truncate_cfg.value()); | |||
} | |||
_snapshot_size = co_await _snapshot_mgr.get_snapshot_size(); | |||
update_follower_stats(_configuration_manager.get_latest()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering if we should even hydrate a snapshot if the included_index < start offset, just return success and make it idempotent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked at this again, I think the fix makes sense but I think the issue though is L2241 already updates follower stats from snapshot config, so we are effectively doing it twice? Perhaps we should just swap L2242 & L2241 and make update_offset_from_snapshot() use latest config?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i've removed the stats update from update_offset_from_snapshot
. I am not sure if the stats should be updated from within that method as its name suggest updating offsets.
4d47efa
to
e73aa28
Compare
/ci-repeat 1 |
/backport v24.1.x |
/backport v23.3.x |
Failed to create a backport PR to v23.3.x branch. I tried:
|
When install snapshot request in processed by the follower it may not
always replace the follower log content. If the snapshot last included
offset is smaller than the follower dirty offset the follower should
prefix truncate all the data up to the snapshot last included offset but
keep all the entries which offset is greater than snapshot last included
offset.
Fixed the update of follower metadata state as it was always using the
snapshot configuration instead the latest from the configuration
manager.
Fixes: https://github.com/redpanda-data/core-internal/issues/1310
Backports Required
Release Notes
Bug Fixes