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

[v21.11.x] cloud_storage: check that we have serialized the whole manifest #6510

Merged
merged 1 commit into from
Sep 22, 2022

Conversation

ztlpn
Copy link
Contributor

@ztlpn ztlpn commented Sep 22, 2022

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

Conflicts:
	src/v/cloud_storage/partition_manifest.cc
	src/v/cloud_storage/topic_manifest.cc
	src/v/cloud_storage/tx_range_manifest.cc
@ztlpn ztlpn added the kind/backport PRs targeting a stable branch label Sep 22, 2022
@ztlpn ztlpn added this to the v21.11.x-next milestone Sep 22, 2022
@ztlpn ztlpn requested a review from Lazin as a code owner September 22, 2022 18:13
@ztlpn ztlpn merged commit 60f08ab into redpanda-data:v21.11.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
@ztlpn ztlpn deleted the v21.11.x-bp branch November 27, 2023 13:23
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