Commit Graph

24974 Commits

Author SHA1 Message Date
Ali Beyad 557506ba6e Updates the versions the vagrant tests can upgrade from to 5.0.0 (#21151) 2016-10-27 16:44:04 -04:00
Areek Zillur 2f883fcb85 Rethrow original exception when it fails the engine during write operations 2016-10-27 16:38:15 -04:00
Simon Willnauer 97cc426a89 Fix bwc cluster formation in order to run BWC tests against a mixed version cluster (#21145)
This fixes our cluster formation task to run REST tests against a mixed version cluster.
Yet, due to some limitations in our test framework `indices.rollover` tests are currently
disabled for the BWC case since they select the current master as the merge node which
happens to be a BWC node and we can't relocate all shards to it since the primaries are on
a higher version node. This will be fixed in a followup.

Closes #21142

Note: This has been cherry-picked from 5.0 and fixes several rest tests
as well as a BWC break in `OsStats.java`
2016-10-27 17:03:53 +02:00
markharwood 9944a594b1 Aggregations fix: scripted heuristics for scoring significant_terms aggs were not thread safe when running local to the coordinating node. New code spawns an object for each shard search execution rather than sharing a common instance which is not thread safe.
Closes #18120
2016-10-27 13:56:48 +01:00
Yannick Welsch f3e578f942 Stop delaying existing requests after network delay rule is cleared (#21129)
The network disruption type "network delay" continues delaying existing requests even after the disruption has been cleared. This commit ensures that the requests get to execute right after the delay rule is cleared.
2016-10-27 13:48:17 +02:00
Yannick Welsch 952097b1c0 [TEST] Fix testDelayShards to wait for master to remove stopped node
This test failed when the node that was shutting down was not yet removed from the cluster state on the master.
The cluster allocation explain API will not see any unassigned shards until the node shutting down is removed from the
cluster state.
2016-10-27 12:02:00 +02:00
Yannick Welsch 118913b553 [TEST] Fix testRolloverConditionsNotMet to expect correct rollover index name
PR #21138 changed the target index name even if _rollover conditions are not met but missed to adapt this test.
2016-10-27 11:00:44 +02:00
Jun Ohtani a66c76eb44 Merge pull request #20704 from johtani/remove_request_params_in_analyze_api
Removing request parameters in _analyze API
2016-10-27 17:43:18 +09:00
Colin Goodheart-Smithe c1a9833445 Correct similarity default for 5.0 (#21144) 2016-10-27 09:33:21 +01:00
Simon Willnauer e745015325 Return target index name even if _rollover conditions are not met (#21138)
Today we return the old index name as the target / new index name.
This change passes the correct rollover index name to the response.
2016-10-27 09:20:46 +02:00
Areek Zillur 947a17ee37 cleanup operation listener handling of failure in results 2016-10-27 00:26:01 -04:00
Areek Zillur 7fb44a3ab6 add tests 2016-10-27 00:26:01 -04:00
Areek Zillur fa3ee6b996 Incorporate feedback 2016-10-27 00:25:55 -04:00
Jack Conradson 7a7d6ea8e6 Merge pull request #21136 from jdconrad/stype
Refactor ScriptType to be a top-level class.
2016-10-26 12:45:50 -07:00
Jack Conradson 512a77a633 Refactor ScriptType to be a top-level class. 2016-10-26 10:21:22 -07:00
Areek Zillur a3fcfe8196 add constructor overloads for primary result 2016-10-26 12:07:32 -04:00
Areek Zillur 65832b987f Revert "cleanup indexing operation listener"
This reverts commit bb785483ae.
2016-10-26 11:23:09 -04:00
Ali Beyad c88452dc80 Abort snapshots on a node that leaves the cluster (#21084)
Previously, if a node left the cluster (for example, due to a long GC),
during a snapshot, the master node would mark the snapshot as failed, but
the node itself could continue snapshotting the data on its shards to the
repository. If the node rejoins the cluster, the master may assign it to
hold the replica shard (where it held the primary before getting kicked off
the cluster). The initialization of the replica shard would repeatedly fail
with a ShardLockObtainFailedException until the snapshot thread finally
finishes and relinquishes the lock on the Store.

This commit resolves the situation by ensuring that when a shard is removed
from a node (such as when a node rejoins the cluster and realizes it no longer
holds the active shard copy), any snapshotting of the removed shards is aborted.
In the scenario above, when the node rejoins the cluster, it will see in the cluster 
state that the node no longer holds the primary shard, so IndicesClusterStateService
will remove the shard, thereby causing any snapshots of that shard to be aborted.

Closes #20876
2016-10-26 10:04:50 -04:00
Christoph Büscher aaf3477327 Remove checkstyle LineLenght check suppression from 23 more classes 2016-10-26 15:24:21 +02:00
Yannick Welsch e82a1f5cca Only allow the master to update the list of nodes in the cluster state (#21092)
The cluster state on a node is updated either
- by incoming cluster states that are received from the active master or
- by the node itself when it notices that the master has gone.

In the second case, the node adds the NO_MASTER_BLOCK and removes the current master as active master from its cluster state. In one particular case, it would also update the list of nodes, removing the master node that just failed. In the future, we want a clear separation between actions that can be executed by a master publishing a cluster state and a node locally updating its cluster state when no active master is around.
2016-10-26 09:24:03 +02:00
Igor Motov e6dda02c66 Tests: silence cancelling scroll search tests
Investigating it locally
2016-10-25 20:06:05 -10:00
Igor Motov 6fe3bd817b Tests: make sure that 2 segments are created in SearchCancellationTests
Otherwise, the test fails if forced merge kicks in.
2016-10-25 20:05:49 -10:00
Jason Tedor 9c3e4d6e22 Add correct Content-Length on HEAD requests
This commit fixes responses to HEAD requests so that the value of the
Content-Length is correct per the HTTP spec. Namely, the value of this
header should be equal to the Content-Length if the request were not a
HEAD request.

This commit also fixes a memory leak on HEAD requests to the main action
that arose from the bytes on a builder not being released due to them
being dropped on the floor to ensure that the response to the main
action did not have a body.

Relates #21123
2016-10-25 23:08:19 -04:00
Igor Motov 17ad88d539 Makes search action cancelable by task management API
Long running searches now can be cancelled using standard task cancellation mechanism.
2016-10-25 12:27:34 -10:00
Greg Marzouka c3761b8e4d Merge pull request #21099 from gmarz/rest-allow-no-indices
Remove allow_no_indices from indices.upgrade
2016-10-25 12:31:09 -04:00
Britta Weber 7945894ede Remove unused interface InitialStateDiscoveryListener (#21115) 2016-10-25 18:29:23 +02:00
Nik Everett 44c3b04bef Convert more docs to // CONSOLE
Converts docs for `_cat/segments`, `_cat/plugins` and `_cat/repositories`
from `curl` to `// CONSOLE` so they are tested as part of the build and
are cleaner to use in Console. They should work fine with `curl` with
the `COPY AS CURL` link.

Also swaps the `source` type of the response from `js` to `txt` because
that is more correct. The syntax highlighter doesn't care. It looks at
the text to figure out the language. So it looks a little funny for `_cat`
responses regardless.

Relates to #18160
2016-10-25 11:17:24 -04:00
Areek Zillur c237263ad1 fix computing took for write operation result 2016-10-25 10:42:09 -04:00
Areek Zillur 7a6f56a692 fix tests 2016-10-25 10:22:32 -04:00
Areek Zillur 1ad1e2730d fix wildcard import 2016-10-25 10:00:44 -04:00
Areek Zillur 64a897e5f2 add setters for translog location and took in engine operation result 2016-10-25 09:58:14 -04:00
Areek Zillur bb785483ae cleanup indexing operation listener 2016-10-25 09:33:04 -04:00
Areek Zillur 168946ad5a Improve documentation for handling write operation failure 2016-10-25 09:22:49 -04:00
Areek Zillur 1aee578aa1 add operation result as a parameter to postIndex/delete in indexing operation listener 2016-10-25 09:12:39 -04:00
Areek Zillur 1587a77ffd Revert "Generify index shard method to execute engine write operation"
This reverts commit 1bdeada8aa.
2016-10-25 09:11:16 -04:00
Jason Tedor 1bc08ff1e5 Fix empty <p> tag warning in o/e/m/o/OsProbe.java
This commit fixes an empty <p> tag warning in o/e/m/o/OsProbe.java.
2016-10-25 08:33:15 -04:00
Jason Tedor b89c5aff51 Add preformatted tags to Javadoc in OsProbe
This commit adds preformatted tags to the Javadoc for
OsProbe#readSysFsCgroupCpuAcctCpuStat to render the form of the cpu.stat
file in a fixed-width font.
2016-10-25 08:19:10 -04:00
Jason Tedor 9a6c81c9f1 Mock areCgroupStatsAvailable in OsProbeTests
When acquiring cgroup stats, we check if such stats are available by
invoking a method areCgroupStatsAvailable. This method checks
availability by looking for existence of some virtual files in
/proc/self/cgroup and /sys/fs/cgroups. If these stats are not available,
the getCgroup method returns null. The OsProbeTests#testCgroupProbe did
not account for this. On some systems where tests run, the cgroup stats
might not be available yet this test method was expecting them to be (we
mock the relevant virtual file reads). This commit handles the execution
of this test on such systems by overriding the behavior of
OsProbe#areCgroupStatsAvailable. We test both the possibility of this
method returning true as well as false.
2016-10-24 19:59:48 -04:00
Jason Tedor de241f441d Remove unused import from o/e/m/o/OsProbe.java
This commit removes an unused import from o/e/m/o/OsProbe.java.
2016-10-24 16:40:41 -04:00
Jason Tedor 900ee0536e Strengthen handling of unavailable cgroup stats
On some systems, cgroups will be available but not configured. And in
some cases, cgroups will be configured, but not for the subsystems that
we are expecting (e.g., cpu and cpuacct). This commit strengthens the
handling of cgroup stats on such systems.

Relates #21094
2016-10-24 16:36:51 -04:00
Greg Marzouka ab22307cf2 Remove allow_no_indices from indices.upgrade 2016-10-24 15:06:17 -04:00
Christoph Büscher e8a3225719 Tests: Fix compile issue with type inference on java 9 build 2016-10-24 19:59:08 +02:00
Christoph Büscher a43f70522c Tests: fix issue with SliceBuilderTests creation of mutated test objects 2016-10-24 18:48:18 +02:00
Li Weinan d4e42b77a5 .es_temp_file remains after system crash, causing it not to start again #21007
When system starts, it creates a temporary file named .es_temp_file to ensure the data directories are writable.

If system crashes after creating the .es_temp_file but before deleting this file, next time the system will not be able to start because the Files.createFile(resolve) will throw an exception if the file already exists.
2016-10-24 16:41:36 +02:00
Christoph Büscher f6f129b21f Consolidate code for equals/hashCode testing in central utility class
Currently test that check that equals() and hashCode() are working as expected
for classes implementing them are quiet similar. This change moves common
assertions in this method to a common utility class. In addition, another common
utility function in most of these test classes that creates copies of input
object by running them through a StreamOutput and reading them back in, is moved
to ESTestCase so it can be shared across all these classes.

Closes #20629
2016-10-24 15:50:40 +02:00
Praveen Shukla 2e18f2e818 [DOCS] clarifies master nodes to be master eligible nodes 2016-10-24 08:58:44 -04:00
Jason Tedor 3d642ab0eb Add basic cgroup CPU metrics
This commit adds basic cgroup CPU metrics to the node stats API.

Relates #21029
2016-10-24 08:26:56 -04:00
Simon Willnauer 0a410d3916 Pass executor name to request interceptor to support async intercept calls (#21089)
Today the request interceptor can't support async calls since the response
of the async call would execute on a different thread ie. a client or listener
thread. This means in-turn that the intercepted handler is not executed with the
thread it was supposed to run and therefor can, if it's executing blocking
operations, potentially deadlock an entire server.
2016-10-24 13:57:07 +02:00
Tanguy Leroux 127b4a8efc Change permissions on config files (#20966)
This commit changes some default file permissions on configuration files.
2016-10-24 09:42:03 +02:00
Tanguy Leroux 268d5ba97a Add JVM option "-XX:-AssumeMP" in SystemD tests (#21063)
Since with j`ava-1.8.0-openjdk-1.8.0.111-1.b15.el7_2.x86_64`, the OpenJDK packaged for CentOS and OEL override the default value (`false`) for the JVM option `AssumeMP` and force it to `true` (see [this patch](https://git.centos.org/blob/rpms!!java-1.8.0-openjdk.git/ab03fcc7a277355a837dd4c8500f8f90201ea353/SOURCES!always_assumemp.patch))

Because it is forced to true by default for these packages, the following warning message is printed to the standard output when the Vagrant box has only 1 CPU:
> OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N

This message will then fail the test introduced in #20422  where we check if no entries have been added to the journal after the service has been started.

This commit restore the default value for the `AssumeMP` option for CentOS and OracleServer.
2016-10-24 09:30:55 +02:00