Commit Graph

5652 Commits

Author SHA1 Message Date
Jason Tedor df7ad9970b Batch process node left and node failure
Today when a node is removed the cluster (it leaves or it fails), we
submit a cluster state update task. These cluster state update tasks are
processed serially on the master. When nodes are removed en masse (e.g.,
a rack is taken down or otherwise becomes unavailable), the master will
be slow to process these failures because of the resulting reroutes and
publishing of each subsequent cluster state. We improve this in this
commit by processing the node removals using the cluster state update
task batch processing framework.

Relates #19289
2016-07-11 08:30:09 -04:00
Simon Willnauer 3f3c93ec65 Add blocking socket based MockTcpTransport (#19332)
Today we have a bunch of tests that use netty transport for several reasons
these tests use it because they need to run some tcp based transport. Yet, this
couples our tests tightly to the netty implementation which should be tested on it's own.
This change adds a plain socket based blocking TcpTransport implementation that is used by
default in tests if local transport is suppressed or if network is selected.
It also adds another tcp network implementation as a showcase how the interface works.
2016-07-11 12:17:52 +02:00
Simon Willnauer 1d03a1409c Catch assertion errors on commit and turn it into a real exception (#19357)
Lucene IndexWriter asserts on files existing on the filesystem but
some tests throw IOException explicitly on those operatiosn such that
some tests trip asserts. We had this before on InternalEngine#ctor
and added some logic there to catch only a specific assertions based
on some excepition stack analysis. This change applies the same logic
to the IndexWriter#commit part of the engine since it can hit the same
issue.
This also fixes a self-suppression issue in Store.java.

Closes #19356
2016-07-11 11:20:56 +02:00
javanna 942e342662 Rest Client: use short performRequest methods when possible 2016-07-11 10:36:26 +02:00
Simon Willnauer 36dbe7250f Cleanup usage of http.enabled (#19351)
Several tests required http.enabled where it was unnecessary.
We also had RestMainActionIT which tests what two of our REST tests
test already so I removed it.
The explicit use of http.enabled: false is also obsolet since our
test do that by default.
2016-07-11 10:21:03 +02:00
Ryan Ernst 25ed93dd28 Fix test edge case for random bytes reference iter.
Getting an offset to the last byte means we can only stream one byte and
then we are done, we can't get another offset after it.
2016-07-10 09:11:32 -07:00
Nicholas Knize ab8b577aea Use GeoDistanceIT.testDuelOptimizations for bwc testing only
This test is only relevant for testing the GeoDistanceBuilder with old indices (pre GeoPointV2).

closes #19263
2016-07-09 19:08:06 -05:00
Ryan Ernst 3832825a87 Merge pull request #19348 from rjernst/deguice_attrs
Remove CustomNodeAttributes extension point
2016-07-09 12:46:26 -07:00
Ryan Ernst 2b9d4bdf85 Plugins: Remove CustomNodeAttributes extension point
The DiscoveryNodeService exists to register CustomNodeAttributes which
plugins can add. This is not necessary, since plugins can already add
additional attributes, and use the node attributes prefix.

This change removes the DiscoveryNodeService, and converts the only
consumer, the ec2 discovery plugin, to add the ec2 availability zone
in additionalSettings().
2016-07-08 21:39:11 -07:00
Ryan Ernst 7e59181e58 Internal: Remove child injectors from guice
This change removes the ability for guice to have child injectors (and
the entire concept of parent injectors) from our fork of guice. The
methodology for removing was simple: I removed createChildInjector, and
continued to remove methods and members that were unused until my head
was spinning. The motivation for this change is to limit what our fork
of guice gives us access to, so we don't regress and start adding back
more complicated uses.
2016-07-08 15:22:50 -07:00
Ryan Ernst dea00a0b16 Merge pull request #19324 from rjernst/repository_deguice2
Add RepositoryPlugin interface for registering snapshot repositories
2016-07-08 14:38:07 -07:00
Nicholas Knize 8dd4a6473e Remove radial restriction for GeoDistanceQuery
As of lucene 6.1 GeoDistanceQuery no longer requires restricting the radial distance in GeoPointDistanceQuery.

closes #17578
2016-07-08 12:13:22 -05:00
Nicholas Knize 72fa345f5e Mute GeoDistanceIT while fixing 2016-07-08 10:02:15 -05:00
Simon Willnauer f6ac147b1d Add a unit test that sends random requests among 3 nodes (#19329)
This adds a test that uses transport implementation and sends random requests
to 3 different nodes, the request handlers maybe forwarding the requests to yet another node
etc. until returning the response. This test basically tests that nodes are not deadlocking
in a distributed fashion.
2016-07-08 14:13:36 +02:00
Martijn van Groningen 7b8ae54f0f percolator: Also support query term extract for queries wrapped inside a FunctionScoreQuery
Additionally for highlighting percolator hits, also extract percolator query from FunctionScoreQuery and DisjunctionMaxQuery
2016-07-08 10:51:48 +02:00
Simon Willnauer 1cb1373722 [TEST] Test analyzer alias works
Relates to #19163
2016-07-08 10:33:12 +02:00
Ryan Ernst e6be4af014 Plugins: Add RepositoryPlugin interface for registering snapshot repositories
Repository plugins currently use a lot of custom classes like
RepositoryName and RepositorySettings in order to use guice to construct
repository implementations. But repositories now only really need their
settings to be constructed. Anything else they need (eg a cloud client)
can be constructed within the plugin, instead of via guice.

This change makes repository plugins use the new pull model. It removes
guice from the construction of Repository objects (no more child
injectors) and also from all repository plugins.
2016-07-08 00:10:03 -07:00
Nik Everett 81fcdfcee9 Expose task information from NodeClient
This exposes a method to start an action and return a task from
`NodeClient`. This allows reindex to use the injected `Client` rather
than require injecting `TransportAction`s
2016-07-07 18:02:09 -04:00
Nik Everett fe0f28965a Clean up serialization of terms aggregation results
Move to NamedWriteable and remove a lot of duplication.
2016-07-07 17:01:09 -04:00
Nik Everett 7da753a4d7 Migrate sampler and missing aggregations to NamedWriteable
This is another step down the path to removing aggregation's special
"streams" which reimplement NamedWriteable.
2016-07-07 16:40:38 -04:00
Nik Everett d83e1cccac Fix checkstyle in test 2016-07-07 16:40:11 -04:00
Ryan Ernst 89d69ea5a2 Merge pull request #19292 from rjernst/repository_deguice
Simplified repository api for snapshot/restore
2016-07-07 13:03:58 -07:00
Ryan Ernst 593f8bdf0c Rename repository api methods for clarity and tweak documentation. 2016-07-07 12:54:10 -07:00
Jason Tedor e86aa29f67 Die with dignity
Today when a thread encounters a fatal unrecoverable error that
threatens the stability of the JVM, Elasticsearch marches on. This
includes out of memory errors, stack overflow errors and other errors
that leave the JVM in a questionable state. Instead, the Elasticsearch
JVM should die when these errors are encountered. This commit causes
this to be the case.

Relates #19272
2016-07-07 14:44:03 -04:00
Jason Tedor d3f8329a3d Tighten ensure atomic move cleanup
This commit tightens the cleanup after possible errors while ensuring
the filesystem supports atomic move.

Relates #19309
2016-07-07 14:40:05 -04:00
Tanguy Leroux 3267fc4e0c Clean up more messy tests
After #13834 many tests that used Groovy scripts (for good or bad reason) in their tests have been moved in the lang-groovy module and the issue #13837 has been created to track these messy tests in order to clean them up.

This commit moves more tests back in core, removes the dependency on Groovy, changes the scripts in order to use the mocked script engine, and change the tests  to integration tests.
2016-07-07 17:50:23 +02:00
Clinton Gormley ec3807d426 Added 2.3.4 version and bwc indices 2016-07-07 16:36:23 +02:00
Tanguy Leroux b58f2eb5c2 Move back some messy tests from Groovy plugin to core
This commit moves back some messy tests that have been placed in lang-groovy module in https://github.com/elastic/elasticsearch/pull/13834. It removes the dependency on Groovy plugin as well as change back the tests to integration tests (IT suffix).

It also changes the current MockScriptEngine and MockScriptPlugin to make it easier to use.
2016-07-07 15:26:36 +02:00
Alexander Reelsen 71b48fb16c Dependencies: Update to jopt-5.0 (#19278)
The new version of jopt allows us to remove a couple of TODOs in the code.

Closes #12368
2016-07-07 08:50:10 +02:00
Jason Tedor b3105bd316 Fix modifier order in BytesStreamsTests
This commit fixes an issue with the ordering of modifiers on a static
nested class in BytesStreamsTests.
2016-07-06 20:11:38 -04:00
Ryan Ernst dd7be74bcf Plugins: Simplified repository api for snapshot/restore
The api for snapshot/restore was split up between two interfaces,
Repository and IndexShardRepository. There was also complex
initialization and injection between the two. However, there is always a
one to one relationship between the two.

This change moves the IndexShardRepository api into Repository, as well
as updates the API so as not to require any services to be injected for
sublcasses.
2016-07-06 17:09:30 -07:00
Chris Earle b927cfe1de Add DeprecationRestHandler to automatically log deprecated REST calls
This adds a new proxy for RestHandlers and RestControllers so that requests made
to deprecated REST APIs can be automatically logged in the ES logs via the
DeprecationLogger as well as via a "Warning" header (RFC-7234) for all responses.
2016-07-06 19:52:00 -04:00
Yannick Welsch 76057e6b05 Fix test issue where index is explicitly deleted during cluster state update
Calling indicesService.deleteIndex() can trip an assertion if there is an ongoing cluster state applied in
IndicesClusterStateService. This means that the index is possibly deleted after the failMissingShards
check and before we try creating new and updated shards, tripping an assertion that non-existing shards must
have shard state initializing (started in this case).
2016-07-06 16:51:22 +02:00
Jim Ferenczi 37725f640c Add missing field type in the FieldStats response.
This change adds the type of the field in the fieldstats response.
It can be one of the following:
  * "integer" for byte, short, integer and long
  * "float" for float, half-float and double
  * "date" for date
  * "ip" for ip
  * "text" for string, keyword and text.

Closes #17750
2016-07-06 15:24:09 +02:00
Ryan Ernst f49ce8e6fe Add basic tests for ingest plugins setup 2016-07-05 21:03:39 -07:00
Ryan Ernst 2fc41adeb5 Merge branch 'master' into ingest_plugin_api 2016-07-05 20:53:03 -07:00
Ryan Ernst 18c9e7adaf Merge branch 'master' into unused 2016-07-05 20:46:36 -07:00
Ryan Ernst 14eefb7607 Internal: Remove guice from transport client helper classes
This change removes injection for constructors of
TransportClientNodesService and TransportProxyClient.
2016-07-05 19:51:03 -07:00
Igor Motov 74af0e36f3 [TEST] Fix rare OBOE in AbstractBytesReferenceTestCase 2016-07-05 16:40:03 -04:00
Nik Everett b3c015e2bb Reindex from remote
This adds a remote option to reindex that looks like

```
curl -POST 'localhost:9200/_reindex?pretty' -d'{
  "source": {
    "remote": {
      "host": "http://otherhost:9200"
    },
    "index": "target",
    "query": {
      "match": {
        "foo": "bar"
      }
    }
  },
  "dest": {
    "index": "target"
  }
}'
```

This reindex has all of the features of local reindex:
* Using queries to filter what is copied
* Retry on rejection
* Throttle/rethottle
The big advantage of this version is that it goes over the HTTP API
which can be made backwards compatible.

Some things are different:

The query field is sent directly to the other node rather than parsed
on the coordinating node. This should allow it to support constructs
that are invalid on the coordinating node but are valid on the target
node. Mostly, that means old syntax.
2016-07-05 16:13:17 -04:00
Jason Tedor 96f283c195 Rename writeThrowable to writeException
This commit renames writeThrowable to writeException. The situation here
stems from the fact that the StreamOutput method for serializing
Exceptions needs to accept Throwables too as Throwables can be the cause
of serialized Exceptions. Yet, we do not serialize Throwables in the
Error sub-hierarchy in a way that they can be deserialized into their
initial type. This leads to an asymmetry in the StreamOutput method for
serializing Exceptions and the StreamInput method for writing
Excpetions. Namely, the former will accept Throwables but the latter
will only return Exceptions. A goal with the stream methods has always
been symmetry in the method names so that serialization/deserialization
routines appear symmetrical in code. It is this asymmetry on the
input/output types for Exceptions on StreamOutput/StreamInput that
clashes with the desired symmetry of naming. Despite this, we should
favor symmetry in the naming of the methods. This commit renames
StreamOutput#writeThrowable to StreamOutput#writeException which leaves
us with Exception StreamInput#readException and void
StreamOutput#writeException(Throwable).
2016-07-05 14:37:01 -04:00
Justin Patrin ebe616988a Start transport client round-robin randomly
This commit modifies the initial value of the transport client
round-robin index to a random value so that initial requests are more
likely to not all hit the same node.

Relates #14143
2016-07-05 13:17:17 -04:00
LeeDr 036b8ff177 Fix stored_fields message 2016-07-05 09:11:29 -05:00
Nik Everett 3269c84c7a Remote BucketStreams
It isn't used.
2016-07-05 09:02:36 -04:00
Adrien Grand 4b0d317e63 Bump version to 5.0.0-alpha5. 2016-07-05 14:34:23 +02:00
Simon Willnauer d08812d839 [TEST] fix test to account for internal empyt reference optimization 2016-07-05 11:23:43 +02:00
Simon Willnauer a4ec0ac22f Upgrade to netty 3.10.6.Final (#19235) 2016-07-05 11:11:55 +02:00
Simon Willnauer cbbc8790a5 Remove redundant modifier 2016-07-05 08:39:08 +02:00
Simon Willnauer 44ccf67e33 Simplify TcpTransport interface by reducing send code to a single send method (#19223)
Due to some optimization on the netty layer we had quite some code / cruft
added to the TcpTransport to allow for those optimizations. After cleaning
up BytesReference we can now move this optimization into TcpTransport and
have a simple send method on the implementation layer instead. This commit
adds a CompositeBytesReference that also allows message headers to be written
separately which simplify the header code as well since no skips are needed
anymore.
2016-07-05 08:33:19 +02:00
Jason Tedor a00a54ebda Fix style violation in InstallPluginCommand.java
This commit fixes a checkstyle violation in InstallPluginCommand.java
added after renaming UserError to UserException in
f9d55be1ed.
2016-07-04 19:45:46 -04:00