yakaz / elasticsearch-action-updatebyquery

ElasticSearch Update By Query action plugin
113 stars 24 forks source link

#18: v2.0.0 not compatible with ES 1.3 #20

Closed consulthys closed 10 years ago

consulthys commented 10 years ago

This fixes the plugin for up to the latest ES 1.3.1 version

ofavre commented 10 years ago

When running the tests I get the following error once per test:

java.lang.NullPointerException
    at __randomizedtesting.SeedInfo.seed([CFF7F08E40CF5B41:DD508B5D80234C80]:0)
    at org.elasticsearch.client.transport.support.InternalTransportClient$2.doWithNode(InternalTransportClient.java:108)
    at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:219)
    at org.elasticsearch.client.transport.support.InternalTransportClient.execute(InternalTransportClient.java:105)
    at org.elasticsearch.client.transport.TransportClient.execute(TransportClient.java:321)
    at org.elasticsearch.client.UpdateByQueryClientWrapper.updateByQuery(UpdateByQueryClientWrapper.java:20)
    at org.elasticsearch.action.updatebyquery.UpdateByQueryRequestBuilder.doExecute(UpdateByQueryRequestBuilder.java:110)
    at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:91)
    at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:65)
    at org.elasticsearch.test.integration.updatebyquery.UpdateByQueryTests.testUpdateByQuery_multipleIndices(UpdateByQueryTests.java:200)

I had the same problem when trying to update to ES 1.2.3 (from the current master). Any idea?

consulthys commented 10 years ago

Yes, same thing here. I've started searching around and found similar issues (rooted in Lucene?), but I didn't get to the real cause yet.

ofavre commented 10 years ago

It seems that the plugin is not loaded by ES.

[2014-08-11 19:37:52,726][INFO ][node                     ] [node_6] version[1.3.0], pid[3016], build[1265b14/2014-07-23T13:46:36Z]
[2014-08-11 19:37:52,726][INFO ][node                     ] [node_6] initializing ...
[2014-08-11 19:37:52,727][INFO ][plugins                  ] [node_6] loaded [], sites []
[2014-08-11 19:37:52,776][INFO ][node                     ] [node_6] initialized

Looking at a git diff v1.2.2...v1.2.3 against elasticsearch, I can see some changes in PluginsService and TestCluster. I'll try updating my AbstractNodesTests or use their test jar.

ofavre commented 10 years ago

AbstractNodesTests is no longer used, and I already was using elasticsearch test-jar. So I tried to change UpdateByQueryTests with the following:

    @Override
    protected Settings nodeSettings(int nodeOrdinal) {
        return ImmutableSettings.settingsBuilder()
                .put("plugins." + PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, true) // XXX added line
                .put("action.updatebyquery.bulk_size", 5)
                .put(super.nodeSettings(nodeOrdinal))
                .build();
    }

But if I add some logging (or even call System.exit()) I can see that the function is not called, even though ElasticsearchIntegrationTest hands it on to TestCluster...

ofavre commented 10 years ago

I've figured it out, see 992df55. I'll soon update to ES 1.3.

consulthys commented 10 years ago

Nice job, thx!