Add ensureCustomSerialization to ensure that headers are serialized correctly with multiple transport hops #29
+150
−20
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes multiple issue:
When upgrading from 2.11/2.12/2.13 to >= 2.14, there can be an issue when deserializing threadContext headers on the receiving node due to the transmitting node re-using the serialization format from a previous transport hop.
This was particular seen in scenarios where there are a chain of transport hops, such as 2.14 (Coordinator node) -> 2.14 node -> 2.12 node
These scenarios can happen on ingestion during rolling upgrades where a replica shard may temporarily be on an older node than a primary shard.
This PR adds logic in the SecurityInterceptor to re-serialize the headers if they have previously been populated from a prior transport hop for backwards compatibility.
This PR also removes logic ensureJdkSerialization.
Bug fix
Issues Resolved
Testing
Creating this PR in Draft until testing details are added.
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.