-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add BWC layer for Exceptions #21694
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
Add BWC layer for Exceptions #21694
Conversation
Today it's not possible to add exceptions to the serialization layer without breaking BWC. This commit adds the ability to specify the Version an exception was added that allows to fall back not NotSerializableExceptionWrapper if the expection is not present in the streams version. Relates to elastic#21656
|
@ywelsch can you take a look |
ywelsch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I think the change in Store should be reverted though.
| } catch (FileNotFoundException | NoSuchFileException ex) { | ||
| logger.info("Failed to open / find files while reading metadata snapshot"); | ||
| } catch (ShardLockObtainFailedException ex) { | ||
| logger.info((Supplier<?>) () -> new ParameterizedMessage("{}: failed to obtain shard lock", shardId), ex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a tricky change to make and I want to understand the full consequences first. If I follow the flow of the code correctly, this code is called when a master wants to allocate a replica and checks if there are nodes that have data for the replica. Making this change here means that the fetching for this node will be considered as failed and will trigger a reroute in AsyncShardFetch. The replica might however still be allocated in ReplicaShardAllocator to another node or later allocated on any node in BalancedShardsAllocator. I'm not sure if that's the change we want. Can you leave this code as is for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok sure - I copied this from your commit 👯♂️
|
@ywelsch I rolled back the changes to Store.java |
Today it's not possible to add exceptions to the serialization layer without breaking BWC. This commit adds the ability to specify the Version an exception was added that allows to fall back not NotSerializableExceptionWrapper if the exception is not present in the streams version. Relates to #21656
* master: (42 commits) Add support for merging custom meta data in tribe node (elastic#21552) [DOCS] Show EC2's auto attribute (elastic#21474) Add information about the removal of store throttling to the migration guide. Add a recommendation against large documents to the docs. (elastic#21652) Add indices options tests to search api REST tests (elastic#21701) Fixing indentation in geospatial querying example. (elastic#21682) Fix typo in filters aggregation docs (elastic#21690) Add BWC layer for Exceptions (elastic#21694) Add checkstyle rule to forbid empty javadoc comments (elastic#20881) Docs: Added offline install link for discovery-file plugin remove pointless catch exception in TransportSearchAction (elastic#21689) Rename ClusterState#lookupPrototypeSafe to `lookupPrototype` and remove previous "unsafe" unused variant (elastic#21686) Use a buffer to do character to byte conversion in StreamOutput#writeString (elastic#21680) Fix integer overflows when dealing with templates. (elastic#21628) Fix highlighting on a stored keyword field (elastic#21645) Set execute permissions for native plugin programs (elastic#21657) adjust visibility of DiscoveryNodes.Delta constructor Remove unused DiscoveryNodes.Delta constructor Remove unused DiscoveryNode#removeDeadMembers public method Remove minNodeVersion and corresponding public `getSmallestVersion` getter method from DiscoveryNodes ...
Today it's not possible to add exceptions to the serialization layer without breaking BWC. This commit adds the ability to specify the Version an exception was added that allows to fall back not NotSerializableExceptionWrapper if the exception is not present in the streams version. Relates to #21656
|
5.0.2 backport: 83f6e84 |
|
adaptation to v6.0.0 to support 5.0.2 backport: c521219 |
|
thanks @ywelsch |
|
adaptation to v5.1.0 to support 5.0.2 backport: 05529d9 |
Today it's not possible to add exceptions to the serialization layer
without breaking BWC. This commit adds the ability to specify the Version
an exception was added that allows to fall back not NotSerializableExceptionWrapper
if the exception is not present in the streams version.
Relates to #21656