-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[BUG] Classes that implement interface 'o.o.cluster.LocalNodeMasterListener' should not have to implement abstract method 'onClusterManager()' and 'offClusterManager()' #3688
Comments
I have got a solution from @andrross to deprecate the abstract methods
Introducing a new abstract method is a breaking change, and adding a new method with a default implementation is not a breaking change. In addition, a new unit test is added by PR #3871: OpenSearch/server/src/test/java/org/opensearch/cluster/service/ClusterApplierServiceTests.java Line 340 in 0e96a87
to validate the backwards compatibility for the abstract methods onMaster() and offMaster() .
|
Specifically, the solution provided by @andrross for deprecating the abstract methods in interface
|
The final solution in PR #4121 has been merged, and from version 2.2.0, developers can use |
Describe the bug
Similar issue: #3663 and #3683
Introduced by PR #2519 / commit 79eb3b0, which aims to resolve issue #1548
The problem:
2 abstract methods
onMaster()
andoffMaster()
of interface LocalNodeMasterListener got renamed directly.It broke the backwards compatibility that all classes that implements the interface have to implement the methods in the new name.
It causes build failure for plugins, such as https://github.com/opensearch-project/index-management/blob/b6e7d35c4fe4b64a41ef9e45d0cafcdfe0289042/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/IndexStateManagementHistory.kt#L85
A solution right now is to revert the changes, which means change back the method name
onMaster()
andoffMaster()
in the interface LocalNodeMasterListener.To Reproduce
Build Index management plugin with OpenSearch 2.1.0 (the code at https://github.com/opensearch-project/OpenSearch/tree/304d830275fdbe5f8095a7285ca66266987c727a)
java.lang.AbstractMethodError: Receiver class org.opensearch.indexmanagement.indexstatemanagement.IndexStateManagementHistory does not define or inherit an implementation of the resolved method 'abstract void onClusterManager()' of interface org.opensearch.cluster.LocalNodeMasterListener.
Expected behavior
Index management plugin should successfully be built with OpenSearch 2.1.0
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: