Commit Graph

25514 Commits

Author SHA1 Message Date
David Pilato 5bc92643ee Merge branch 'doc/gradle-rest-client' 2016-11-23 17:03:58 +01:00
David Pilato 77e8e1d6f2 Update layout 2016-11-23 17:00:41 +01:00
Jason Tedor 32e6fcf256 Fix markup in Zen discovery docs
This commit fixes a markup issue in the Zen discovery docs where a link
and its referring text were not on the same line tripping the renderer.
2016-11-23 10:02:13 -05:00
Luca Cavanna 033eece6d4 ShardSearchRequest to take ShardId constructor argument rather than the whole ShardRouting (#21750)
ShardSearchRequest was previously taking in the whole ShardRouting as a constructor argument while it only needs the ShardsId, changed that to carry over only the needed bits.
2016-11-23 15:34:55 +01:00
Nik Everett 76a804e589 Revert "it's a `noop` operation, not a `none` operation. (#21736)"
This reverts commit 7f77214ced.

`none` is indeed how you trigger the `noop` operation in the `_update`
API.
2016-11-23 09:26:53 -05:00
Tanguy Leroux 67f02363ce Update packaging tests after lang-groovy removal (#21748)
The packaging tests must be adapted since 'lang-groovy' has been removed from master.
2016-11-23 11:59:36 +01:00
Ryan Ernst 10a945ae72 Plugins: Remove support for onModule (#21416)
All plugin extension points have been converted to pull based
interfaces. This change removes the infrastructure for the black-magic
onModule methods.
2016-11-22 23:12:14 -08:00
Ryan Ernst 66d135cf63 Fix more groovy references in packaging tests 2016-11-22 23:06:24 -08:00
Ryan Ernst d8808210f1 Transport client: Fix remove address to actually work (#21743)
* Transport client: Fix remove address to actually work

The removeTransportAddress method of TransportClient removes the address
from the list of nodes that the client pings to sniff for nodes.
However, it does not remove it from the list of existing connected
nodes. This means removing a node is not possible, as long as that node
is still up.

This change removes the node from the connected nodes list before
triggering sampling (ie sniffing).  While the fix is simple, testing was
not because there were no existing tests for sniffing. This change also
modifies the mocks used by transport client unit tests in order to allow
mocking sniffing.
2016-11-22 22:50:11 -08:00
Ryan Ernst 7ad409d5aa Remove references to groovy in packaging tests 2016-11-22 22:46:04 -08:00
Igor Motov c7b69a0133 Add search task descriptions
Since we added ability to cancel searches it would be nice to see which searches we are actually cancelling.
2016-11-22 23:15:49 -05:00
Ryan Ernst 6940b2b8c7 Remove groovy scripting language (#21607)
* Scripting: Remove groovy scripting language

Groovy was deprecated in 5.0. This change removes it, along with the
legacy default language infrastructure in scripting.
2016-11-22 19:24:12 -08:00
Nik Everett dbdcf9e95c Move painless yaml tests into painless dir
They were in a directory named "plan_a", the old name for painless.
2016-11-22 20:27:14 -05:00
Nik Everett 1791623700 Document `error_trace`
The `error_trace` parameter turns on the `stack_trace` field
in errors which returns stack traces.

Removes documentation for `camelCase` because it hasn't worked
in a while....

Documents the internal parameters used to render stack traces as
internal only.

Closes #21708
2016-11-22 19:16:07 -05:00
Jason Tedor c7b70fc770 Mark Security#addBindPermissions as private
This commit marks the method Security#addBindPermissions as private,
it's package-private visibility was not used anywhere.
2016-11-22 18:40:18 -05:00
Jason Tedor 41ae784a6f Refactor handling of bind permissions
This commit refactors the handling of bind permissions, which is in need
of a little cleanup. For example, in its current state, the code for
handling permissions for transport profiles is split across two
methods. This commit refactors this code hopefully making it easier to
work with in future changes. This change is mostly mechanical, no
functionality is changed.

Relates #21742
2016-11-22 18:39:14 -05:00
Jason Tedor 1576eaba25 Increase lower bound for random resolve timeout in test
The test UnicastZenPing#testResolveTimeout chooses a random resolve
timeout between 1ms and 100ms. Close to the lower bound, this is far too
short and the test races against the concurrent resolves executing
before the timeout elapses. This commit increases the timeout to
something that is far less likely to race, yet will not slow the test
down since we are not doing resolves against a real DNS service anyway.
Note that we still want a short resolve timeout since we are testing
whether or not timeouts really work here (by latching one of the
resolves to respond slowly).
2016-11-22 18:35:57 -05:00
Luca Cavanna db5a72774b Add indices and filter information to search shards api output (#21738)
Add indices and filter information to search shards api output

The search shards api returns info about which shards are going to be hit by executing a search with provided parameters: indices, routing, preference. Indices can also be aliases, which can also hold filters. The output includes an array of shards and a summary of all the nodes the shards are allocated on. This commit adds a new indices section to the search shards output that includes one entry per index, where each index can be associated with an optional filter in case the index was hit through a filtered alias.

This is relevant since we have moved parsing of alias filters to the coordinating node.

Relates to #20916
2016-11-22 23:00:25 +01:00
Nik Everett 29e68323a2 Clean up ScriptQuerySearchIT
Shorten line and remove forbidden API.

Relates to #21484
2016-11-22 16:23:33 -05:00
umeshdangat f37db2fe17 Support binary field type in script values (#21484)
Add ScriptDocValues.BytesRefs for reading binary fieldtype
2016-11-22 16:23:23 -05:00
jaymode ced638bcda
test: use the correct number of bwc nodes for old cluster 2016-11-22 14:56:34 -05:00
Simon Willnauer a9a2753f0b Add a HostFailureListener to notify client code if a node got disconnected (#21709)
Today there is no way to get notified if a node is disconnected. Client code
must poll the TransportClient constantly to detect that a node is not connected
anymore in order to react and add new nodes or notify altering etc. For instance
if a hostname  gets resolved to an IP but that host is disconnected clients want
to reconnect by resolving the hostname again which is a common situation in cloud
environments.

Closes #21424
2016-11-22 20:46:28 +01:00
jaymode e1e17b3bfe
Fix get-bwc-version for 2.x releases 2016-11-22 14:39:59 -05:00
Jason Tedor 9dc65037bc Lazy resolve unicast hosts
Today we eagerly resolve unicast hosts. This means that if DNS changes,
we will never find the host at the new address. Moreover, a single host
failng to resolve causes startup to abort. This commit introduces lazy
resolution of unicast hosts. If a DNS entry changes, there is an
opportunity for the host to be discovered. Note that under the Java
security manager, there is a default positive cache of infinity for
resolved hosts; this means that if a user does want to operate in an
environment where DNS can change, they must adjust
networkaddress.cache.ttl in their security policy. And if a host fails
to resolve, we warn log the hostname but continue pinging other
configured hosts.

When doing DNS resolutions for unicast hostnames, we wait until the DNS
lookups timeout. This appears to be forty-five seconds on modern JVMs,
and it is not configurable. If we do these serially, the cluster can be
blocked during ping for a lengthy period of time. This commit introduces
doing the DNS lookups in parallel, and adds a user-configurable timeout
for these lookups.

Relates #21630
2016-11-22 14:17:04 -05:00
Clinton Gormley 3ff8faf514 Added version 2.4.2 and bwc indices 2016-11-22 19:45:59 +01:00
Yannick Welsch a44655763e Allow master to assign primary shard to node that has shard store locked during shard state fetching (#21656)
PR #19416 added a safety mechanism to shard state fetching to only access the store when the shard lock can be acquired. This can lead to the following situation however where a shard has not fully shut down yet while the shard fetching is going on, resulting in a ShardLockObtainFailedException. PrimaryShardAllocator that decides where to allocate primary shards sees this exception and treats the shard as unusable. If this is the only shard copy in the cluster, the cluster stays red and a new shard fetching cycle will not be triggered as shard state fetching treats exceptions while opening the store as permanent failures.

This commit makes it so that PrimaryShardAllocator treats the locked shard as a possible allocation target (although with the least priority).
2016-11-22 19:35:47 +01:00
Jay Modi 080d55a393 Rethrow ExecutionException from the loader to concurrent callers of Cache#computeIfAbsent
This commit clarifies the contract of Cache#computeIfAbsent so that an exception that occurs during the execution
of the loader is thrown to all callers. Prior to this commit, the first caller would get the ExecutionException
and other callers that called during the load execution would get null, which is confusing.
2016-11-22 13:24:15 -05:00
Nik Everett 83ea1be185 Remove a bad callout from the new debugging docs
It was a leftover and doesn't break the usual build but breaks the docs
build.
2016-11-22 13:13:16 -05:00
Nik Everett 457c2d8fb0 Add Debug.explain to painless
You can use `Debug.explain(someObject)` in painless to throw an
`Error` that can't be caught by painless code and contains an
object's class. This is useful because painless's sandbox doesn't
allow you to call `someObject.getClass()`.

Closes #20263
2016-11-22 12:46:02 -05:00
Jay Modi 3755c51cd8 Build: add the ability to support plugins in BWC tests
This commit adds the ability to support running with plugins in tests that make use of
backwards compatibility nodes. This can be used to test rolling upgrades with plugins
to ensure they do not cause issues during a rolling upgrade of elasticsearch.
2016-11-22 11:58:17 -05:00
Luca Cavanna db8b2dceea Remove ignored type parameter in search_shards api (#21688)
The `type` parameter has always been accepted by the search_shards api, probably to make the api and its urls the same as search. Truth is that the type never had any effect, it's been ignored from day one while accepting it may make users think that we actually do something with it.

This commit removes support for the type parameter from the REST layer and the Java API. Backwards compatibility is maintained on the transport layer though.

The new added serialization test also uncovered a bug in the java API where the `ClusterSearchShardsRequest` could be created with no arguments, but the indices were required to be not null otherwise the request couldn't be serialized as `writeTo` would throw NPE. Fixed by setting a default value (empty array) for indices.
2016-11-22 17:22:33 +01:00
Jason Tedor 775638c281 Die with dignity on the Lucene layer
When a fatal error tragically closes an index writer, such an error
never makes its way to the uncaught exception handler. This prevents the
node from being torn down if an out of memory error or other fatal error
is thrown in the Lucene layer. This commit ensures that such events
bubble their way up to the uncaught exception handler.

Relates #21721
2016-11-22 11:21:24 -05:00
Adrin Jalali 7f77214ced it's a `noop` operation, not a `none` operation. (#21736)
It works I guess cause it's ignored as an invalid operation.
2016-11-22 10:41:24 -05:00
Adrin Jalali 982f7cb067 fixing an ambiguous sentence. (#21729) 2016-11-22 16:35:58 +01:00
Adrin Jalali 4bb7091f64 `force` is deprecated be mentioned at the end. (#21731) 2016-11-22 16:35:57 +01:00
David Pilato 5e1780061c Add Gradle coordinates for the REST client 2016-11-22 16:34:23 +01:00
Jason Tedor 221caa1c5e Refactor handling for bad default permissions
This commit refactors the handling of bad default permissions that come
from the system security policy.

Relates #21735
2016-11-22 10:26:36 -05:00
Clinton Gormley 284dedfb5f Update get-settings.asciidoc
Fix syntax for filtering settings by name

Closes https://github.com/elastic/elasticsearch/issues/21713
2016-11-22 15:10:09 +01:00
Erel2 b538bbd2c8 Update index.asciidoc (#21727) 2016-11-22 14:17:57 +01:00
Yannick Welsch 50e25912c8 Split main ClusterService method into smaller chunks #21666
Splits the main method in ClusterService into smaller chunks so that it's easier to understand and simpler to modify in subsequent PRs.
2016-11-22 12:20:53 +01:00
Yannick Welsch c521219b2f Adapt BWC layer checks for Exceptions to include v5.0.2 support
The PR #21694 was initially planned to go into v6.0.0 and v5.1.0. Due to another PR relying on this one though for backport to v5.0.2, #21694 must go to v5.0.2
as well. As such, the initial backward compatibility rules established by the PR must be changed to include v5.0.2 and above.
2016-11-22 12:02:56 +01:00
Lee Hinman dd1012d570 Merge remote-tracking branch 'dakrone/fix-lenient-overriding' 2016-11-21 22:10:19 -07:00
Lee Hinman 11da09e9bc Allow overriding all-field leniency when `lenient` option is specified
As part of #20925 and #21341 we added an "all-fields" mode to the
`query_string` and `simple_query_string`. This would expand the query to
all fields and automatically set `lenient` to true.

However, we should still allow a user to override the `lenient` flag to
whichever value they desire, should they add it in the request. This
commit does that.
2016-11-21 21:32:25 -07:00
Areek Zillur 933c4f42b3 [FIX] make MergableCustomMetaData public in TribeService 2016-11-21 23:02:36 -05:00
Jason Tedor 446037ccb8 Die with dignity on the network layer
When a fatal error is thrown on the network layer, such an error never
makes its way to the uncaught exception handler. This prevents the node
from being torn down if an out of memory error or other fatal error is
thrown while handling HTTP or transport traffic. This commit adds logic
to ensure that such errors bubble their way up to the uncaught exception
handler, even though Netty tries really hard to swallow everything.

Relates #21720
2016-11-21 22:14:30 -05:00
Nik Everett c79371fd5b Remove lang-python and lang-javascript (#20734)
They were deprecated in 5.0. We are concentrating on making
Painless awesome rather than supporting every language possible.

Closes #20698
2016-11-21 22:13:25 -05:00
Jason Tedor 4225737db9 Install a security manager on startup
When Elasticsearch starts, we go through some initialization before we
install a security manager. Yet, the JVM makes internal policy decisions
on the basis of whether or not a security manager is present. This
commit installs a security manager immediately on startup so that the
JVM always thinks a security manager is present when making such policy
decisions.

Relates #21716
2016-11-21 20:33:42 -05:00
Nik Everett f5c8c746e6 Implement toString in painless's AST
This should make debugging painless' analysis and code generation a
little easier.

The `toString` implementations mirror the AST somewhat, and look like
`(SSource (SReturn (ENumeric 1)))`.
2016-11-21 16:24:10 -05:00
Simon Willnauer cb5c25ab4f Add a StreamInput#readArraySize method that ensures sane array sizes (#21697)
Today we read a vint from the stream to allocate the size of an array up-front
before we start reading the values. This can be dangerous if for instance we read
from a corrupted stream or if some manipulated bytes are send for instance from
an attacker or a fuzzer. In most of the cases we can apply some best effort and
validate the array size to be _sane_ by ensuring we can at read at least N bytes
where N is the expected size of the array.
2016-11-21 21:39:21 +01:00
Areek Zillur 0ccf8a742d Add support for merging custom meta data in tribe node (#21552)
* Add support for merging custom meta data in tribe node

Currently, when any underlying cluster has custom metadata
(via plugin), tribe node does not store custom meta data in its
cluster state. This is because the tribe node has no idea how to
select the appropriate custom metadata from one or many custom
metadata (corresponding to the number of underlying clusters).

This change adds an interface that custom metadata implementations
can extend to add support for merging mulitple custom metadata of
the same type for storing in the tribe state.

Relates to #20544
Supersedes #20791

* Simplify updating tribe state

* Add tests for merging multiple custom metadata types in tribe node

* cleanup merging custom md logic in tribe service
2016-11-21 12:03:01 -05:00