-
Notifications
You must be signed in to change notification settings - Fork 507
METRON-2262: Upgrade to Curator 4.2.0 #1516
base: feature/METRON-2088-support-hdp-3.1
Are you sure you want to change the base?
METRON-2262: Upgrade to Curator 4.2.0 #1516
Conversation
@merrimanr This is pretty complicated so I want to talk through this a bit and make sure this is clear. It looks like the upshot is that previously the functionality only depended on shared state in Zookeeper. You could reference a The integration test creates a The YARN app creates a |
Almost all correct. There are other
|
Oh, that's actually more than I thought without having run the lookup on uses. Glad I asked. One manual test we might want to add is attempting to remove a non-existent endpoint. Looking at the code, I don't see a whole lot of risk in the "add then remove" approach other than if the operation were to fail in between add/remove. For a service that doesn't exist, you could end up with an item in zookeeper that doesn't actually exist. |
So the bug is that we register and un-register in different processes. I think we could think about
|
Assuming the logic for using this way makes sense |
…3.1' into METRON-2262 # Conflicts: # metron-analytics/metron-maas-service/pom.xml # metron-analytics/metron-profiler-spark/pom.xml # metron-analytics/metron-profiler-storm/pom.xml # metron-interface/metron-rest/pom.xml # metron-platform/metron-common/pom.xml # metron-platform/metron-data-management/pom.xml # metron-platform/metron-elasticsearch/metron-elasticsearch-common/pom.xml # metron-platform/metron-enrichment/metron-enrichment-storm/pom.xml # metron-platform/metron-hbase-server/pom.xml # metron-platform/metron-hbase/metron-hbase-common/pom.xml # metron-platform/metron-indexing/metron-indexing-common/pom.xml # metron-platform/metron-integration-test/pom.xml # metron-platform/metron-management/pom.xml # metron-platform/metron-parsing/metron-parsers-common/pom.xml # metron-platform/metron-pcap-backend/pom.xml # metron-platform/metron-pcap/pom.xml # metron-platform/metron-solr/metron-solr-common/pom.xml # metron-platform/metron-test-utilities/pom.xml # metron-platform/metron-writer/metron-writer-common/pom.xml # metron-platform/metron-writer/metron-writer-storm/pom.xml # metron-stellar/stellar-common/pom.xml # pom.xml
Hey @merrimanr - We don't need the following changes on this PR. I know these are just due to the iterations and changes I went through on #1515.
|
Ah makes sense @nickwallen. Done with latest commit. |
Contributor Comments
This PR is based on METRON-2261 and includes those changes. It must be merged before this.
This PR upgrades Curator to version 4.2.0 and fixes a couple bugs in
MaasIntegrationTest
that resulted from the upgrade. There was an extra service unregister in theContainerRequestListener
class (should only be unregistered once) and another more complicated bug (described in the next section).Bug Fix
After upgrading to Curator version 4.2.0, both tests in
MaasIntegrationTest
fail with this error:The service is not properly unregistered, the test waits for the service to be removed from the list of endpoints and then timeouts and fails.
The root cause is a change in how the
org.apache.curator.x.discovery.details. ServiceDiscoveryImpl
class unregisters a service after the upgrade. The list of services is maintained in 2 places: Zookeeper and an internal Map inServiceDiscoveryImpl
. There are several read functions inServiceDiscoveryImpl
but then don't refresh the internal Map. The internal Map is only updated whenregisterService
andunregisterService
are called.Before the upgrade, a service is removed from Zookeeper then removed from the internal Map.
After the upgrade, the order is reversed. The service is removed from the internal Map then removed from Zookeeper. However there is a check that ensures the service existed in the internal Map before removing it for Zookeeper. Services are registered in
org.apache.metron.maas.service.runner.Runner
and unregistered inorg.apache.metron.maas.service.callback.ContainerRequestListener
. The latter runs in a different process so registered services are not in the internal Map. This was not a problem before the upgrade because Zookeeper was updated regardless of the internal Map state.The fix proposed in this PR is to register a service immediately before unregistering it in
org.apache.metron.maas.discovery.ServiceDiscoverer
. This populates the internal Map inServiceDiscoveryImpl
with the service so that the subsequent unregister call functions correctly. A side effect of this would be writing duplicate data to Zookeeper. The only other solution I can think of would be to rearchitect how and where services are registered/unregistered.Testing
The
MaasIntegrationTest
(and all tests) should pass. Upgrading Curator without the fixes in this PR should cause the error above.Pull Request Checklist
Thank you for submitting a contribution to Apache Metron.
Please refer to our Development Guidelines for the complete guide to follow for contributions.
Please refer also to our Build Verification Guidelines for complete smoke testing guides.
In order to streamline the review of the contribution we ask you follow these guidelines and ask you to double check the following:
For all changes:
For code changes:
Have you included steps to reproduce the behavior or problem that is being changed or addressed?
Have you included steps or a guide to how the change may be verified and tested manually?
Have you ensured that the full suite of tests and checks have been executed in the root metron folder via:
Have you written or updated unit tests and or integration tests to verify your changes?
If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
Have you verified the basic functionality of the build by building and running locally with Vagrant full-dev environment or the equivalent?
For documentation related changes:
Have you ensured that format looks appropriate for the output in which it is rendered by building and verifying the site-book? If not then run the following commands and the verify changes via
site-book/target/site/index.html
:Have you ensured that any documentation diagrams have been updated, along with their source files, using draw.io? See Metron Development Guidelines for instructions.
Note:
Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.
It is also recommended that travis-ci is set up for your personal repository such that your branches are built there before submitting a pull request.