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

fix: consume ignored entries in CE downgrade via Ent snapshot #20977

Merged
merged 1 commit into from
Apr 11, 2024

Conversation

zalimeni
Copy link
Member

Description

This operation would previously fail due to unconsumed bytes in the decoder buffer when reading the Ent snapshot (the first byte of the record would be misinterpreted as a type indicator, and the remaining bytes would fail to be deserialized or read as invalid data).

Ensure restore succeeds by decoding the ignored record as an interface{}, which will consume the record bytes without requiring a concrete target struct, then moving on to the next record.

Opened in response to a bug report by @sayap (thank you)

Testing & Reproduction steps

  • Added new test to verify Ent->CE restore works as intended

PR Checklist

  • updated test coverage
  • external facing docs updated
  • appropriate backport labels added
  • not a security concern

@zalimeni zalimeni requested a review from mkeeler April 11, 2024 20:30
@zalimeni zalimeni requested a review from a team as a code owner April 11, 2024 20:30
This operation would previously fail due to unconsumed bytes in the
decoder buffer when reading the Ent snapshot (the first byte of the
record would be misinterpreted as a type indicator, and the remaining
bytes would fail to be deserialized or read as invalid data).

Ensure restore succeeds by decoding the ignored record as an
interface{}, which will consume the record bytes without requiring a
concrete target struct, then moving on to the next record.
@zalimeni zalimeni force-pushed the zalimeni/ce-downgrade-ent-snap-restore-unsupported branch from 7947aa3 to 24f226e Compare April 11, 2024 20:50
@zalimeni zalimeni enabled auto-merge (squash) April 11, 2024 20:50
@zalimeni
Copy link
Member Author

Added changelog and manually squashed, no changes

@zalimeni zalimeni merged commit a8d08e7 into main Apr 11, 2024
85 checks passed
@zalimeni zalimeni deleted the zalimeni/ce-downgrade-ent-snap-restore-unsupported branch April 11, 2024 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants