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

Backport #3365 to 21.11.x #3434

Merged
merged 3 commits into from
Jan 11, 2022
Merged

Conversation

ztlpn
Copy link
Contributor

@ztlpn ztlpn commented Jan 11, 2022

Backports:

Cover letter

Fixes #3272

To ensure that segments in the cloud storage are not overwritten by concurrent archivers running on different nodes, we append archiver term id as a suffix for segment paths. As raft guarantees that in each term there will be only one leader, this ensures segment path uniqueness.

Release notes

Bug fixes

  • Fixed data loss in shadow indexing archived data that could occur after quick partition leadership transfer back and forth between two nodes. Compatibility note: previous redpanda versions won't be able to read shadow indexing data archived by newer versions.

Previously segment paths were used in the manifest for the case when
segments come from a different ntp revision than the current one
(these segments could appear in the manifest for example after
recovery). This lead to a lot of code that had to handle both cases for
manifest keys (short names and full paths) and parsed these paths and
assembled them back. By storing ntp revision id in segment_meta instead,
we can eliminate all this code. Segment paths become opaque, as we don't
have to parse them anywhere - we only generate them when we need to talk
to cloud storage and that's it.

(cherry picked from commit 7ddc0ff)
See redpanda-data#3272. To ensure that
segments in the cloud storage are not overwritten by concurrent archivers
running on different nodes, we append archiver term id as a suffix for
segment paths. As raft guarantees that in each term there will be only
one leader, this ensures segment path uniqueness.

(cherry picked from commit 88a9935)
@ztlpn
Copy link
Contributor Author

ztlpn commented Jan 11, 2022

test failure looks like an instance of #3277

@ztlpn ztlpn merged commit 07e6c27 into redpanda-data:v21.11.x Jan 11, 2022
@ztlpn ztlpn deleted the 21.11-backport-3365 branch November 27, 2023 13:15
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.

None yet

2 participants