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 of fix: consume ignored entries in CE downgrade via Ent snapshot into release/1.18.x #20978

Conversation

hc-github-team-consul-core
Copy link
Collaborator

Backport

This PR is auto-generated from #20977 to be assessed for backporting due to the inclusion of the label backport/1.18.

The below text is copied from the body of the original PR.


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

Overview of commits

Copy link
Collaborator

Choose a reason for hiding this comment

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

Auto approved Consul Bot automated PR

@vercel vercel bot temporarily deployed to Preview – consul April 11, 2024 21:15 Inactive
@zalimeni zalimeni merged commit 003d753 into release/1.18.x Apr 12, 2024
81 of 82 checks passed
@zalimeni zalimeni deleted the backport/zalimeni/ce-downgrade-ent-snap-restore-unsupported/nearly-primary-duckling branch April 12, 2024 13:02
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.

3 participants