Commit Graph

1214 Commits

Author SHA1 Message Date
Martijn van Groningen 1b84cadb7b test: The transport client that interacts with the external cluster shoud be provided a list of transport client plugins. 2015-08-31 16:58:03 +02:00
Britta Weber a7e240077d Merge pull request #13218 from brwe/resolve-index-default-impl
add default impl for resolveIndex()
2015-08-31 15:53:57 +02:00
Michael McCandless a49217949f Merge pull request #13199 from mikemccand/remove_merge_docs
Move expert segment merge settings documentation off site into javadocs.
2015-08-31 09:52:19 -04:00
Britta Weber 73785e075e add default impl for resolveIndex() 2015-08-31 15:48:32 +02:00
Tanguy Leroux dbbecce8f2 Sort thread pools by name in Nodes Stats 2015-08-31 14:30:43 +02:00
Jason Tedor 6e2dc73023 Merge pull request #13205 from jasontedor/feature/13204
Convert upgrade action to broadcast by node
2015-08-31 06:02:08 -04:00
Jason Tedor d1223b7369 Convert upgrade action to broadcast by node
Several shard-level operations that previously broadcasted a request
per shard were converted to broadcast a request per node. This commit
converts upgrade action to this new model as well.

Closes #13204
2015-08-31 05:59:57 -04:00
Alexander Reelsen 856b040a0a Plugins: Replace HTTP urls with HTTPS
Switch to use HTTPS by default for all hardcoded plugin URLs.
If users want to install via HTTP they can still specify a HTTP
URL manually.

Closes #12748
2015-08-31 11:45:38 +02:00
Alexander Reelsen 00902207a6 Tests: Ensure binding on localhost host is consistently ipv4/v6
The current netty multiport tests bind on localhost and then try to connect
to 127.0.0.1, which may fail, if localhost is resolved to ipv6 by default.

This randomly chooses between 127.0.0.1, localhost and ::1 (if available) for
binding and then uses this throughout the test.
2015-08-31 10:56:42 +02:00
Simon Willnauer a17d7500d3 Take Shard data path into account in DiskThresholdDecider
The path that a shard is allocated on is not taken into account when
we decide to move a shard away from a node because it passed a watermark.
Even worse we potentially moved away (relocated) a shard that was not even
allocated on that disk but on another on the node in question. This commit
adds a ShardRouting -> dataPath mapping to ClusterInfo that allows to identify
on which disk the shards are allocated on.

Relates to #13106
2015-08-31 10:40:42 +02:00
Ryan Ernst c01b377ea8 Mappings: Fix numerous checks for equality and compatibility
The field type tests for mappings had a huge hole: check compatibility
was not tested directly at all! I had meant for this to happen in a
follow up after #8871, and was relying on existing mapping tests.
However, there were a number of issues.

This change reworks the fieldtype tests to be able to check all settable
properties on a field type work with checkCompatibility. It fixes a
handful of small bugs in various field types. In particular, analyzer
comparison was just wrong: it was comparing reference equality for
search analyzer instead of the analyzer name. There was also no check
for search quote analyzer.

closes #13112
2015-08-30 23:05:38 -07:00
Michael McCandless 7ad2222ccc copy over merge docs as javadocs 2015-08-30 18:14:47 -04:00
Ryan Ernst 6295f8e795 Merge branch 'master' into tell_me_your_plugins 2015-08-30 14:20:54 -07:00
Ryan Ernst 2539b779c8 Merge pull request #13137 from rjernst/empty_doc_again
Fix doc parser to still pre/post process metadata fields on disabled type
2015-08-30 12:14:18 -07:00
Ivannikov Kirill 38805f3cbd Fix 13202 2015-08-30 23:56:34 +05:00
Jason Tedor aa26b66e96 Remove leftover debugging statement 2015-08-30 14:19:30 -04:00
Simon Willnauer 86a8a0a570 IndicesStatsAction is now a per node operation 2015-08-30 12:48:13 +02:00
David Pilato 03bb28514e Installing plugin without checksums ends up downloading from github
```sh
bin/plugin install lmenezes/elasticsearch-kopf/develop
-> Installing lmenezes/elasticsearch-kopf/develop...
Trying http://download.elastic.co/lmenezes/elasticsearch-kopf/elasticsearch-kopf-develop.zip ...
Trying http://search.maven.org/remotecontent?filepath=lmenezes/elasticsearch-kopf/develop/elasticsearch-kopf-develop.zip ...
Trying https://oss.sonatype.org/service/local/repositories/releases/content/lmenezes/elasticsearch-kopf/develop/elasticsearch-kopf-develop.zip ...
Trying https://github.com/lmenezes/elasticsearch-kopf/archive/develop.zip ...
Downloading .................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................DONE
Verifying https://github.com/lmenezes/elasticsearch-kopf/archive/develop.zip checksums if available ...
Trying https://github.com/lmenezes/elasticsearch-kopf/archive/master.zip ...
Downloading ....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................DONE
Verifying https://github.com/lmenezes/elasticsearch-kopf/archive/master.zip checksums if available ...
```

This happens because we don't have anymore ElasticsearchWrapperException here but standard java exceptions.

Closes #13196.
2015-08-29 23:00:45 +02:00
Jason Tedor 5cb86130ec Add mechanism for transporting shard-level actions by node
Currently, many shard-level operations are transported with a request
per shard via TransportBroadcastAction. These shard-level requests are
then submitted to unbounded execution queues for asynchronous execution
on the receiving node. This transport mechanism and stuffing of the
execution queues can be problematic on large clusters. A better
mechanism would be to aggregate the shard-level requests, transport
them via a single request per node, and execute the shard-level
operations serially on the receiving node.

This commit introduces TransportNodeBroadcastAction which is the
high-level mechanism for transporting the shard-level operations in a
single request per node. The shard-level operations are executed
serially on the receiving node and per-node shard-level results are
aggregated into a single response per node. These node-level results
are then aggregated into a single response to the initial request.

One item of note is a new mechanism for registering request handlers.
This mechanism enables registrants to provide a callback for
instantiating new instances of the request class. Doing this enables
the inner class to be instantiated with the context of its outer class.
This is done so that a single NodeRequest class can be defined rather
than defining a class per operation.

Closes #7990
2015-08-29 16:15:12 -04:00
Jim Hooker 05aa1d90b8 Extend AbstractComponent and remove logger 2015-08-29 07:43:17 +01:00
Jason Tedor 0fa8ee1edd Fix logging statement in o.e.a.s.m.TransportMasterNodeAction 2015-08-28 13:39:56 -04:00
Jason Tedor 532d100c22 Fix logging statement 2015-08-28 13:34:22 -04:00
Nik Everett c180defb10 [CAT] Default verbose to false
Closes #13156
2015-08-28 11:15:44 -04:00
Simon Willnauer 0c71328186 Expand ClusterInfo to provide min / max disk usage forn allocation decider
Today we sum up the disk usage for the allocation decider which is broken since
we don't stripe across multiple data paths. Each shard has it's own private path
now but the allocation deciders still treat all paths as one big disk. This commit
adds allows allocation deciders to access the least used and most used path to make
better allocation decidsions upon canRemain and canAllocate calls.

Yet, this commit doesn't fix all the issues since we still can't tell which shard
can remain and which can't. This problem is out of scope in this commit and will be solved
in a followup commit.

Relates to #13106
2015-08-28 14:04:25 +02:00
Boaz Leskes 35f9ee7a62 Tests: better isolation of cluster ports
Previously multiple clusters in the same JVM reused the same port ranges, leading to potential big gaps in port selection, which in turns causes unicast based discovery to fail, missing to find another node in the default 5 port range.

Also the previous logic had http use a range that is assigned to another JVMs.
2015-08-28 11:39:30 +02:00
Michael McCandless 07b5d22d91 disable new test on windows 2015-08-28 05:06:35 -04:00
Michael McCandless fb703845dd Merge pull request #13158 from mikemccand/new_path_for_shard_test
Add unit test for ShardPath.selectNewPathForShard
2015-08-28 04:15:15 -04:00
Michael McCandless b646ed9cd8 try to work on Windows too 2015-08-28 04:13:21 -04:00
Michael McCandless 8dbc1fbdbd use ShardPath.getRootStatePath; allow forbidden API 2015-08-28 03:59:02 -04:00
Boaz Leskes db5e225a25 Discovery: fix `discovery.zen.join_timeout` default value logic
We default the value to be 20x the value of a ping timeout, however we only use the legacy ping timeout settings value for the calculation.

Closes #13162
2015-08-28 09:47:15 +02:00
javanna 9b2e77903d Internal: make ValidationException methods final and fix javadocs 2015-08-28 09:41:47 +02:00
javanna 37ec221df5 Internal: remove unused MapperQueryParser constructor 2015-08-28 09:38:29 +02:00
Jason Tedor 90bc784194 Work around for JDK-8039214 on JDK 9 2015-08-27 23:29:22 -04:00
Jason Tedor 3067cacb66 Remove and forbid use of com.google.common.collect.Lists
This commit removes and now forbids all uses of
com.google.common.collect.Lists across the codebase. This is the first
of many steps in the eventual removal of Guava as a dependency.
2015-08-27 22:14:33 -04:00
Igor Motov 2b87d7d919 Add `readonly` option for repositories
Closes #7831
Closes #11753
2015-08-27 18:21:29 -04:00
Nik Everett 19a79c99f9 [test] Use proper comparison operator
lessThanOrEqualTo is more appropriate when comparing _ttl than lessThan
because in rare cases, when tests run very fast, the ttl you fetch will
still equal the one you sent.
2015-08-27 16:43:10 -04:00
Britta Weber e6eeadd171 [test] make sure that the scripts in testScoreAccessWithinScript never compute log(0) 2015-08-27 22:02:51 +02:00
Ryan Ernst 448d3498b1 Merge branch 'master' into fix/bwc_creation 2015-08-27 10:16:45 -07:00
Michael McCandless e2e1b7f76a reference original issue 2015-08-27 13:06:00 -04:00
Michael McCandless 30a3e431ec polish 2015-08-27 13:01:36 -04:00
Michael McCandless 11f09f0a68 add basic unit test 2015-08-27 12:33:04 -04:00
Michael McCandless 4d38856f70 simplify API for ShardPath.selectNewPathForShard to enable unit testing: don't pass IndexShard 2015-08-27 12:32:21 -04:00
Lee Hinman 9f03f8cf44 Call `beforeIndexShardCreated` listener earlier in `createShard`
Some listeners may need to do work before a shard's path is
accessed (such as creating the directory in a plugin), so the listener
should be called before anything happens (as its name implies).
2015-08-27 10:05:27 -06:00
Michael McCandless 8f2ae59316 add asserts to make sure mocking 'took' 2015-08-27 11:19:55 -04:00
Michael McCandless 7a8a608d50 initial mock filesystem setup for test case 2015-08-27 10:55:04 -04:00
Nik Everett 9eb684da51 Default detect_noop to true
detect_noop is pretty cheap and noop updates compartively expensive so this
feels like a sensible default.

Also had to do some testing and documentation around how _ttl works with
detect_noop.

Closes #11282
2015-08-27 10:34:18 -04:00
Simon Willnauer 9a1b5cf966 [TEST] comparing paths seems to be hard on windonws 2015-08-27 13:20:22 +02:00
javanna dc807f294e Query DSL: deprecate _name and boost in short variants of queries
As discussed in #11744 this is the last step to unify parsing of boost and _name. Those fields are supported only in long version of queries, while we sometimes parse them when wwe shouldn't, inconsistently.

Closes #11744
Closes #12966
2015-08-27 12:24:42 +02:00
André Carvalho 793fcb6998 Warmers: delete _all should not throw exception when no warmers are registered
Closes #8991
Closes #13058
2015-08-27 12:24:42 +02:00
Jason Tedor a867a950ab Merge pull request #13135 from jasontedor/fix/eliminate-tuple-as-a-method-parameter
Remove usage of tuple as a method parameter
2015-08-27 04:57:26 -04:00
Simon Willnauer 03ccb99cd5 Expose shards data and state path via ShardStats
Since we now don't stripe shards across data paths we need a way
to access the information on which path a shard is allocated to
eventually do better allocation decisions based on disk usage etc.
This commit exposes the shard paths as part of the shard stats.

Relates to #13106
2015-08-27 09:42:56 +02:00
Ryan Ernst a5bae3bdd8 Mappings: Fix doc parser to still pre/post process metadata fields on disabled type
closes #13017
2015-08-26 20:21:22 -07:00
Ryan Ernst 1029b119d9 Tests: Fix generation scripts for bwc indexes, and add 2.0 beta1 index 2015-08-26 19:36:26 -07:00
Jason Tedor a1408ef622 Remove usage of tuple as a method parameter
This commit removes all instances of
org.elasticsearch.common.collect.Tuple as a method parameter.

Closes #10787
2015-08-26 22:07:33 -04:00
xuzha fb2be6d6a1 The name "position_offset_gap" is confusing because Lucene has three
similar sounding things:

* Analyzer#getPositionIncrementGap
* Analyzer#getOffsetGap
* IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS and
* FieldType#storeTermVectorOffsets

Rename position_offset_gap to position_increment_gap
closes #13056
2015-08-26 14:56:35 -07:00
Martijn van Groningen a0565f00dd Removed the `operation_threaded` option.
This low level option isn't worth the complexity and an operation should never happen on the network thread.
2015-08-26 15:21:50 +02:00
Martijn van Groningen 3b400aafd6 parent/child: use the index searcher from engine searcher directly for JoinUtil based impl
and use the provided index searcher directly for the pre 2.0 parent/child imp.
2015-08-26 15:03:11 +02:00
Colin Goodheart-Smithe bd0753eaa3 Merge pull request #13033 from xuzha/xu-12391
Print field name when meet unexpected token.
2015-08-26 14:41:08 +02:00
Boaz Leskes 95c097bf24 Tests: use assertHitCount instead of direct assertion on hits in metric tests
So we will get more info on failures
2015-08-26 11:00:48 +02:00
Nik Everett 3f6108ab74 [Mapping] Move position_offset_gap default change
Until a couple of hours ago we expected the position_offset_gap to default
to 0 in 2.0 and 100 in 2.1. We decided it was worth backporting that new
default to 2.0. So now that its backported we need to teach 2.1 that 2.0
also defaults to 100.

Closes #7268
2015-08-25 18:01:10 -04:00
Nik Everett 4b9664beeb Mapping: Default position_offset_gap to 100
This is much more fiddly than you'd expect it to be because of the way
position_offset_gap is applied in StringFieldMapper. Instead of setting
the default to 100 its simpler to make sure that all the analyzers default
to 100 and that StringFieldMapper doesn't override the default unless the
user specifies something different. Unless the index was created before
2.1, in which case the old default of 0 has to take.

Also postition_offset_gaps less than 0 aren't allowed at all.

New tests test that:
1. the new default doesn't match phrases across values with reasonably low
slop (5)
2. the new default doest match phrases across values with reasonably high
slop (50)
3. you can override the value and phrases work as you'd expect
4. if you leave the value undefined in the mapping and define it on a
custom analyzer the the value from the custom analyzer shines through

Closes #7268
2015-08-25 14:21:50 -04:00
Ryan Ernst d77bcb0d9b Merge pull request #13085 from rjernst/fix/13017
Fix document parsing to properly ignore entire type when disabled
2015-08-25 08:58:07 -07:00
javanna cc12501cef Internal: remove unused code from query_string parser and settings
Closes #13098
2015-08-25 12:53:41 +02:00
Jason Tedor 8ff1efbcf0 Merge pull request #13082 from jasontedor/feature/13081
Consolidate duplicate logic in RoutingTable all*ShardsGrouped
2015-08-25 05:06:26 -04:00
Martijn van Groningen 9f3043fc78 Merge pull request #13087 from martijnvg/nested/child_filter_can_just_be_regular_filter
Nested query should only use bitset cache for parent filter
2015-08-25 10:13:36 +02:00
Ryan Ernst 01cfa95d1c do real copies where copyOf was used before 2015-08-24 21:22:21 -07:00
Ryan Ernst 69ba45a797 Merge branch 'master' into lists_are_simple 2015-08-24 20:23:59 -07:00
Ryan Ernst 311faa822a Merge branch 'master' into lists_are_simple 2015-08-24 19:06:58 -07:00
Jason Tedor 51ae1c4d53 Merge pull request #13086 from jasontedor/fix/no-duplicate-settings
Detect duplicate settings keys on startup
2015-08-24 20:51:22 -04:00
Jason Tedor a7af34022c Detect duplicate settings keys on startup
This commit changes the startup behavior of Elasticsearch to throw an
exception if duplicate settings keys are detected in the Elasticsearch
configuration file.

Closes #13079
2015-08-24 20:50:46 -04:00
Martijn van Groningen ee2a5fc2bc nested: child level filter should be a regular filter! 2015-08-24 22:19:56 +02:00
Ryan Ernst 297f0f22d7 Merge branch 'master' into tell_me_your_plugins 2015-08-24 12:03:25 -07:00
Ryan Ernst f7b3fe05e4 Mappings: Fix document parsing to properly ignore entire type when disabled
Currently when an entire type is disabled, our document parser will end
parsing on the first field of the document. This blows up the recently
added check that parsing did not silently skip any tokens (ie whether
there was garbage leftover).

This change fixes the parser to correctly skip the entire document when
the type is disabled.

closes #13017
2015-08-24 11:08:38 -07:00
Jason Tedor 29a03b9c8a Consolidate duplicate logic in RoutingTable all*ShardsGrouped
This commit consolidates the logic in
RoutingTable#allActiveShardsGrouped and
RoutingTable#allAssignedShardsGrouped into a single method that merely
applies a predicate to each ShardRouting.

Closes #13081
2015-08-24 12:26:54 -04:00
Christoph Büscher 119e9ba138 Merge pull request #13072 from cbuescher/plugin-install-help-update
Update the plugin install CLI help to the new short name for commercial plugins
2015-08-24 18:16:00 +02:00
Christoph Büscher 888989b3f3 Changed help text 2015-08-24 17:56:59 +02:00
Christoph Büscher 339486b943 Merge pull request #13073 from cbuescher/rm-rewrite-multiMatchQueryBuilder
Remove unsupported `rewrite` from multi_match query builder
2015-08-24 16:12:11 +02:00
Christoph Büscher 5f85349080 Minor fix in plugin install CLI help 2015-08-24 15:42:10 +02:00
André Carvalho c2c4742f65 proper creation of values for unmapped field on score function 2015-08-24 10:02:18 -03:00
Simon Willnauer 7aa855da51 Merge pull request #13057 from rmuir/easier_mlockall
Make mlockall configuration easier.
2015-08-24 14:49:22 +02:00
Simon Willnauer 707c6ca1d1 Merge pull request #13054 from rmuir/favicon
Add favicon
2015-08-24 14:48:57 +02:00
Simon Willnauer 23dc785f3f Merge pull request #13049 from s1monw/fix_race_in_meta_state
Don't check if directory is present to prevent races
2015-08-24 14:47:59 +02:00
Christoph Büscher 150b4747b4 Query DSL: Remove unsupported `rewrite` option from multi match query builder
The `rewrite` option has been removed from the parser with
commit da5fa6c4 and won't parse anymore, however we still
have a setter for it in the builder that gets rendered out
when used and potentially leads to parsing errors. This PR
removes the setter for the unsupported `rewrite` option.
2015-08-24 14:28:21 +02:00
André Carvalho 60ab72e322 using emptySortedNumericDoubles instead of null in score function 2015-08-24 09:19:45 -03:00
Christoph Büscher c7a8386928 Merge pull request #13069 from cbuescher/rm-matchQuery-rewrite
Remove unsupported `rewrite` option from match query builder
2015-08-24 14:04:52 +02:00
Martijn van Groningen d7327b7b31 test: changed the join timeout from the default 60s to 10s and
also wait for the cluster state to contain 4 nodes instead of just waiting for a green state.
2015-08-24 13:43:08 +02:00
Martijn van Groningen 8862348e4f test: moved ensureStableCluster(...) to base integ test class 2015-08-24 13:43:03 +02:00
Christoph Büscher 059ef5c749 Query DSL: Remove unsupported `rewrite` option from match query builder
The `rewrite` option has been removed from the parser with
commit da5fa6c4 and won't parse anymore, however we still
have a setter for it in the builder that gets rendered out
when used and potentially leads to parsing errors. This PR
removes the setter for the unsupported `rewrite` option.
2015-08-24 13:01:43 +02:00
xuzha f77b349c23 The queue_size value should be shown as an integer,
closes #10404
closes #13063
2015-08-24 10:04:55 +02:00
Ryan Ernst 76c472973e Also fix order of injection with plugins for transport client
See #13061
2015-08-23 11:18:38 -07:00
Ryan Ernst b6d3fa27e2 Internal: Add plugin modules before (almost all) others
This change makes modules added by plugins come before others, as it was
before #12783. The order of configuration, and thereby binding, happens
in the order modules are received, and without this change, some plugins
can get *insane* guice errors (500mb stack trace).
2015-08-23 11:08:36 -07:00
André Carvalho 345b2b98cf FunctionScore should work on unampped fields when missing parameter is specified 2015-08-22 23:36:13 -03:00
Ryan Ernst ef592a8e17 Fix test plugin to correctly add action 2015-08-22 16:08:35 -07:00
Ryan Ernst d2606feb3d Remove PreProcessModule 2015-08-22 09:44:04 -07:00
Ryan Ernst 07807f320a Merge branch 'master' into module_culling4 2015-08-22 09:40:17 -07:00
Simon Willnauer febc7f5d4c [TEST] Provide unicast hosts for Tribe nodes in TribeIT 2015-08-22 18:37:58 +02:00
Robert Muir f2db1023c1 Make mlockall configuration easier. 2015-08-22 09:55:09 -04:00
Jason Tedor 0407782baa Clearer logic in checking testing version validity 2015-08-22 09:27:56 -04:00
Ryan Ernst 89e1a0fb7d Plugins: Removed plugin.types
The setting `plugin.types` is currently used to load plugins from the
classpath. This is necessary in tests, as well as the transport client.

This change removes the setting, and replaces it with the ability to
directly add plugins when building a transport client, as well as
infrastructure in the integration tests to specify which plugin classes
should be loaded on each node.
2015-08-22 01:37:43 -07:00
Robert Muir 91d16f45c6 Add favicon 2015-08-22 00:16:36 -04:00
Robert Muir 35689f0d02 Cleanup bootstrap package.
* makes most classes final and package private
* removes duplicate and confusing multiple entry points
* adds javadocs to some classes like JarHell,Security
* adds a public class BootStrapInfo that exposes any stats
  needed by outside code.
2015-08-21 23:28:56 -04:00
Robert Muir be366c729f Lucene SPI support for plugins.
When we create a plugin's classloader, we should allow it to register things in
the lucene SPI (registry of Tokenizers, TokenFilters, CharFilters, Codec,
PostingsFormat, DocValuesFormat).

Plugins should be able to do this so they can extend Lucene.
2015-08-21 20:12:30 -04:00
Robert Muir d96af934db Improve startup exceptions (especially file permissions etc)
Squashed commit of the following:

commit 0014d31c1c478977cc8c50eb635eab0fb91449e4
Author: Robert Muir <rmuir@apache.org>
Date:   Fri Aug 21 18:20:35 2015 -0400

    Add missing paren to javadocs

commit bb46142785c67b849cfa5aa08fe5a3877a550b3d
Author: Robert Muir <rmuir@apache.org>
Date:   Fri Aug 21 18:08:45 2015 -0400

    Improve startup exceptions (especially file permissions etc)
2015-08-21 18:21:01 -04:00
Simon Willnauer 846cf620db Don't check if directory is present to prevent races
We do check if a directory is present and then open a dir stream on
it. Yet the file can be concurrrently deleted which is OK but we fail
with a hard exception. This change tries to open the dir directly (listing via stream)
and catches NoSuchFileEx | FNFEx.
2015-08-21 21:44:54 +02:00
Jim Hooker 57a83fce07 Turn DestructiveOperations.java into a Guice module.
https://github.com/elastic/elasticsearch/issues/4665

Inject DestructiveOperations object rather than use new.

Use constant rather than hard-coded string
2015-08-21 19:42:54 +01:00
Jason Tedor fe8eb80b4c Do not permit multiple settings files
This commit enforces that at most a single settings file is found. If
multiple settings files are found, a SettingsException will be thrown

Closes #13042
2015-08-21 11:37:35 -04:00
Robert Muir 5002f3b5ac Fix compilation... forgot to 'mvn clean' 2015-08-21 11:11:47 -04:00
Robert Muir 2ecf9af71d Merge pull request #13041 from rmuir/consistent_formatting
Use StartupError to format all exceptions hitting the console
2015-08-21 11:09:02 -04:00
Robert Muir 287789be53 Use StartupError to format all exceptions hitting the console 2015-08-21 11:05:31 -04:00
Jason Tedor f4774d17a6 Do not swallow exceptions thrown while parsing settings
This commit fixes an issue that was causing Elasticsearch to silently
ignore settings files that contain garbage. The underlying issue was
swallowing an SettingsException under the assumption that the only
reason that an exception could be throw was due to the settings file
not existing (in this case the IOException would be the cause of the
swallowed SettingsException). This assumption is mistaken as an
IOException could also be thrown due to an access error or a read
error. Additionally, a SettingsException could be thrown exactly
because garbage was found in the settings file. We should instead
explicitly check that the settings file exists, and bomb on an
exception thrown for any reason.

Closes #13028
2015-08-21 10:43:48 -04:00
Jason Tedor 13c1c27d5a Merge pull request #13036 from jasontedor/limit-type-name-length
Limit type name length
2015-08-21 09:19:11 -04:00
Jason Tedor 1579e491d8 Limit type name length
This commit will limit type name length to be at most 255 characters.

Closes #13021
2015-08-21 09:18:30 -04:00
Jason Tedor f0aae96f11 Utility method for getting the first version prior to given version 2015-08-21 09:18:29 -04:00
Simon Willnauer d96e8634ac Suppress rest exceptions by default and log them instead
Today we are very verbose when rendering exceptions on the rest layer.
Yet, this isn't necessarily very easy to read and way too much infromation most
of the time. This change suppresses the stacktrace rendering by default but instead
adds a `rest.suppressed` logger that logs the suppressed stacktrace or rather the entire
exception on the node that renderes the exception
The log message looks like this:

```
[2015-08-19 16:21:58,427][INFO ][rest.suppressed          ] /test/_search/ Params: {index=test}
[test] IndexNotFoundException[no such index]
	at org.elasticsearch.cluster.metadata.IndexNameExpressionResolver$WildcardExpressionResolver.resolve(IndexNameExpressionResolver.java:551)
```
2015-08-21 15:17:45 +02:00
javanna ded442952b Java api: add missing support for escape to QueryStringQueryBuilder
QueryStringQueryParser parses `escape`, but java api users had no chance to actually set it.

Closes #13016
2015-08-21 15:04:53 +02:00
Jason Tedor 31b80e4f3f Merge pull request #13010 from jasontedor/feature/improve-java-version-comparison
Improve java version comparison and explicitly enforce a version format
2015-08-21 08:30:50 -04:00
Jason Tedor 5ff1f8a058 Enforce version format for java.version for plugins
Currently we implicitly enforce a version format on the java.version
property for plugins via JarHell.checkJavaVersion. We should explicitly
enforce this version format and specify it in the documentation.

This commit adds an explicit enforcement of the version format on the
java.version property for plugins and updates the documentation for
plugin-descriptor.properties accordingly.

Closes #13009
2015-08-21 08:28:41 -04:00
Jason Tedor 126e8e4aee Improve Java version comparison in JarHell
This commit improves Java version comparison in JarHell.

The first improvement is the addition of a method to check the version
format of a target version string. This method will reject target
version strings that are not a sequence of nonnegative decimal integers
separated by “.”s, possibly with leading zeros (0*[0-9]+(\.[0-9]+)?).
This version format is the version format used for Java specification
versioning (cf. Java Product Versioning, 1.5.1 Specification Versioning
and the Javadocs for java.lang.Package.)

The second improvement is a clean method for checking that a target
version is compatible with the runtime version of the JVM. This is done
using the system property java.specification.version and comparing the
versions lexicograpically. This method of comparison has been tested on
JDK 9 builds that include JEP-220 (the Project Jigsaw JEP concerning
modular runtime images) and JEP-223 (the version string JEP). The class
that encapsulates the methods for parsing and comparing versions is
written in a way that can easily be converted to use the Version class
from JEP-223 if that class is ultimately incorporated into mainline JDK
9.

Closes #12441
2015-08-21 08:27:47 -04:00
Jason Tedor 8fca951be0 Merge pull request #12901 from jasontedor/feature/12900
Accumulate validation errors when validating index templates
2015-08-21 08:08:50 -04:00
Jason Tedor 4a5040bb32 Accumulate validation errors when validating index templates
This commit changes the behavior when validating index templates to
accumulate all validation errors before reporting failure to the user.
This addresses a usability issue when creating index templates.

Closes #12900
2015-08-21 08:06:42 -04:00
Colin Goodheart-Smithe 38085cf90a Aggregation: Fix AggregationPath.subPath() to not throw ArrayStoreException
Aggregation.subPath() always threw an ArrayStoreException because we were trying to pass a List into System.arraycopy(). This change fixes that bug and adds a test to prevent regression
2015-08-21 12:50:05 +01:00
Simon Willnauer 71cbcea3c2 [TEST] Add discovery-multicast to PluginManagerIT 2015-08-21 13:46:25 +02:00
Ryan Ernst 2a726fe4a1 Internal: Remove SpawnModules
The last use case of spawn modules was for plugins. This change handles
plugin modules directly, and removes SpawnModules.

closes #12783
2015-08-21 04:01:50 -07:00
xuzha 2af6f3fbff Print field name when meet unexpected token.
closes #12391
2015-08-21 01:16:38 -07:00
Adrien Grand f3265095ab Never cache match_all queries.
This commit backports https://issues.apache.org/jira/browse/LUCENE-6748 to make
sure that we never cache trivial queries like MatchAllDocsQuery.
2015-08-21 09:31:53 +02:00
Ryan Ernst 16e5c7c21c Add multicast plugin to plugin manager official list of plugins
See #13027
2015-08-20 23:45:36 -07:00
Simon Willnauer 3fb2d8e448 Merge pull request #12947 from s1monw/expected_shard_size
Add `expectedShardSize` to ShardRouting and use it in path.data allocation
2015-08-21 08:34:38 +02:00
Ryan Ernst 703a4b3f40 Merge pull request #13027 from rjernst/cast_away_multicast
Move multicast discovery to a plugin
2015-08-20 23:21:12 -07:00
Simon Willnauer 3dd6c4ab80 Use constant to determin if expected size is available 2015-08-21 08:18:59 +02:00
Simon Willnauer d2507c4ac0 Add `expectedShardSize` to ShardRouting and use it in path.data allocation
Today we only guess how big the shard will be that we are allocating on a node.
Yet, we have this information on the master but it's not available on the data nodes
when we pick a data path for the shard. We use some rather simple heuristic based on
existing shard sizes on this node which might be complete bogus. This change adds
the expected shard size to the ShardRouting for RELOCATING and INITIALIZING shards
to be used on the actual node to find the best data path for the shard.

Closes #11271
2015-08-21 08:18:59 +02:00
Robert Muir a2507a8f1c test: fix and simplify logic 2015-08-21 02:06:34 -04:00
Robert Muir d0835715c2 Fix formatting of startup/configuration errors.
Try to strike a balance between usability and debuggability.
2MB stacktrace is not gonna work... we print message and find
"likely root cause" and identify it as such, limit it to 30 stack
frames, and filter out guice. When frames are truncated we identify
that too, and always inform the user full exception is available from
logs.

Closes #13029
2015-08-21 01:19:29 -04:00
Ryan Ernst d0f5ce58d8 Add multicast plugin to help and qa 2015-08-20 22:04:17 -07:00
Ryan Ernst 2b1e4acafe Remove logging message from testing 2015-08-20 17:08:44 -07:00
Ryan Ernst bcd58ad02f Merge branch 'master' into cast_away_multicast 2015-08-20 17:03:02 -07:00
Ryan Ernst 164efaecbe Networking: Move multicast discovery to a plugin
Multicast has known issues (see #12999 and #12993). This change moves
multicast into a plugin, and deprecates it in the docs.  It also allows
for plugging in multiple zen ping implementations.

closes #13019
2015-08-20 16:43:25 -07:00
Robert Muir bd539e7f98 simplify this 2015-08-20 18:56:26 -04:00
Robert Muir 7298be474d fix test failure 2015-08-20 17:31:06 -04:00
Robert Muir 478bf1c9ef Merge pull request #13026 from rmuir/too_noisy
Don't print lots of noise on IPv4 only hosts.
2015-08-20 17:11:40 -04:00
Simon Willnauer aea596241c Merge pull request #13020 from s1monw/issues/13014
Remove support for address resolving in InetSocketTransportAddress
2015-08-20 23:10:50 +02:00
Robert Muir 5beabdd0ec Don't print lots of noise on IPv4 only hosts.
If the machine doesn't support IPv6, or if the user disabled it
with -Djava.net.preferIPv4Stack, or if the user disabled it with
ES_USE_IPV4, we will still try to bind a socket to ::1 out of box,
and we will see lots of exceptions logged to the console.

It is harmless noise but not a great experience.
2015-08-20 17:05:30 -04:00
Simon Willnauer d9089d56aa Don't use networking in InternalTestClusterTests 2015-08-20 22:55:04 +02:00
Simon Willnauer c15d4c33b2 Add back private default ctor 2015-08-20 21:42:14 +02:00
Simon Willnauer 214d303e6a Remove support for address resolving in InetSocketTransportAddress
this commit removes all support for reverse host name resolving from
InetSocketTransportAddress. This class now only returns IP addresses.

Closes #13014
2015-08-20 20:57:26 +02:00
Robert Muir e2ab62596f Default to unicast discovery, with default host list of 127.0.0.1, [::1]
Fix unicast discovery to work when a host has multiple addresses.
Ban dangerous methods in java.net with forbidden APIs.
Fix ipv6 bugs and formatting of network addresses everywhere.

Closes #12999
Closes #12993

Squashed commit of the following:

commit 6c1aa001d091c5cf25212a53dc701fb704337f1e
Author: Robert Muir <rmuir@apache.org>
Date:   Thu Aug 20 14:25:43 2015 -0400

    Fix these to be correct with addresses just in case

commit 648215627e84abf58a71400e7dc9ae775efb71d6
Merge: d00561b 41d8fbe
Author: Robert Muir <rmuir@apache.org>
Date:   Thu Aug 20 13:23:09 2015 -0400

    Merge branch 'master' into unicast_all_the_way_down

commit d00561b76fd1aa5850699f7901f3dae3d4d402b7
Author: Simon Willnauer <simonw@apache.org>
Date:   Thu Aug 20 16:38:50 2015 +0200

    limit local ports to 5 in UnicastZenPing

commit e2e15c594006746cbe24432694294a71cc99deb8
Author: Robert Muir <rmuir@apache.org>
Date:   Thu Aug 20 10:32:47 2015 -0400

    fix port limiting

commit 10153cb7adadda81a1f482445e703836b65cf5e2
Author: Robert Muir <rmuir@apache.org>
Date:   Thu Aug 20 10:18:37 2015 -0400

    don't serialize scopeids: that's broken

commit 2aa63d43db2baec68a2e9bc227cfeb85dfeb4f83
Author: Simon Willnauer <simonw@apache.org>
Date:   Thu Aug 20 16:06:51 2015 +0200

    restore @Network

commit c840f1d1ef438826ae1ecfd5e45942a0e30dc9c0
Author: Simon Willnauer <simonw@apache.org>
Date:   Thu Aug 20 16:02:30 2015 +0200

     Use NetworkAddress.formatAddress where applicable in plugins

commit 374ce878852b35d626b7a29c8c4773545b0e9ddd
Author: Simon Willnauer <simonw@apache.org>
Date:   Thu Aug 20 15:34:06 2015 +0200

    Use NetworkAddress.formatAddress where applicable

commit e7a606d63f1bc43c1b62b6e17adf707c76d43a15
Author: Simon Willnauer <simonw@apache.org>
Date:   Thu Aug 20 10:17:57 2015 +0200

    Add @Multicast annotation to disable multicast tests by default.

    We only run multicast tests now when we explicitly state it. A working
    multicast env is required which is not always the case.

commit 2d7d2d0347179696ab41f71f048b13305014c85b
Author: Simon Willnauer <simonw@apache.org>
Date:   Thu Aug 20 09:51:28 2015 +0200

    Remove extra check for local mode in InternalTestCluster

commit dda59ac39aa136d4687b9274c2692cd77f8b8f66
Author: Simon Willnauer <simonw@apache.org>
Date:   Thu Aug 20 09:37:03 2015 +0200

    Handle node mode across entire test cluster

    We used static methods reading sys properties to define the node mode
    per cluster. this had lots of problems when tests couldn't cope with
    mixed or only local mode. Now we are passing it down to the cluster from the test
    which allows to @SuppressNetworkMode / @SupressLocalMode on the test to force
    consistent node configurations.

commit 058197b7a408318995c88ce7f6762e32348de0de
Author: Robert Muir <rmuir@apache.org>
Date:   Thu Aug 20 03:19:14 2015 -0400

    really ban InetSocketAddress's trappy method and break build and go to sleep, sorry

commit ac8779185aee1e17e6f5a81766290fdfc9c603ba
Author: Robert Muir <rmuir@apache.org>
Date:   Thu Aug 20 03:16:52 2015 -0400

    Ban methods that might surprisingly cause DNS lookups

commit e64fe3dff2b11503e5f2831eb9863d64f56c5538
Author: Robert Muir <rmuir@apache.org>
Date:   Thu Aug 20 02:59:05 2015 -0400

    Add unit test

commit f15434f20fb1a3691b1cc16028597d8fae937e05
Author: Robert Muir <rmuir@apache.org>
Date:   Thu Aug 20 02:39:02 2015 -0400

    fix ipv6 formatting bugs

commit 05c2c74098052c75fbb79ea1818a295ef2e03e30
Author: Robert Muir <rmuir@apache.org>
Date:   Thu Aug 20 02:12:05 2015 -0400

    format addresses correctly so I can actually read what comes out of our logs and stats apis

commit 4f9389dcf1e8925f23153c5eb271b4ce2294dbaf
Author: Robert Muir <rmuir@apache.org>
Date:   Wed Aug 19 21:26:52 2015 -0400

    ban dangerous methods in java.net

commit 6aacd4d9925f324903d1d099a6cf5f862aeaf677
Author: Robert Muir <rmuir@apache.org>
Date:   Wed Aug 19 20:59:24 2015 -0400

    ban lenient method

commit f466a842c60163d1f4554bdce8a4163edb534c2c
Author: Simon Willnauer <simonw@apache.org>
Date:   Thu Aug 20 00:29:00 2015 +0200

    fix tests to not mix local transport and zen unicast disco

commit 0de007a33b33fb68cf85cd86db4ca4f8ce10bbc9
Author: Simon Willnauer <simonw@apache.org>
Date:   Thu Aug 20 00:10:07 2015 +0200

    fix tests to not mix local transport and zen unicast disco

commit 539f6ca6e5137e0d496239adc8684688dedcc824
Author: Simon Willnauer <simonw@apache.org>
Date:   Thu Aug 20 00:02:01 2015 +0200

    fix tests to not mix local transport and zen unicast disco

commit 004c2881b25467f332acc8c9f9e92b1f0f9d314e
Author: Robert Muir <rmuir@apache.org>
Date:   Wed Aug 19 17:51:45 2015 -0400

    Fix multinode

commit 54113af325ce31571811c49fdaae89d5687be4ba
Author: Robert Muir <rmuir@apache.org>
Date:   Wed Aug 19 17:36:45 2015 -0400

    fix integration tests

commit 0156a77a56319d6b9737ec6a531992052e50bd59
Author: Simon Willnauer <simonw@apache.org>
Date:   Wed Aug 19 23:32:18 2015 +0200

    enable multicast in MulticastZenPingIT.java

commit 1791caa35da853ce0122485fa3fd4674c671ec6e
Author: Robert Muir <rmuir@apache.org>
Date:   Wed Aug 19 17:23:16 2015 -0400

    Fix constant

commit 22820b53e0b2dc9fd47145c2bc29ce912a8fd484
Author: Simon Willnauer <simonw@apache.org>
Date:   Wed Aug 19 22:59:09 2015 +0200

    give it some extra ids for local transport crazyness

commit b2138fafa94a8a085813fd48356df63e57ade5b3
Author: Simon Willnauer <simonw@apache.org>
Date:   Wed Aug 19 22:51:42 2015 +0200

    pass on local addresses from configured transport rather than hard code IP addresses

commit 1bf5de1f457b081e0ce262b57d2b55d39c434156
Author: Simon Willnauer <simonw@apache.org>
Date:   Wed Aug 19 22:04:31 2015 +0200

    fix PluggableTransportModuleIT.java to use local disco and detach port limit for node local disco

commit b6706eddfa04c43947c16551359ae98a463d34aa
Author: Robert Muir <rmuir@apache.org>
Date:   Wed Aug 19 14:16:03 2015 -0400

    Default to unicast discovery, with default host list of 127.0.0.1, [::1]
2015-08-20 14:26:40 -04:00
Adrien Grand 6fa258b8fa Deprecate the `scan` search type.
This commit deprecates the `scan` search type in favour of regular scroll
requests sorted by `_doc`.

Related to #12983
2015-08-20 12:47:23 +02:00
Adrien Grand 78c2f1063a Optimize sorted scroll when sorting by `_doc`.
This change means that we will be able to remove the `SCAN` search type in 3.0
and recommend users to use sorted scrolls instead.
2015-08-20 11:51:59 +02:00
Jason Tedor a0243200e0 Fix a documentation typo and a code comment typo to path.repo 2015-08-19 22:14:50 -04:00
Robert Muir 829b858c1d Merge pull request #12995 from rmuir/dedup_resolver_for_binding
Deduplicate addresses from resolver.
2015-08-19 16:17:45 -04:00
Martijn van Groningen f2f95ea115 Removed CachedDfSource and move the dfs logic into the ContextIndexSearcher 2015-08-19 20:25:41 +02:00
Christoph Büscher 0fc96ede69 Merge pull request #12886 from cbuescher/fix/12278
Make ValueParser.DateMath aware of timezone setting
2015-08-19 18:42:19 +02:00
Ryan Ernst 6520395c1c tweaks 2015-08-19 09:37:35 -07:00
Robert Muir ce120b9c71 Deduplicate addresses from resolver.
In some cases this may contain duplicates, although its a misconfiguration,
lets not bind to multiple ports. Its no problem for us to dedup, this code
doesn't need to be huper-duper fast since its used only for logic around bind/publish
2015-08-19 12:06:54 -04:00
Simon Willnauer 22ae0a161f Log all interfaces we try to bind before binding 2015-08-19 17:20:48 +02:00
Colin Goodheart-Smithe 88d482437a Aggregations: Throw error if cardinality aggregator has a sub aggregation
The cardinality aggregation is a metric aggregation and therefore cannot accept sub-aggregations. It was previously possible to create a rest request with a cardinality aggregation that had sub-aggregations. Now such a request will throw an error in the response.

Close #12988
2015-08-19 14:31:57 +01:00
Simon Willnauer ca28acc373 Merge pull request #12986 from s1monw/fix_host_resolving
Only resolve host if explicitly allowed.
2015-08-19 15:25:55 +02:00
Simon Willnauer e5134317be Merge pull request #12936 from s1monw/add_build_hash_to_headers
Add build short hash to the download manager headers to identify staging builds
2015-08-19 15:10:46 +02:00
Simon Willnauer bd56b0a79e Only resolve host if explicitly allowed.
We have some settings that prevent host name resolution which should
be repected by InetSocketTransportAddress#getHost() to only resolve if
allowed or desired.
2015-08-19 14:54:56 +02:00
Robert Muir bbf669506b Merge pull request #12979 from rmuir/ifconfig
Log network configuration at debug level
2015-08-19 07:14:01 -04:00
Christoph Büscher 8454d49552 Plugins: Add 'name' property to plugin descriptor file to determine plugin name
At the moment, when installing from an url, a user provides the plugin name on
the command line like:

* bin/plugin install [plugin-name] --url [url]

This can lead to problems when picking an already existing name from another
plugin, and can potentially overwrite plugins already installed with that name.

This, this PR introduces a mandatory `name` property to the plugin descriptor
file which replaces the name formerly provided by the user.

With the addition of the `name` property to the plugin descriptor file, the user
does not need to specify the plugin name any longer when installing from a file
or url. Because of this, all arguments to `plugin install` command are now
either treated as a symbolic name, a URL or a file without the need to specify
this with an explicit option.

The new syntax for `plugin install` is now:

bin/plugin install [name or url]

* downloads official plugin
bin/plugin install analysis-kuromoji

* downloads github plugin
bin/plugin install lmenezes/elasticsearch-kopf

* install from URL or file
bin/plugin install http://link.to/foo.zip
bin/plugin install file:/path/to/foo.zip

If the argument does not parse to a valid URL, it is assumed to be a name and the
download location is resolved like before. Regardless of the source location of
the plugin, it is extracted to a temporary directory and the `name` property from
the descriptor file is used to determine the final install location.

Relates to #12715
2015-08-19 12:13:01 +02:00
Jason Tedor 66b0e7a6e1 Merge pull request #12977 from jasontedor/fix/12873
Add millisecond parser for dynamic date fields mapped from "yyyy/MM/dd"
2015-08-19 05:30:24 -04:00
Simon Willnauer ddd6be1047 Merge pull request #12981 from s1monw/serialize_interrupted_exceptions
Add serialization support for InterruptedException
2015-08-19 11:26:49 +02:00
Simon Willnauer 828e31ce32 Add serialization support for InterruptedException
it's an important exception to serialize and we see it often in tests
etc. but then it's wrapped in NotSerializableExceptionWrapper which is
odd. This commit adds native support for this exception.
2015-08-19 10:01:58 +02:00
Boaz Leskes 43fae91ab9 Test: ClusterDiscoveryConfiguration.UnicastZen should allow for port ranges
The cluster configuration allows to setup a cluster for use with unicast discovery. This means that nodes have to have pre-calculated known addresses which can be used to poplulate the unicast hosts setting. Despite of repeated attempts to select unused ports, we still see test failures where the node can not bind to it's assigned port due to it already being in use (most on CentOS). This commit changes it to allow each node to have a pre-set mutual exclusive range of ports and add all those ports to the unicast hosts list. That's OK because we know the node will only bind to one of those.
2015-08-19 10:01:38 +02:00
Robert Muir fa70162178 Log network configuration at debug level 2015-08-19 01:26:36 -04:00
Ryan Ernst c151f2137a Internal: Remove all uses of ImmutableList
We are in the process of getting rid of guava, and this removes a major
use. The replacement is mostly Collections.emptyList(), Arrays.asList
and Collections.unmodifiableList. While it is questionable whether we
need the last one (as these are usually placed in final members), we can
continue to refactor later by removing unnecessary wrappings.
2015-08-18 21:32:51 -07:00
Jason Tedor 4c9327d983 Add millisecond parser for dynamic date fields mapped from "yyyy/MM/dd"
Dynamic date fields mapped from dates of the form "yyyy-MM-dd"
automatically receive the millisecond paresr epoch_millis as an
alternative parsing format. However, dynamic date fields mapped from
dates of the form "yyyy/MM/dd" do not. This is a bug since the migration
documentation currently specifies that a dynamically added date field,
by default, includes the epoch_millis format. This commit adds
epoch_millis as an alternative parser to dynamic date fields mapped from
dates of the form "yyyy/MM/dd".

Closes #12873
2015-08-18 22:30:43 -04:00
Robert Muir f7f7fecafb Improve console logging on startup exception
Today we show the exception twice: once by the logger and then again
by the JVM. This is too noisy, and easy to avoid.
2015-08-18 22:27:39 -04:00
Ryan Ernst 32a097382c Merge pull request #12952 from rjernst/construct_it_yourself
Simplify Plugin API for constructing modules
2015-08-18 14:28:48 -07:00
Ryan Ernst 54ae55662c Remove leftover class and fix compile issues from master merge 2015-08-18 14:28:03 -07:00
Simon Willnauer 32bb49e829 [TEST] Make it clear what address we try to bind 2015-08-18 23:17:43 +02:00
Ryan Ernst 7393068417 Merge branch 'master' into construct_it_yourself 2015-08-18 14:15:08 -07:00
Simon Willnauer 0ffd99cca3 Drop commons-lang dependency
commons-lang really is only used by some core classes to join strings or modiy arrays.
It's not worth carrying the dependency. This commit removes the dependency on commons-lang
entirely.
2015-08-18 22:59:31 +02:00
Robert Muir e07f039659 Workaround JDK bug 8034057
This causes a FileSystemException when trying to retrieve FileStore for a path,
and falsely returns false for Files.isWritable

Squashed commit of the following:

commit d2cc0d966f3bc94aa836b316a42b3c5724bc01ef
Author: Robert Muir <rmuir@apache.org>
Date:   Tue Aug 18 15:49:48 2015 -0400

    fixes for the non-bogus comments

commit 6e0a272f5f8ef7358654ded8ff4ffc31831fa5c7
Author: Robert Muir <rmuir@apache.org>
Date:   Tue Aug 18 15:30:43 2015 -0400

    Fix isWritable too

commit 2a8764ca118fc4c950bfc60d0b97de873e0e82ad
Author: Robert Muir <rmuir@apache.org>
Date:   Tue Aug 18 14:49:50 2015 -0400

    try to workaround filestore bug
2015-08-18 16:44:57 -04:00
Igor Motov 509edefb04 Improve stability of restoreIndexWithMissingShards test
Replaced awaitBusy with assertBusy and increased the timeout.
2015-08-18 14:27:24 -04:00
Ryan Ernst 2a57539a28 Tweak exception message 2015-08-18 10:35:37 -07:00
Ryan Ernst a0c41218ff Merge branch 'master' into no_more_toe_stepping 2015-08-18 10:34:29 -07:00
Ryan Ernst a3afe57792 Fix compile failure from bad merge after renaming of
ExtensionPoint.TypeExtensionPoint
2015-08-18 10:32:12 -07:00
Ryan Ernst c0444ccbc6 Merge branch 'master' into module_culling3 2015-08-18 10:16:40 -07:00
Ryan Ernst 4c5cfd02cc Add javadocs to repository types registry methods 2015-08-18 10:13:01 -07:00
Ryan Ernst c3a22e6f0e Merge branch 'master' into construct_it_yourself 2015-08-18 09:50:47 -07:00
Ryan Ernst e61c5ce5c3 Fix naming problem with test plugin 2015-08-18 09:49:58 -07:00
Simon Willnauer 60f273c891 Suppress forbiddenAPI in logger when using localhost 2015-08-18 17:32:20 +02:00
Simon Willnauer 1e511eda28 Remove usage or `InetAddress#getLocalHost`
this method is very confusing and if it's used it's likely the wrong thing
with respect to the actual bound / published address. This change discourages
it's use and removes all useage. It's replaced with the actual published address
most of the time.
2015-08-18 16:48:34 +02:00
David Pilato 20851a4e4a Merge branch 'pr/shorten-artifactids' 2015-08-18 15:25:38 +02:00
javanna 501a1996a3 Query DSL: remove attemped (not working) support for array in not query parser
Closes #12890
2015-08-18 14:58:53 +02:00
javanna 8e93ac5d5c Java api: remove execution from TermsQueryBuilder as it has no effect
Also introduced ParseField for execution in TermsQueryParser so proper deprecation warnings get printed out when requested.

Closes #12884
2015-08-18 14:57:33 +02:00
David Pilato 692cc80523 [maven] also rename parent project artifactId
Also fixed bad scm links
2015-08-18 13:41:12 +02:00
David Pilato e19090b2ad [plugin] shorten plugin names
We can now simplify PluginHandle as `name` and `repo` are the same thing.
2015-08-18 13:41:12 +02:00
David Pilato 33e8fae824 [plugin] shorten plugin names
We don't need to prefix anymore plugin names with `elasticsearch-` or `es-`.
2015-08-18 13:41:12 +02:00
David Pilato 2c902a4d2f [maven] rename Elasticsearch names to Elasticsearch: 2015-08-18 13:38:49 +02:00
David Pilato 0bb9593596 Fix a typo in comment 2015-08-18 13:38:48 +02:00
javanna 3f04ee076e Internal: IndicesQueriesRegitry back to being created only once
With #12921 we refactored IndicesModule but we forgot to make sure we create IndicesQueriesRegistry once. IndicesQueriesModule used to do `bind(IndicesQueriesRegistry.class).asEagerSingleton();` otherwise we get multiple instances of the registry. This needs to be ported do the IndicesModule.
2015-08-18 13:04:30 +02:00
Martijn van Groningen e74f559fd4 parent/child: Explicitly disabled the query cache
It was already disabled, but during tests the test framework enabled the query cache by setting the static default query cache. The caching behaviour should be the same in production and in tests.
2015-08-18 12:56:37 +02:00
Adrien Grand c169386dd4 Merge pull request #12931 from jpountz/fix/murmur3_defaults
Move the `murmur3` field to a plugin and fix defaults.
2015-08-18 12:09:32 +02:00
Ryan Ernst dc1fa6736a Merged AbstractPlugin and Plugin. Also added Settings back to
indexModules and shardModules
2015-08-18 02:46:32 -07:00
Adrien Grand a91b3fcbb9 Move the `murmur3` field to a plugin and fix defaults.
This move the `murmur3` field to the `mapper-murmur3` plugin and fixes its
defaults so that values will not be indexed by default, as the only purpose
of this field is to speed up `cardinality` aggregations on high-cardinality
string fields, which only requires doc values.

I also removed the `rehash` option from the `cardinality` aggregation as it
doesn't bring much value (rehashing is cheap) and allowed to remove the
coupling between the `cardinality` aggregation and the `murmur3` field.

Close #12874
2015-08-18 11:41:52 +02:00
Martijn van Groningen 2b97f5d9eb Pass down the EngineConfig to IndexSearcherWrapper
If a new IndexSearcher gets created the engine config can be used to get the query cache and query cache policy from.
2015-08-18 10:41:24 +02:00
Ryan Ernst 2bf84593e0 Plugins: Simplify Plugin API for constructing modules
The Plugin interface currently contains 6 different methods for
adding modules. Elasticsearch has 3 different levels of injectors,
and for each of those, there are two methods. The first takes no
arguments and returns a collection of class objects to construct. The
second takes a Settings object and returns a collection of module
objects already constructed. The settings argument is unecessary because
the plugin can already get the settings from its constructor. Removing
that, the only difference between the two versions is returning an
already constructed Module, or a module Class, and there is no reason
the plugin can't construct all their modules themselves.

This change reduces the plugin api down to just 3 methods for adding
modules. Each returns a Collection<Module>. It also removes the
processModule method, which was unnecessary since onModule
implementations fullfill the same requirement. And finally, it renames
the modules() method to nodeModules() so it is clear these are created
once for each node.
2015-08-17 20:41:45 -07:00
Robert Muir 34635a4b4f Merge pull request #12951 from rmuir/more_networking_cleanup
Use preferIPv6Addresses for sort order, not preferIPv4Stack
2015-08-17 23:30:35 -04:00
Robert Muir 3ca12889e5 Use preferIPv6Addresses for sort order, not preferIPv4Stack
java.net.preferIPv6Addresses is a better choice. preferIPv4Stack is a nuclear option
and you just won't even bind to any IPv6 addresses. This reduces confusion.
2015-08-17 22:52:22 -04:00
Igor Motov 4114a8359d Improve stability of Snapshot/Restore test
The restore portion of some snapshot/restore test is failing randomly due to #9421. This change suspends rebalance during snapshot/restore operations until #9421 is fixed.

Closes #12855
2015-08-17 21:30:46 -04:00
Ryan Ernst 2e90be77ff Plugins: Ensure additionalSettings() do not conflict
Plugins can preovide additional settings to be added to the settings
provided in elasticsearch.yml. However, if two different plugins supply
the same setting key, the last one to be loaded wins, which is
indeterminate. This change enforces plugins cannot have conflicting
settings, at startup time. As a followup, we should do this when
installing plugins as well, to give earlier errors when two plugins
collide.
2015-08-17 17:01:00 -07:00
Ryan Ernst 6f124e6eec Internal: Simplify custom repository type setup
Custom repository types are registered through the RepositoriesModule.
Later, when a specific repository type is used, the RespositoryModule
is installed, which in turn would spawn the module that was
registered for that repository type. However, a module is not needed
here. Each repository type has two associated classes, a Repository and
an IndexShardRepository.

This change makes the registration method for custom repository
types take both of these classes, instead of a module.

See #12783.
2015-08-17 15:08:08 -07:00
Nicholas Knize ee227efc62 move integration test dependency file gzippedmap.gz from sources to resources 2015-08-17 16:49:25 -05:00
Simon Willnauer 8624022222 Print es.node.mode if integration tests fail 2015-08-17 22:50:54 +02:00
Nicholas Knize b2ba3847f7 Refactor geo_point validate* and normalize* options to ignore_malformed and coerce*
For consistency geo_point mapper's validate and normalize options are converted to ignore_malformed and coerced
2015-08-17 14:46:23 -05:00
Robert Muir 68307aa9f3 Fix network binding for ipv4/ipv6
When elasticsearch is configured by interface (or default: loopback interfaces),
bind to all addresses on the interface rather than an arbitrary one.

If the publish address is not specified, default it from the bound addresses
based on the following sort ordering:

* ipv4/ipv6 (java.net.preferIPv4Stack, defaults to true)
* ordinary addresses
* site-local addresses
* link local addresses
* loopback addresses

One one address is published, and multicast is still always over ipv4: these
need to be future improvements.

Closes #12906
Closes #12915

Squashed commit of the following:

commit 7e60833312f329a5749f9a256b9c1331a956d98f
Author: Robert Muir <rmuir@apache.org>
Date:   Mon Aug 17 14:45:33 2015 -0400

    fix java 7 compilation oops

commit c7b9f3a42058beb061b05c6dd67fd91477fd258a
Author: Robert Muir <rmuir@apache.org>
Date:   Mon Aug 17 14:24:16 2015 -0400

    Cleanup/fix logic around custom resolvers

commit bd7065f1936e14a29c9eb8fe4ecab0ce512ac08e
Author: Robert Muir <rmuir@apache.org>
Date:   Mon Aug 17 13:29:42 2015 -0400

    Add some unit tests for utility methods

commit 0faf71cb0ee9a45462d58af3d1bf214e8a79347c
Author: Robert Muir <rmuir@apache.org>
Date:   Mon Aug 17 12:11:48 2015 -0400

    localhost all the way down

commit e198bb2bc0d1673288b96e07e6e6ad842179978c
Merge: b55d092 b93a75f
Author: Robert Muir <rmuir@apache.org>
Date:   Mon Aug 17 12:05:02 2015 -0400

    Merge branch 'master' into network_cleanup

commit b55d092811d7832bae579c5586e171e9cc1ebe9d
Author: Robert Muir <rmuir@apache.org>
Date:   Mon Aug 17 12:03:03 2015 -0400

    fix docs, fix another bug in multicast (publish host = bad here!)

commit 88c462eb302b30a82585f95413927a5cbb7d54c4
Author: Robert Muir <rmuir@apache.org>
Date:   Mon Aug 17 11:50:49 2015 -0400

    remove nocommit

commit 89547d7b10d68b23d7f24362e1f4782f5e1ca03c
Author: Robert Muir <rmuir@apache.org>
Date:   Mon Aug 17 11:49:35 2015 -0400

    fix http too

commit 9b9413aca8a3f6397b5031831f910791b685e5be
Author: Robert Muir <rmuir@apache.org>
Date:   Mon Aug 17 11:06:02 2015 -0400

    Fix transport / interface code

    Next up: multicast and then http
2015-08-17 15:43:07 -04:00
Ryan Ernst 75ced057ed Fix changed class name after bad merge, see #12921 2015-08-17 12:14:01 -07:00
Ryan Ernst 52f3eb5898 Merge pull request #12921 from rjernst/module_culling2
Flatten IndicesModule and add tests
2015-08-17 12:08:17 -07:00
Nik Everett 4307e165c1 Tests: Make a test less flakey
EsExecutorsTests had a test that was failing spuriously due to threadpools
being threadpools. This weakens the assertions that the test makes to what
should always be true.
2015-08-17 08:20:18 -07:00
Simon Willnauer ea03e5dd17 Add build short hash to the download manager headers to identify staging builds
It might turn out to be useful to have the actual commit hash of the version we are
looking for if our download manager can just redirect to the right staging repository.
2015-08-17 15:17:45 +02:00
Tanguy Leroux 8e052f0da2 Make platform specific assumptions in OS & Process probes tests 2015-08-17 14:47:23 +02:00
Boaz Leskes e424701819 Merge pull request #12922 from xuzha/xu-network
Refactor, remove _node/network and _node/stats/network. 

Closes #12889 , Closes #12922
2015-08-17 14:46:05 +02:00
Boaz Leskes bb34b2fd85 Elasticsearch bootstrap help shouldn't mention plugins
We have a dedicated entry point for that.

Closes #12933
2015-08-17 14:36:13 +02:00
Boaz Leskes 6c4ef32160 Test: un-mute PluginManagerUnitTests.testSimplifiedNaming 2015-08-17 14:14:50 +02:00
Simon Willnauer 9608fe9dff Fix test - and don't use URL.equals() 2015-08-17 14:14:23 +02:00
Boaz Leskes cd9552eb07 Test: mute PluginManagerUnitTests.testSimplifiedNaming 2015-08-17 14:02:09 +02:00
Martijn van Groningen e649d96eb1 Merge pull request #12881 from martijnvg/allow_for_customable_query_cache
Allow a plugin to supply its own query cache implementation
2015-08-17 11:13:45 +02:00
Martijn van Groningen 5123167a99 test: added a unit test for #12261 2015-08-17 11:10:05 +02:00
Simon Willnauer e7d075f6ae Add elasticsearch version as a prefix for the staging URL
This is purely for maintainance reasons since it easier to see if we can drop
certain stageing urls if we have the version next to the hash.
I also removed the gpg passphrase from the example URL since it's better to get prompted?
2015-08-17 11:05:49 +02:00
Simon Willnauer 59f390f5d0 Endless recovery loop with `indices.recovery.file_chunk_size=0Bytes`
This is caused by sending the same file to the chunk handler with offset
`0` which in-turn opens a new outputstream and waits for bytes. But the next round
will send 0 bytes again with offset 0. This commit adds some checks / validators that those
settings are positive byte values and fixes the RecoveryStatus to throw an IAE if the same file
is opened twice.
2015-08-17 09:58:17 +02:00
Martijn van Groningen 12c40fa58a Allow plugins to register custom `QueryCache` implementations. 2015-08-17 09:55:32 +02:00
Adrien Grand 7765b0497d Merge pull request #12497 from oyiadom/master
Update BulkProcessor.java
2015-08-17 09:43:41 +02:00
Adrien Grand 1f2345db34 Merge pull request #12913 from xuzha/xu-exception
Validate class before cast.
2015-08-17 09:38:59 +02:00
Harish Kayarohanam 3976854ada Improve error handling of ClassCastException in terms aggregations.
What is the problem we are trying to solve ?
===========================================

When we are doing aggregations against a field name as shown in
https://github.com/HarishAtGitHub/elasticsearch-tester/blob/master/12135.py#L37-L46

search = {
           "aggs": {
             "NAME": {
               "terms": {
                 "field": "ip_str",
                 "size": 10
               }
             }
           }
         }
and when the field "ip_str" has values of different types in different indices
. say one is of type StringTerms type and other is of IP(LongTerms type) then
the aggregation fails as the types do not match(incompatible).
The failure throws a class cast exception as follows:
{
   "error": {
      "root_cause": [],
      "type": "reduce_search_phase_exception",
      "reason": "[reduce] ",
      "phase": "query",
      "grouped": true,
      "failed_shards": [],
      "caused_by": {
         "type": "class_cast_exception",
         "reason": "org.elasticsearch.search.aggregations.bucket.terms.LongTerms$Bucket cannot be cast to org.elasticsearch.search.aggregations.bucket.terms.StringTerms$Bucket"
      }
   },
   "status": 503
}

which is hard to understand . User cannot infer anything about the cause of the problem and what he should do from seeing the
class cast exception.

What can be the possible solution ?
===================================

Make the exception more readable by showing him the root cause of the problem so that he can
understand which area actually caused the problem, so that he can take necessary steps further.

Code Analysis
=============

Debugging code shows that:
the query /{indices}/_search?search_type=count involves two phases
1) search phase
***************
     searchService.sendExecuteQuery(...) [Ref: TransportSearchCountAction]

     what happens here ?
        the phase 1, which is the search phase goes without error.
        In this phase the shards for the given indexes are collected and the search is done on all asynchronously
        and finally collected in the variable "firstResults" and given to meger phase.

        [Flow: .... -> TransportSearchTypeAction -> method performFirstPhase]

2) merge phase
**************
     searchPhaseController.merge(...firstResults...) [Ref: TransportSearchCountAction]

     what happens here ?
        the "firstresults" QuerySearchResults are now to be aggregated and combined.

        [Flow: SearchPhaseController.merge(...) -> ..... -> InternalTerms.doReduce(...)]

the phase 1, which is the search phase goes without error.
The problem comes in phase 2, which is merge phase.
Now the individual term buckets are available.
As per the test case , there are two indices cast and cast2, so by default 10 shards.
cast has ip_str of type StringTerms
cast2 has ip_str of type ip which is actually LongTerms

so here two types of Buckets exist. StringTerms_Bucket and LongTerms_Bucket.
Now the aggregation is to be put inside the BucketPriorityQueue(size 2: as out of 10, 2 has hits) finally.
(docs of PriorityQueue: https://lucene.apache.org/core/4_4_0/core/org/apache/lucene/util/PriorityQueue.html#insertWithOverflow(T))

Now first the LongTerms$Bucket is put inside.
then the StringTerms$Bucket is to be put in.
This is the area where exception is thrown. What happens is when adding the StringTerms$Bucket now it has to
goes through the code "lessThan(element, heap[1])"
which finally calls

---------------------------------------------------------------------------------------------
|      StringTerms$Bucket.compareTerms(other)  <---------------- Area of exception          |
|                                                                                           |
--------------------------------------------------------------------------------------------

where when comparing one to other a type cast is done and it fails as StringTerms$Bucket and LongTerms$Bucket are
incompatible.

Approach to solve:
==================

The best way is to make user understand that the problem is when reducing/merging/aggregating the buckets which came as a result of
querying different shards, so that this will make them infer that the problem is because the values of the fields are of different types.
The message is also user friendly and much better than the indecipherable classcastexception.

The only place to infer correctly that the aggregation has failed is in the place where aggregations take place.
so

at InternalTerms.java -> (BucketPriorityQueue)ordered.insertWithOverflow(b);

so here I can throw AggregationExecutionException saying it is because the buckets are of different
types.

But when can I infer at this point that the failure is due to mismatch of types of buckets ???
it can be possible only if at this point it is informed that the problem which occurred deep inside
is due to buckets that were incomparable.
so from just a classCastException we cannot make such a pointed exact inference, because
as class cast exception can be due to a number of scenarios and at a number of places.

so unless we inform the exact problem to InternalTerms it will not be able to infer properly.
so infer the classCastException at the compareTerms function itself that it is a IncomparableTermBucktesTypeException.
This is the best place to infer classCastException as this the place which generated the exception.
Best inference of exceptions can be done only at the source/origin of the exception.

so IncomparableTermBucktesTypeException to InternalTerms-> will make it infer and conclude on why
aggregation failed and give best information to user.

Close #12821
2015-08-17 09:35:32 +02:00
xuzha 7624ae4f96 There is no longer a network section in the nodes info and stats
requests. Remove _node/network and _node/stats/network

closes #12889
2015-08-16 19:34:04 -07:00
Ryan Ernst 2450e3ccc8 Internal: Flatten IndicesModule and add tests
The IndicesModule was made up of two submodules, one which
handled registering queries, and the other for registering
hunspell dictionaries. This change moves those into
IndicesModule. It also adds a new extension point type,
InstanceMap. This is simply a Map<K,V>, where K and V are
actual objects, not classes like most other extension points.
I also added a test method to help testing instance map extensions.
This was particularly painful because of how guice binds the key
and value as separate bindings, and then reconstitutes them
into a Map at injection time. In order to gain access to the
object which links the key and value, I had to tweak our
guice copy to not use an anonymous inner class for the Provider.

Note that I also renamed the existing extension point types, since
they were very redundant. For example, ExtensionPoint.MapExtensionPoint
is now ExtensionPoint.ClassMap.

See #12783.
2015-08-16 17:56:35 -07:00
Martijn van Groningen 532806af1a inner hits: Use provided StreamContext instead of fetching a new one.
Closes #12905
2015-08-16 23:39:31 +02:00
Ryan Ernst 9974b79c8a Merge pull request #12916 from rjernst/module_culling
Flatten ClusterModule and add more tests
2015-08-16 10:08:40 -07:00
Simon Willnauer 5ab0833990 Don't swallow cause if Store stats can't be build 2015-08-16 16:36:22 +02:00
Simon Willnauer 5699492575 Merge pull request #12917 from HarishAtGitHub/refactorprocessFirstPhase
Refactor - shard variable dependency from processFirstPhaseResults as shard is no more needed
2015-08-16 16:21:13 +02:00
Simon Willnauer 606f5b368b mute the entire InnerHitsIT - Relates to #12905 2015-08-16 16:08:32 +02:00
Harish Kayarohanam 8122243ee7 this is a small commit to remove the
shard variable dependency from processFirstPhaseResults as shard is no more
needed here . it only deals with the results obtained from the synchronous search on each shard.
2015-08-16 17:10:25 +05:30
Ryan Ernst 008dc8ec31 Internal: Flatten ClusterModule and add more tests
The ClusterModule contained a couple submodules. This moves the
functionality from those modules into ClusterModule. Two of those
had to do with DynamicSettings. This change also cleans up
how DynamicSettings are built, and enforces they are added, with
validators, in ClusterModule.

See #12783.
2015-08-16 01:23:05 -07:00
xuzha 062e038360 Throw IllegalArgumentException instead of ClassCastException,
Let stats aggregation returns 400 error when performed over an invalid field

closes #12842
2015-08-15 15:42:03 -07:00
Simon Willnauer 20f6b41337 Mute InnerHitsIT Relates to #12905 2015-08-15 08:41:28 +02:00
Simon Willnauer b447e2ae99 Move master to [2.1.0-SNAPSHOT] 2015-08-14 23:44:06 +02:00
Jason Tedor 6292bc07f9 Merge pull request #12892 from jasontedor/fix/12865
Validate settings specified in index templates at template creation time
2015-08-14 15:43:16 -06:00
Jason Tedor b88d2f6255 Validate settings specified in index templates at template creation time
Previously settings specified in index templates were not validated upon
template creation. Creating an index from an index template with invalid
settings could lead to cluster stability issues because creation of such
indexes would bypass index settings validation.

This commit adds validation of settings specified in index templates at
template creation time. This works by routing the index template
settings through the index settings validation mechanism.

Closes #12865
2015-08-14 15:23:10 -06:00
Ryan Ernst 33690b990a Merge pull request #12872 from rjernst/resolve_your_own_config
Remove Environment.resolveConfig
2015-08-14 13:56:32 -07:00
Simon Willnauer 03ceabb1da Merge pull request #12894 from s1monw/fix_repro_line
Fix reproduction line to include project filters
2015-08-14 22:52:55 +02:00
Lee Hinman 6f5a25d98e [DOC] Use 127.0.0.1 instead of localhost in READMEs
Users with IPv6 preferred over IPv4 may have `localhost` resolve to
`::1` instead of `127.0.0.1`, so we should be explicit so they don't run
into issues.
2015-08-14 14:47:58 -06:00
Martijn van Groningen 942d040f45 inner hits: Reset the `ShardTargetType` after serializing inner hits.
This fixes a bug where only the first top level search hit has a shard target and any subsequent search hits don't.
2015-08-14 22:38:12 +02:00
Lee Hinman 1b9877bb65 Use Java 7 version of Files.readAllLines instead of Java 8 version 2015-08-14 14:36:17 -06:00
Lee Hinman d35a3a37eb Also catch NoSuchFileException 2015-08-14 13:54:14 -06:00
Lee Hinman 33f118e9c8 Print out the name of the sum that failed 2015-08-14 13:51:47 -06:00
Simon Willnauer bba34de6b3 Fix reproduction line to include project filters
Today on a failure the reproduce line printed out by the test framework
will build all projects and might fail if the test class is not present.
This commit adds a reactor filter to the reproduction line to ensure
unrelated projects are skipped.

Closes #12838
2015-08-14 21:36:49 +02:00
Ryan Ernst 867f056cf6 Simplify random name index and move method to its only user 2015-08-14 11:22:20 -07:00
Christoph Büscher 407781e76a Adding comments to test 2015-08-14 18:42:45 +02:00