Commit Graph

19361 Commits

Author SHA1 Message Date
Simon Willnauer 2d4d1a943b Merge pull request #16091 from s1monw/check_node_level_settings
Validate known global settings on startup
2016-01-19 16:01:53 +01:00
Simon Willnauer bc5d6cdff5 Validate known global settings on startup
Today we already validate all index level setting on startup. For global
settings we are not fully there yet since not all settings are registered.
Yet we can already validate the ones that are know if their values are parseable/correct.
This is better than nothing and an improvement to what we had before. Over time there will
be more an dmore setting converted and we can finally flip the switch.
2016-01-19 15:25:19 +01:00
Jim Ferenczi 12df1e7a6f Merge pull request #16078 from jimferenczi/mss_synonym
Do not apply minimum-should-match on a boolean query if the coords are disabled
2016-01-19 15:07:32 +01:00
Jim Ferenczi 9b1daff9b5 Do not apply minimum-should-match on a boolean query if the coords are disabled.
Fixes #15858
2016-01-19 14:50:01 +01:00
Jason Tedor d2ad2e8eee Fix typo in scroll timeout example
Closes #16075
2016-01-19 08:42:29 -05:00
David Pilato 8d35bca4db Add more tests for Azure Repository client selection
One test we forgot in #14843 and #13779 is the default client selection.

Most of the time, users won't define explicitly which client they want to use because they are providing only one connection to Azure storage:

```yml
cloud:
    azure:
        storage:
            my_account:
                account: your_azure_storage_account
                key: your_azure_storage_key
```

Then using the default client like this:

```sh
# This one will use the default account (my_account1)
curl -XPUT localhost:9200/_snapshot/my_backup1?pretty -d '{
  "type": "azure"
}'
```

This commit adds tests to check that the right client is still selected when no client is explicitly set when creating the snapshot.
2016-01-19 14:23:08 +01:00
David Pilato 11e7a746ae Replace server side timeout by client side timeout
This commit replaces server side timeout (which is BTW not correctly implemented in azure client 2.0.0 but fixed later #16084) with a client side timeout.

As a consequence, for each request sent to azure, azure client will raise an exception after a given amount of time (timeout).

Closes #12567
2016-01-19 13:56:08 +01:00
Isabel Drost-Fromm e7aae1b79e Merge pull request #16085 from MaineC/bug-fix/random-fuzziness-date
Fix for MatchQueryBuilderTests.testToQuery random fuzziness generation caused test failure.

Relates to #13284
2016-01-19 13:26:44 +01:00
Jason Tedor 089a7a321c Merge pull request #16041 from jasontedor/shard-started-channel-failures
Add handling of channel failures when starting a shard
2016-01-19 07:05:45 -05:00
Jason Tedor b7c1847c41 Add logging statement on shard state request send
This commit restores a debug-level logging statement when sending shard
state requests to the master node.
2016-01-19 06:59:42 -05:00
Isabel Drost-Fromm 3adeac149d Fix random fuzziness generation.
For all query testing we offer the option to initialise them with random
fuzziness objects. So far there is a chance to generate an edit distance based
fuzziness for non-string fields. This is fixed by this change.

Fixes the following test failure:

http://build-us-00.elastic.co/job/es_core_master_small/6606/testReport/junit/org.elasticsearch.index.query/MatchQueryBuilderTests/testToQuery/
2016-01-19 12:45:02 +01:00
Simon Willnauer 5a64f08f04 Merge pull request #16054 from s1monw/new_index_settings
Cut over all index scope settings to the new setting infrastrucuture

This change moves all index.* settings over to the new infrastructure. This means in short that:

 - every setting that has an index scope must be registered up-front
 - index settings are validated on index creation, template creation, index settings update
 - node level settings starting with index.* are validated on node startup
 - settings that are private to ES like index.version.created can only be set by tests when they install a specific test plugin.
 - all index settings can be reset by passing null as their value on update
 - all index settings defaults can be listed via the settings APIs

Closes #12854
Closes #6732
Closes #16032
Closes #12790
2016-01-19 12:26:46 +01:00
Yannick Welsch 0a69f1e283 Merge pull request #15708 from ywelsch/feature/reroute-stale-primary
Extend reroute with an option to force assign stale primary shard copies
2016-01-19 12:26:02 +01:00
Simon Willnauer bd37ba22e3 Merge branch 'master' into new_index_settings 2016-01-19 12:11:57 +01:00
Yannick Welsch d5b691b68e Extend reroute with an option to force assign stale primary shard copies
Closes #15708
2016-01-19 12:07:01 +01:00
Rachit Gupta 5b2ded5c96 Fix typo in doc values docs
Closes #16067
2016-01-19 05:58:39 -05:00
Jason Tedor ac237b269c Add handling of channel failures when starting a shard
This commit adds handling of channel failures when starting a shard to
o.e.c.a.s.ShardStateAction. This means that shard started requests
that timeout or occur when there is no master or the master leaves
after the request is sent will now be retried from here. The listener
for a shard state request will now only be notified upon successful
completion of the shard state request, or when a catastrophic
non-channel failure occurs.

This commit also refactors the handling of shard failure requests so
that the two shard state actions of shard failure and shard started
now share the same channel-retry and notification logic.
2016-01-19 05:31:26 -05:00
Yannick Welsch 6ca79095df Allow changing nested fields limit for open indices 2016-01-19 10:55:11 +01:00
Simon Willnauer fa0e1488aa Merge branch 'master' into new_index_settings 2016-01-19 10:50:11 +01:00
Simon Willnauer f2311fd8b3 register index.mapping.nested_fields.limit 2016-01-19 10:49:49 +01:00
Jason Tedor 296ab3ec16 Fix transport exceptions for shard state actions
This commit fixes an issue in the handling of TransportExceptions in
ShardStateAction. There were two cases not being handled correctly.
 - when the local node is shutting down, handlers will be notified with
   a TransportException with a message starting "transport stopped"
 - when the remote node disconnects, handlers will be notified with a
   NodeDisconnectedException

In both of these cases, the cause of the exception will be null and this
was incorrectly being handled. The first case can passed to the listener
like any other critical non-channel failure, and the second case can be
handled by modifying the logic for detecting master channel exceptions.

There was a third case of NodeNotConnectedException that was not being
treated as a master channel exception but should be.

This commit adds an integration test that simulates the handling of a
shard failure request during a network partition. By isolating the
master from the cluster while a shard failed request is in flight, this
test simulates that we wait until a new master is elected and then retry
sending that shard failed request to the newly elected master.

This commit adds methods to CapturingTransport to separate local and
remote transport exceptions. The motivation for this change is that
local transport exceptions are delivered to listeners (usually, but not
always) wrapped in SendRequestTransportException while remote transport
exceptions are delivered to listeners wrapped in
RemoteTransportException. By making this distinction clear in the
CapturingTransport, this makes it less likely that tests will make
incorrect assumptions about the exceptions coming out of the transport
layer to listeners.

Closes #16057
2016-01-19 10:43:50 +01:00
Simon Willnauer 0066fc9d5f Merge branch 'master' into new_index_settings 2016-01-19 10:42:25 +01:00
Yannick Welsch fc4e8fd937 Merge pull request #15989 from ywelsch/feature/limit-nested-fields
Add per-index setting to limit number of nested fields
2016-01-19 10:33:09 +01:00
Simon Willnauer fbfa9f4925 Merge branch 'master' into new_index_settings 2016-01-19 10:13:48 +01:00
Yannick Welsch a1b8dd2de9 Add per-index setting to limit number of nested fields
Closes #14983
2016-01-19 10:03:48 +01:00
Isabel Drost-Fromm 3b27dce94f Merge pull request #16056 from MaineC/bug-fix/15860
Fix for MatchQueryBuilderTests.testToQuery test failure

Relates to #15860
2016-01-19 09:57:46 +01:00
Simon Willnauer b73c737608 apply feedback from @nik9000 2016-01-19 09:54:00 +01:00
Simon Willnauer 8e0390b09e Register index.version_created for several analysis plugin tests 2016-01-19 09:35:32 +01:00
Adrien Grand b2baf039fd Fix compilation. 2016-01-19 09:32:04 +01:00
Adrien Grand a90d2fa0b4 Merge pull request #16023 from jpountz/fix/implicit_self_conflict
Reuse metadata mappers for dynamic updates.
2016-01-19 09:28:04 +01:00
Adrien Grand d6cbd6f2f0 Merge pull request #16059 from jpountz/enhancement/mapping_merge_reason
Expose the reason why a mapping merge is issued.
2016-01-19 09:27:32 +01:00
Simon Willnauer 20fe8ac854 Register index.version.created in Kuromoji unittest since it's a node level setting here 2016-01-19 09:14:41 +01:00
Boaz Leskes a90b551e36 Translog: remove ChannelReference and simplify Views
Currently we use ref counting to manage the life cycles of a translog file. This was done to allow the creation of view and snapshots, making sure that the underlying files are available. This commit takes a simpler route based on the observation that a snapshot doesn't need to have it's own life cycle but rather can lift on the lifecycle of it's parent (translog or view). If code failes to adhere to this assumption it will get a channel already closed exception. As such, each file is now owned by a single owner and there is no need for reference counting. As part of the rewrite TranslogReader is renamed to  BaseTranslogReader and ImmutableTranslogReader to TranslogReader

Also, I took the opportunity to clean up legacy translog readers we don't need in master.

Closes #15898
2016-01-19 09:05:26 +01:00
Ryan Ernst 8bf8ca6222 Fix rest tests to use ip and port again instead of localhost and port. 2016-01-18 19:28:41 -08:00
Igor Motov d9a01225cb Transport actions should make started tasks available to their callers
Sometimes action callers might be interested in having an access to the task that they have just initiated. This changes allows callers to get access to the Task object of the actions that they just started if the action supports the task management.
2016-01-18 21:29:23 -05:00
Nik Everett 53cce3c399 Merge pull request #16071 from nik9000/xlint_lang_groovy
Remove Xlint from lang-groovy and discovery-azure
2016-01-18 21:06:11 -05:00
Ryan Ernst 69e11d1e88 Merge pull request #16070 from rjernst/rest_alone
Test: Make rest test framework accept http directly for the test cluster
2016-01-18 17:38:23 -08:00
Ryan Ernst d7537075d6 Add TODO for splitting rest tests from client tests. 2016-01-18 16:59:42 -08:00
Ryan Ernst ef4f0a8699 Test: Make rest test framework accept http directly for the test cluster
The rest test framework, because it used to be tightly integrated with
ESIntegTestCase, currently expects the addresses for the test cluster to
be passed using the transport protocol port. However, it only uses this
to then find the http address.

This change makes ESRestTestCase extend from ESTestCase instead of
ESIntegTestCase, and changes the sysprop used to tests.rest.cluster,
which now takes the http address.

closes #15459
2016-01-18 16:44:14 -08:00
Nik Everett bd1324ccc9 Remove Xlint from lang-groovy and discovery-azure
discovery-azure didn't actually need it.

This removes all non-default Xlints from modules.
2016-01-18 18:24:44 -05:00
Tal Levy 993092cde6 Merge pull request #16062 from talevy/dedot-default-rest
[Ingest] Add default separator test to dedot rest test
2016-01-18 14:48:57 -08:00
Jason Tedor b6c9eaa24a Merge pull request #16068 from jasontedor/ip-field-mapper-term-queries
Single IPv4 addresses in IP field term queries

Closes #16058
2016-01-18 17:46:50 -05:00
Jason Tedor de992877b8 Single IPv4 addresses in IP field term queries
This commit modifies IpFieldMapper#termQuery to permit single IPv4
addresses for use in match and query_string queries.
2016-01-18 17:44:28 -05:00
Nik Everett 63090f5d4b Merge pull request #15761 from nik9000/more_remove_inject
Don't use guice for QueryParsers
2016-01-18 17:39:53 -05:00
Nik Everett d93b6f5248 Merge pull request #16065 from nik9000/xlint_mustache
Cleanup ContextAndHeaderTransportTests
2016-01-18 16:35:48 -05:00
Nik Everett cf166b54aa Merge pull request #16063 from nik9000/xlint_plan_a
Fix warnings in lang-plan-a
2016-01-18 16:21:13 -05:00
Nik Everett 093600cd63 Cleanup ContextAndHeaderTransportTests
We have two similar tests with the same name, ContextAndHeaderTransportTests.
They shared lots of common code so I extracted much of it into
ActionRecordingPlugin, a plugin which records all action requests for later
inspection.

I also removed all the warnings from both tests. That made lang-mustache
compile cleanly without any custom -Xlint so I removed those. To remove
the warnings I had to add type parameters to ActionFilter which seemed
like a good idea anyway.
2016-01-18 16:14:58 -05:00
Nik Everett 08ca9d7645 Fix warnings in lang-plan-a
Removes all Xlint skips in lang-plan-a. Warnings were just some extra
casts which were removed, some raw types which we just needed to <?>, and
a couple of unchecked casts in data that we know to be Map<String, Object>
because that structure is super-ultra-common in scripts.
2016-01-18 15:27:51 -05:00
Nik Everett 15c43b64a1 Don't use guice for QueryParsers
1. Gets guice out of the business of building ScoreFunctionParsers and
QueryParsers.
2. Moves QueryParser registration to SearchModule
3. Moves NamedWriteableRegistry construction out of guice and into Node and
TransportClient.
4. Moves shape registration into SearchModule so now all named writeable
registration is done in the SearchModule.

This is breaking for plugin authors. Instead of declaring new QueryParser
like:

```java
public void onModule(IndicesModule module) {
  module.registerQueryParser(NewQueryParser.class);
}
```

you do it like:

```java
public void onModule(SearchModule module) {
  module.registerQueryParser(NewQueryParser::new);
}
```

The QueryParser's argument no longer come from @Inject, now they come from
the declaration in the plugin. The above example is for a no-arg QueryParser.
Most of the QueryParsers in Elasticsearch are no-arg.

ScoreFunctionParsers have a similar but slightly different change. This:

```java
public void onModule(SearchModule module) {
  module.registerFunctionScoreParser(NewFunctionScoreParser.class);
}
```

becomes

```java
public void onModule(SearchModule module) {
  module.registerFunctionScoreParser(new NewFunctionScoreParser());
}
```

Since all known ScoreFunctionParsers have no arg constructors its simpler to
just build them at registration time rather than specify a supplier that is
used to build them later.
2016-01-18 15:02:47 -05:00
Tal Levy 4ef85eda36 add default separator test to dedot rest test 2016-01-18 09:25:36 -08:00