Skip to content

Conversation

@s1monw
Copy link
Contributor

@s1monw s1monw commented Nov 21, 2016

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

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
@s1monw
Copy link
Contributor Author

s1monw commented Nov 21, 2016

@ywelsch can you take a look

@clintongormley clintongormley added >enhancement and removed :Core/Infra/Core Core issues without another label labels Nov 21, 2016
Copy link
Contributor

@ywelsch ywelsch left a 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);
Copy link
Contributor

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?

Copy link
Contributor Author

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 👯‍♂️

@s1monw
Copy link
Contributor Author

s1monw commented Nov 21, 2016

@ywelsch I rolled back the changes to Store.java

@s1monw s1monw merged commit 71a21b3 into elastic:master Nov 21, 2016
s1monw added a commit that referenced this pull request Nov 21, 2016
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
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Nov 22, 2016
* 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
  ...
@ywelsch ywelsch added the v5.0.2 label Nov 22, 2016
ywelsch pushed a commit that referenced this pull request Nov 22, 2016
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
@ywelsch
Copy link
Contributor

ywelsch commented Nov 22, 2016

5.0.2 backport: 83f6e84

ywelsch added a commit that referenced this pull request Nov 22, 2016
The PR #21694 was initially planned to go into v6.0.0 and v5.1.0. Due to another PR relying on this one though for backport to v5.0.2, #21694 must go to v5.0.2
as well. As such, the initial backward compatibility rules established by the PR must be changed to include v5.0.2 and above.
@ywelsch
Copy link
Contributor

ywelsch commented Nov 22, 2016

adaptation to v6.0.0 to support 5.0.2 backport: c521219

ywelsch added a commit that referenced this pull request Nov 22, 2016
The PR #21694 was initially planned to go into v6.0.0 and v5.1.0. Due to another PR relying on this one though for backport to v5.0.2, #21694 must go to v5.0.2
as well. As such, the initial backward compatibility rules established by the PR must be changed to include v5.0.2 and above.
@s1monw
Copy link
Contributor Author

s1monw commented Nov 22, 2016

thanks @ywelsch

@ywelsch
Copy link
Contributor

ywelsch commented Nov 22, 2016

adaptation to v5.1.0 to support 5.0.2 backport: 05529d9

@lcawl lcawl added :Core/Infra/Core Core issues without another label and removed :Exceptions labels Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants