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

[v22.2.x] cloud_storage: check that we have serialized the whole manifest #6511

Merged

Conversation

vbotbuildovich
Copy link
Collaborator

Backport from pull request: #6507.

It turns out that if the underlying buffer object throws (e.g. a
bad_alloc exception), std::ostream swallows the exception and sets the
"badbit". If we don't check it, this can lead to the serialized manifest
being truncated and to corrupt manifests being uploaded to the cloud
storage. To prevent that we check that std::ostream is in a good state
after serializing manifests.

More info: https://en.cppreference.com/w/cpp/io/ios_base/iostate

(cherry picked from commit dbfc325)
@vbotbuildovich vbotbuildovich added this to the v22.2.x-next milestone Sep 22, 2022
@vbotbuildovich vbotbuildovich added the kind/backport PRs targeting a stable branch label Sep 22, 2022
Copy link
Contributor

@ztlpn ztlpn left a comment

Choose a reason for hiding this comment

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

clean backport

@ztlpn ztlpn marked this pull request as ready for review September 22, 2022 19:59
@ztlpn ztlpn merged commit 7e10534 into redpanda-data:v22.2.x Sep 22, 2022
@mmedenjak mmedenjak added kind/bug Something isn't working area/cloud-storage Shadow indexing subsystem and removed area/redpanda labels Sep 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cloud-storage Shadow indexing subsystem kind/backport PRs targeting a stable branch kind/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants