Commit Graph

4000 Commits

Author SHA1 Message Date
Boaz Leskes b224cc8898 Node.stop() should stop Discovery
It used to do so through the DiscoveryService but that was removed in #16821 , but I forgot to add an explicit discovery stop
2016-03-01 12:51:38 +01:00
javanna b7597d7aea Rename SearchServiceTransportAction to SearchTransportService
The suffix TransportAction is misleading as it may make think that it extends TransportAction, but it does not. This class makes accessible the different search operations exposed by SearchService through the transport layer. Also resolved few compiler warnings in the class itself.
2016-03-01 11:35:04 +01:00
Nik Everett 95cc3e38fc Check test naming conventions on all modules
The big win here is catching tests that are incorrectly named and will
be skipped by gradle, providing a false sense of security.

The whole thing takes about 10 seconds on my Macbook Air, not counting
compiling the test classes, which seems worth it. Because this runs as
a gradle task with propery UP-TO-DATE handling it can be skipped if the
tests haven't been changed which should save some time.

I chose to keep this in test:framework rather than a new subproject of
buildSrc because ESIntegTestCase and doesn't inroduce any additional
dependencies.
2016-02-29 16:31:49 -05:00
Boaz Leskes 195b43d66e Remove DiscoveryService and reduce guice to just Discovery #16821
DiscoveryService was a bridge into the discovery universe. This is unneeded and we can just access discovery directly or do things in a different way.

One of those different ways, is not having a dedicated discovery implementation for each our dicovery plugins but rather reuse ZenDiscovery.

UnicastHostProviders are now classified by discovery type, removing unneeded checks on plugins.

Closes #16821
2016-02-29 20:23:38 +01:00
Nik Everett e17d8bda93 Make excuses for SearchSourceBuilder.parseXContent
Its useful when you need to have defaults that don't match
SearchSourceBuilder's defaults. You build your SearchSourceBuilder, set the
defaults, and then layer the XContent on top of that.
2016-02-29 13:50:46 -05:00
Nik Everett e9ce61910f Remove reindex from plugins list
It isn't a plugin any more - it is a module.
2016-02-29 10:18:26 -05:00
Nik Everett 356b7cd12b Merge reindex to master because it is ready! 2016-02-29 10:08:29 -05:00
Nik Everett d587a74533 Fix reindex to work with master branch
Stuff changed, reindex's got to change.
2016-02-29 10:04:16 -05:00
Luca Cavanna 6c76ac3e37 Merge pull request #16758 from javanna/enhancement/remove_action_search_type_package
Cleanup search sub transport actions and collapse o.e.action.search.type package into o.e.action.search
2016-02-29 14:52:08 +01:00
javanna 9738ef3a90 Cleanup search sub transport actions and collapse o.e.action.search.type package into o.e.action.search
TransportSearchTypeAction and subclasses are not actually transport actions, but just support classes useful for their inner async actions that can easily be extracted out so that we get rid of one too many level of abstraction.

Same pattern can be applied to TransportSearchScrollQueryAndFetchAction & TransportSearchScrollQueryThenFetchAction which we could remove in favour of keeping only their inner classes named SearchScrollQueryAndFetchAsyncAction and SearchScrollQueryThenFetchAsyncAction.

Remove org.elasticsearch.action.search.type package, collapsed remaining classes into existing org.elasticsearch.action.search package

Make also ParsedScrollId ScrollIdForNode and TransportSearchHelper classes and their methods package private.

Closes #11710
2016-02-29 14:11:18 +01:00
Yannick Welsch d76161d51a Write shard state metadata as soon as shard is created / initializing
As we rely on active allocation ids persisted in the cluster state to select
the primary shard copy, we can write shard state metadata on the allocated node
as soon as the node knows about receiving this shard. This also ensures that
in case of primary relocation, when the relocation target is marked as started
by the master node, the shard state metadata with the correct allocation id has
already been written on the relocation target. Before this change, shard state
metadata was only written once the node knows it is marked as started. In case
of failures between master marking the node as started and the node
receiving and processing this event, the relation between the shard copy on disk
and the cluster state could get lost. This means that manual allocation of
the shard using the reroute command allocate_stale_primary was necessary.

Closes #16625
2016-02-29 13:43:58 +01:00
Boaz Leskes c5a290550f Fix exception assertions in MetaDataStateFormatTests.testLoadState (again) 2016-02-29 12:11:10 +01:00
Boaz Leskes e5e21480d4 Fix exception assertions in MetaDataStateFormatTests.testLoadState
Got broken with the change in #16850
2016-02-29 12:03:48 +01:00
Boaz Leskes 4602d8c0dc Added file name to exceptions when failing to read index state #16850
Closes #16713
Closes #16850
2016-02-29 11:42:53 +01:00
Igor Motov 863fab4007 Add start time and duration to tasks
Tasks now contain timestamps indicating when the tasks were created and current run time
2016-02-27 18:41:51 -05:00
Luca Cavanna 0aba19f4fa Merge pull request #16675 from javanna/enhancement/bulk_delete_routing_required
Bulk api: fail deletes when routing is required but not specified
2016-02-27 19:03:33 +01:00
Boaz Leskes 4ecbce1568 Disable testEnforceMaxFileDescriptorLimits for now
See #16835
2016-02-27 18:56:21 +01:00
javanna ba40c5bc9a Excpetion => Exception 2016-02-27 18:35:32 +01:00
javanna 5ff702b212 [TEST] remove needless index operation in SimpleRoutingIT 2016-02-27 18:35:32 +01:00
javanna 65f5cbe568 remove boolean return type from resolveRequest and needless listener arg 2016-02-27 18:35:32 +01:00
javanna 0fe73b51f9 Bulk api: fail deletes when routing is required but not specified
As part of #10136 we removed the transport action for broadcast deletes in case routing is required but not specified. Bulk api worked differently though and kept on doing the broadcast delete internally in that case. This commit makes sure that delete items are marked as failed in such cases. Also the check has been moved up in the code together with the existing check for the update api, and we now make sure that the exception is the same as the one thrown for single document apis (delete/update).

Note that the failure for the update api contained the wrong optype (the type of the document rather than "update"), that's been fixed too and tested.

Closes #16645
2016-02-27 18:35:31 +01:00
Yannick Welsch af918ebf2b Upgrade groovy dependency in lang-groovy module to version 2.4.6
Closes #16830
2016-02-27 17:41:15 +01:00
Jason Tedor f871b9bba2 Disable production limits on snapshot builds
This commit disables the production limits checks on snapshot
builds. This is at a minimum short-term relief for developers that do in
fact bind to external network interfaces, and is possibly a long-term
fix as well. The situation with using the JVM flag MaxFDLimit is far too
complicated.

Closes #16835
2016-02-26 19:55:10 -05:00
Ryan Ernst 9c259aca41 Core: Remove log4j exception hiding
At some time in the distant past, Bootstrap could be used by those
embedding elasticsearch. However, it is no longer allowed (now package
private), and so any errors (for example, log4j missing, or any other
exception while initializing) should be exposed directly and cause
elasticsearch to fail to start. This change removes hiding of logging
initialization exceptions.
2016-02-26 14:52:53 -08:00
Nik Everett c38119bae9 Merge branch 'master' into feature/reindex 2016-02-26 16:59:54 -05:00
Nik Everett ba5be0332d Remove optional logger wrappers
Removes all our logger wrappers except the wrapper for log4j1.2. If you
depend on Elasticsearch's jar in your application you'll need to declare
log4j 1.2 and/or some bridge to your favorite logger.

We did this to simplify our builds and code. No more commons-logging like
log implementation sniffing. No more optional dependency hacks in gradle.

We might one day want to use j.u.l instead of log4j. If we do want that
we can recover its wrapper by studying this commit. We didn't go directly
to j.u.l in this commit because that is a bigger change. Our logging
configuration is based on log4j1.2 and people are used to it. So it'd
be a much more fraught breaking change to do that conversion.
2016-02-26 16:41:07 -05:00
Nik Everett e3aba38bac Javadoc for common.io.stream
Adds some javadoc to Streamable, Writeable, and friends.
2016-02-26 16:28:44 -05:00
Lee Hinman 5d359f737f Merge branch 'pr/16801' 2016-02-26 13:22:14 -07:00
Adrien Grand 28b0965cc6 Remove `optimize_single_shard` settings. #15978
This optimization has existed for years with no complaints, I suggest that we
remove the settings that allow to disable it.
2016-02-26 14:30:28 +01:00
jaymode 5963f276f3 Settings with complex matchers should not overlap
It is possible to register multiple settings with complex matchers that could both match
a given key. The behavior when this occurs can lead to issues and depends on the
number of settings that have been registered. In order to identify the setting for a given
key, we iterate over the values in a map to find the first setting that matches the given key
and iteration order of a map should not be relied upon.

This commit checks complex settings when adding them and if the keys for these overlap,
an IllegalArgumentException is now thrown.
2016-02-26 06:31:37 -05:00
Daniel Mitterdorfer 9e473c98c6 Merge branch 'pr/16649'
This PR fixes a bunch of typos across the code base.
2016-02-26 11:31:45 +01:00
Jason Tedor d94e391e71 Use System#lineSeparator and not system property
This commit replaces a use of the system property "line.separator" and
replaces it with a dedicated method that provides the same value.

Closes #16776
2016-02-25 12:22:57 -05:00
Nik Everett 7c4420bf3d Merge pull request #16807 from nik9000/not_mvn
Remove mention of mvn from java source files
2016-02-25 11:05:46 -05:00
Nik Everett 74754952db Remove mention of mvn from RestIT and Security 2016-02-24 19:43:56 -08:00
James Bertouch cb35455745 Upgrade to Jackson 2.7.0
Closes #16294
2016-02-24 18:06:38 -05:00
Igor Motov d6af669776 Combine node name and task id into single string task id
This commit changes the URL for task operations from `/_tasks/{nodeId}/{taskId}` to `/_tasks/{taskId}`, where `{taskId}` has a form of nodeid:id
2016-02-24 12:44:12 -08:00
Jason Tedor 7140d184ab Fix IntelliJ query builder type inference issues
Relates #15429
2016-02-24 02:23:16 -08:00
Boaz Leskes 5a91ad1115 Only accept transport requests after node is fully initialized #16746
We should open up the node to the world when it's as ready as possiblAt the moment we open up the transport service before the local node has been fully initialized. This causes bug as some data structures are not fully initialized yet. See for example #16723.

Sadly, we can't just start the TransportService last (as we do with the HTTP server) because the ClusterService needs to know the bound published network address for the local DiscoveryNode. This address can only be determined by actually binding (people may use, for example, port 0). Instead we start the TransportService as late as possible but block any incoming requests until the node has completed initialization.

A couple of other cleanup during start time:
1) The gateway service now starts before the initial cluster join so we can simplify the logic to recover state if the local node has become master.
2) The discovery is started before the transport service accepts requests, but we only start the join process later using a dedicated method.

Closes #16723
Closes #16746
2016-02-23 17:58:28 -08:00
Jason Tedor c978335968 Remove es.useLinkedTransferQueue
This commit removes the system property "es.useLinkedTransferQueue" that
defaulted to false and was used to control the queue implementation used
in a few places.

Closes #16786
2016-02-23 17:29:15 -08:00
Jason Tedor bd5c7f0889 Inline TimeValue#parseTimeValue
Relates #16725
2016-02-23 16:33:16 -08:00
Jason Tedor 7101ecea94 Inline ReplicationPhase#<init>
Relates #16725
2016-02-23 16:33:14 -08:00
Jason Tedor 7a7f6055dc Inline InternalEngine#innerIndex
Relates #16725
2016-02-23 16:33:12 -08:00
Jason Tedor 7273948188 Inline DocumentParser#parseObject
Relates #16725
2016-02-23 16:33:10 -08:00
Jason Tedor 5bbb1312b1 Inline WildcardExpressionResolver#resolve
Relates #16725
2016-02-23 16:33:08 -08:00
Jason Tedor 26c1bb36a2 Inline TSBA#shardOperationOnPrimary
Relates #16725
2016-02-23 16:33:07 -08:00
Jason Tedor 9e52bcd166 Inline OrdinalsStore#addOrdinal
Relates #16725
2016-02-23 16:33:04 -08:00
Jason Tedor 6a66882e46 Inline DocumentParser#parseDocument
Relates #16725
2016-02-23 16:33:02 -08:00
Jason Tedor b9a7db554a Inline RestUtils#decodeComponent
Relates #16725
2016-02-23 16:33:00 -08:00
Jason Tedor e39280b5a6 Inline CMCB#addEstimateBytesAndMaybeBreak
Relates #16725
2016-02-23 16:32:58 -08:00
Jason Tedor 67e9165089 Inline MetaData#resolveIndexRouting
Relates #16725
2016-02-23 16:32:56 -08:00
Jason Tedor fe2a29211b Inline ReroutePhase#doRun
Relates #16725
2016-02-23 16:32:54 -08:00
Jason Tedor 373c3dfa57 Inline PrimaryPhase#doRun
Relates #16725
2016-02-23 16:32:52 -08:00
Jason Tedor 001c2c6282 Inline XContentBuilder#writeValue
Relates #16725
2016-02-23 16:32:51 -08:00
Jason Tedor 2e9887a3cb Inline NettyHttpChannel#sendResponse
Relates #16725
2016-02-23 16:32:45 -08:00
Jason Tedor a447c06efc Inline NettyHttpChannel#getStatus
Relates #16725
2016-02-23 16:32:45 -08:00
Jason Tedor 2690f69d77 Inline Base64#decode
Relates #16725
2016-02-23 16:32:40 -08:00
Jason Tedor cf1d9cfefc Inline Base64#decode4to3
Relates #16725
2016-02-23 16:32:38 -08:00
Jason Tedor a1740d6661 Inline Base64#encodeBytesToBytes
Relates #16725
2016-02-23 16:32:09 -08:00
Igor Motov a9eb668497 Add node version check to shard allocation during restore
Verifies that the version of a node is compatible with the version of a shard that's being restored on this node.

Fixes #16519
2016-02-22 20:14:57 -08:00
Jason Tedor 5da9059d0b Add G1GC check on startup
This commit adds a check on startup for G1 GC while running on early
versions of HotSpot version 25. This is to prevent potential data
corruption issues that can occur on those versions.

Closes #16737
2016-02-22 16:51:23 -08:00
Jason Tedor 6e840b39f5 Remove ability to disable Netty gathering writes
Java NIO has the notion of gathering writes. These are writes that
gather data from multiple buffers into a single channel. These gathering
writes in Netty have been enabled by default with the possibility to
disable them using "es.netty.gathering". This flag was added in case
having gathering writes on by default did not work out. We have not
published this ability and sufficient time has passed to render
judgement that using gathering writes is okay.

Closes #16774
2016-02-22 16:17:44 -08:00
Simon Willnauer 354aae2fec Merge pull request #16770 from s1monw/http_on_cat
Expose http address in cat/nodes and cat/nodeattrs APIs

We expose a lot of information like IP address and port but never
expose the http address/ip:port in the CAT API. It's nice to have it
there too since otherwise json parsing is required to get this information
2016-02-22 14:20:33 -08:00
Simon Willnauer 3c15200f6f Expose http address in cat/nodes and cat/nodeattrs APIs
We expose a lot of information like IP address and port but never
expose the http address/ip:port in the CAT API. It's nice to have it
there too since otherwise json parsing is required to get this information
2016-02-22 13:22:54 -08:00
David Pilato a55ad665da Merge pull request #16743 from dadoonet/pr/9209-cat-recovery-timeunit
[cat/recovery] Make recovery time a TimeValue()
2016-02-22 12:38:04 -08:00
Lee Hinman 99052c3fef Limit the accepted length of the _id
Elasticsearch should reject ids that are this long, to ensure a document
always remains retrievable for clients that impose a maximum URI length

Closes #16034
2016-02-22 12:34:18 -07:00
Christoph Büscher f8a7bed4f0 Highlighter: Move xContent write of highlight fieldname to SearchSourceBuilder
Most elements in SearchSourceBuilder (e.g. aggs, queries) write their top-level
ParseField name in toXContent(), while HighlightBuilder used to do it in
its own toXContent() method. Moved this up so SeachSourceBuilder for consistency.
2016-02-22 10:58:23 -08:00
Simon Willnauer a574baaf3e [TEST] fix test to only enforce settings if it's not negative AND less than the limit 2016-02-22 10:50:00 -08:00
Simon Willnauer 387f0473dc Assert that we can write in all data-path on startup
Today we might start a node and some of the paths might not have the
required permissions. This commit goes through all data directories as
well as index, shard and state directories and ensures we have write access.
To make this work across all OS etc. we are trying to write a real file
and remove it again in each of those directories
2016-02-22 10:32:29 -08:00
Simon Willnauer 1e15ae6228 Merge pull request #16733 from s1monw/enforce_limits
Enforce node level limits if node is started in production env
2016-02-22 10:30:36 -08:00
Lee Hinman 932808faca [TEST] enable TRACE logging for gateway on testIndexWithFewDocuments 2016-02-22 00:28:34 -07:00
Jason Tedor fa885f2e96 Remove es.max-open-files flag
This commit removes the es.max-open-files flag as the same information
can be obtained from the cluster nodes info API, and is warn logged on
startup if it's set too low anyway.

Closes #16757
2016-02-21 21:01:08 -08:00
Simon Willnauer 55a8b1786e Enforce node level limits if node is started in production env
This commit tries to 'guess' if a user starts a node in production by
checking if any network host is configured. If that is the case soft-limits
that are only logged otherwise are enforced like number of open file descriptors.

Closes #16727
2016-02-21 17:15:50 -08:00
Mike McCandless 2e3160824c Upgrade to Lucene 5.5.0 official release
Closes #16742
2016-02-21 05:26:22 -05:00
Simon Willnauer c8e462e5dc Apply feedback from @rjernst 2016-02-20 17:12:48 -08:00
Drew Raines dd2f26ca40 [cat/recovery] Make recovery time a TimeValue()
Recovery `time` should be a TimeValue() to match other cat APIs.

Closes #9209
2016-02-20 16:30:51 -08:00
Simon Willnauer 4f7dd1284f Remove SNAPSHOT notion from code
Today we have the notion of a snapshot inside Version.java which makes
releasing complicated since to do a release Version.java must be changed.
This commit removes all notions of snapshot from the code and allows to
switch between snapshot and release build by specifying a system property on
the build. For instance running:

```
gradle run -Dbuild.snapshot=false
```

will build and package a release build while the default always
builds snapshots. Calls to the main rest action will still get the snapshot
information rendered out with the response.
2016-02-20 16:06:26 -08:00
Mike McCandless 5fffede2b0 Upgrade to Lucene 5.5.0 official release 2016-02-20 17:34:16 -05:00
Dongjoon Hyun 764ded9f28 Fix typos in exception/assert/log messages in core module. 2016-02-15 15:32:34 -08:00
Martijn van Groningen 3290cfbd31 test: replaced integration tests with unit test 2016-02-15 22:03:55 +01:00
George P. Stathis b17a92c911 Fixes #16550 (thanks for the pointers @martijnvg!) 2016-02-15 19:58:24 +01:00
Adrien Grand 69e21d4cc3 Fix how analyzers are set in StringFieldMapper.
This was changed when adding the text field in an attempt to clean up
how analyzers are set. Unfortunately this change was not safe for the
string field given that it can also represent keywords.
2016-02-15 19:21:54 +01:00
Colin Goodheart-Smithe 8f68c64f68 Fixes serialisation of Ranges
Range aggregation tests were failing (e.g. http://build-us-00.elastic.co/job/es_core_master_metal/12385/testReport/junit/org.elasticsearch.messy.tests/IPv4RangeTests/testPartiallyUnmapped/) sometimes because both the string and number versions of form and to were being serialised. This meant that the range aggregator builder objects would not serialise and deserialise to the same bytes before and after the builder had been used. This change makes Range object immutable so the builder doesn't need to worry about the range changing under its feet.
2016-02-15 15:14:09 +00:00
Colin Goodheart-Smithe ebc745211d Moved AggregatorBuilder implementations into their own class files
Also renamed histogram.AbstractBuilcer to AbstractHistogramBuilder, range.AbstractBuilder to AbstractRangeBuilder and org.elasticsearch.search.aggregations.pipeline.having to org.elasticsearch.search.aggregations.pipeline.bucketselector
2016-02-15 14:09:36 +00:00
Colin Goodheart-Smithe bd2e00d396 review comments 2016-02-15 10:46:24 +00:00
Colin Goodheart-Smithe 1a46628daa Merge branch 'master' into feature/aggs-refactoring
# Conflicts:
#	core/src/test/java/org/elasticsearch/search/builder/SearchSourceBuilderTests.java
2016-02-15 10:37:16 +00:00
Adrien Grand 11ce624343 Merge pull request #16637 from jpountz/feature/text
Add a text field.
2016-02-15 10:45:53 +01:00
Adrien Grand 4f8895eae3 Add a text field.
This new field is intended to replace analyzed string fields.
2016-02-15 10:43:44 +01:00
Boaz Leskes 0305628c6b Add some debug logs to testPendingUpdateTask
It times out rarely. Hopefully these will help.
2016-02-15 10:15:00 +01:00
Jason Tedor d313cdd7d0 Assertion handling timestamp in index request
This commit adds an assertion that the mapping metadata is not null when
handling a non-default timestamp when no timestamp is provided.

Closes #16596
2016-02-14 14:41:30 -05:00
Jason Tedor 3bbd1c129e Remove host from cat nodes API
As the host and ip fields are always equal by design, the host field in
the cat nodes API is redundant and should be removed.

Closes #16656
2016-02-14 09:21:32 -05:00
Simon Willnauer 8c1fe37e92 Remove in-place rewriting of SearchSourceBuilder
SearchSourceBuilder should be cloned when rewriting, the in-place rewrite
is failing with local transport assertions.
2016-02-13 08:57:32 +01:00
Simon Willnauer 25d6a143d4 Merge branch 'master' into add_rewrite_infra 2016-02-12 22:13:34 +01:00
Zachary Tong 2ebd2ba616 [TEST] Temporarily silence failing test
Failure ticket at #16645
2016-02-12 15:36:37 -05:00
Martijn van Groningen 299179e704 logging: exception is first argument 2016-02-12 18:23:22 +01:00
Luca Cavanna f589fa8013 Merge pull request #16617 from javanna/enhancement/function_score_strict_parsing
Function Score Query: make parsing stricter
2016-02-12 17:45:10 +01:00
Luca Cavanna ca23ee6104 Merge pull request #16640 from javanna/enhancement/remove_copy_constructors
Remove copy constructors from request classes and TransportMessage type
2016-02-12 17:21:55 +01:00
javanna cb1ca92618 move function score to ParseField 2016-02-12 17:15:04 +01:00
javanna 320f356030 use assertNull rather than assertTrue(object == null) 2016-02-12 17:15:04 +01:00
javanna 507b868692 [TEST] make SearchSourceBuilderTests pickier, check that the search source has been read completely
Same check is already performed in AbstractQueryTestCase, makes sense to have it here too.
2016-02-12 17:15:04 +01:00
javanna a624410450 Function Score Query: make parsing stricter
Function Score Query now checks the type of token that we are parsing, which makes parsing stricter and allows to throw useful errors in case the json is malformed. It also makes code more readable as in what gets parsed when.

Closes #16583
2016-02-12 17:15:03 +01:00