Commit Graph

600 Commits

Author SHA1 Message Date
Martijn van Groningen 50c345238b fix ShardUtils#getElasticsearchDirectoryReader(...) to use FilterDirectoryReader#getDelegate() 2015-08-03 09:54:56 +02:00
Robert Muir 8d5b5ad862 restore my lost code changes and add measures to detect/prevent this in the future 2015-07-31 13:00:24 -04:00
Igor Motov 354504334f Create a directory during repository verification
The repository verification process should create a subdirectory to make sure we check permission of newly created directories in case elasticsearch processes on different nodes are running using different uids and creating blobs with incompatible permissions.

Closes #11611
2015-07-31 12:11:05 -04:00
Robert Muir f804ec3cd9 cleanup 2015-07-31 10:05:11 -04:00
Robert Muir fd8e92a18a don't represent site plugins with 'null' anymore 2015-07-31 09:41:39 -04:00
Lee Hinman 5a8356c86e Reroute shards when a node goes under disk watermarks
Previously we issued a reroute when a node went over the high watermark
in order to move shards away from the node. This change tracks nodes
that have previously been over the high or low watermarks and issues a
reroute when the node goes back underneath the watermark.

This allows shards that may be unassigned to be assigned back to a node
that was previously over the low watermark but no longer is.

Resolves #12422
2015-07-30 16:32:54 -06:00
Robert Muir ba63d57e82 don't lose stacktrace if a plugin somehow makes jar hell 2015-07-30 15:56:33 -04:00
Alexander Reelsen a8310d0575 Tests: Fix CLI help checking tests under windows
As windows has different line endings and this has
already been fixed by another test, the method has been
moved into CliToolTestCase.

In addition one test has been removed, as it was redundant.
2015-07-30 16:12:14 +02:00
Alexander Reelsen 69d7f1a78a Startup: Remove getopt parsing in shell script, use java CLITool
In order to ensure, we have the same experience across operating systems
and shells, this commit uses the java CLI parser instead of the shell
getopt parsing to parse arguments.

This also allows for support for paths, which contain spaces.

Also commons-cli depdency was upgraded to 1.3.1 and tests have been added.

Changes

* new exit code, OK_AND_EXIT, allowing to tell the caller to exit, as everything
  went as expected (e.g. when running a version output)

BWC breaking:

* execute() returns an ExitStatus instead of an integer, otherwise there is no
  possibility to signal by a command, if the JVM should be exited after a run.
  This affects plugins, that have command line tools
* -v used to be version, but is a verbose flag by default in the current CLI infra,
  must be -V or --version now
* -X has been removed - the current implementation was useless anyway, as
  it prefixed those properties with "es.". You should use
  ES_JAVA_OPTS/JAVA_OPTS for JVM configuration
2015-07-30 13:20:29 +02:00
Martijn van Groningen b3b34668e8 made `dateMathExpressionResolver` final 2015-07-30 11:34:10 +02:00
Adrien Grand 23fa535bfa Upgrade HDRHistogram to version 2.1.6.
This release fixes https://github.com/HdrHistogram/HdrHistogram/pull/68 which
we have been hitting in our CI tests, for instance:
http://build-us-00.elastic.co/job/es_core_master_metal/10567/
2015-07-30 09:55:12 +02:00
Dave Parfitt 2d2f21e760 Merge pull request #12534 from metadave/feature/cat_nodeattrs
Add _cat/nodeattrs API
2015-07-29 17:01:22 -04:00
Dave Parfitt f209809716 Add _cat/nodeattrs API
This provides a _cat/nodeattrs API call, which presents
custom node attributes in a denormalized table.

Closes #8000
2015-07-29 16:11:18 -04:00
Martijn van Groningen 0c53204b40 Added RealtimeRequest interface and let GetRequest, MultiGetRequest, TermVectorsRequest and MultiTermVectorsRequest implement it.
This is useful because now all requests that are realtime are now grouped under the same marker interface.
2015-07-29 21:47:11 +02:00
Robert Muir c6d6eaef4d Add a run.sh to run from current source code with debugger
The maven magic needed for this is now heavier
2015-07-29 14:21:43 -04:00
Martijn van Groningen ac3d090379 Added date math support in index names
Date math index name resolution enables you to search a range of time-series indices, rather than searching all of your time-series indices and filtering the the results or maintaining aliases. Limiting the number of indices that are searched reduces the load on the cluster and improves execution performance. For example, if you are searching for errors in your daily logs, you can use a date math name template to restrict the search to the past two days.

The added `ExpressionResolver` implementation that is responsible for resolving date math expressions in index names. This resolver is evaluated before wildcard expressions are evaluated.

The supported format: `<static_name{date_math_expr{date_format|timezone_id}}>` and the date math expressions must be enclosed within angle brackets. The `date_format` is optional and defaults to `YYYY.MM.dd`. The `timezone_id` id is optional too and defaults to `utc`.

The `{` character can be escaped by places `\\` before it.

Closes #12059
2015-07-29 17:33:55 +02:00
Alexander Reelsen 86ab892986 Releases: Added version numbers & bwc indices for 1.6.2/1.7.1 2015-07-29 12:31:39 +02:00
Martijn van Groningen 5d7ed70fa0 Merge pull request #12518 from martijnvg/top_hits/bug/protected_against_crazy_size
Protected against  `size` and `offset` larger than total number of document in a shard
2015-07-29 10:33:27 +02:00
Dave Parfitt dc597f0bf5 Merge pull request #12509 from metadave/dp_snake_case_dates
Default date formats to use underscores via PUT
2015-07-28 16:57:45 -04:00
Lee Hinman 2dc4550839 Add more debugging information to the Awareness Decider
Relates to #12431
2015-07-28 13:48:40 -06:00
Jason Tedor 37177d2f4c Use consistent check whether or not timeout is set 2015-07-28 15:44:55 -04:00
Martijn van Groningen 3f6e470810 top_hits: If topN (based on `offset` + `size`) is higher than the maxDoc of an shard then normalize topN to maxDoc.
Closes #12510
2015-07-28 21:38:58 +02:00
Nik Everett d8a6ddf580 Merge _all: Stop NPE querying _all when it doesn't exist 2015-07-28 10:18:17 -04:00
Dave Parfitt af17b9cd40 Use underscores for date formats
@clintongormley

Closes #12429
2015-07-28 10:04:28 -04:00
Nik Everett adcd1fc11d _all: Add missing boost
When we rewrite to a MatchNoTermsQuery we were throwing out the boost which
could could lead to funky changes when the query against _all was in a
bool query.
2015-07-28 09:25:06 -04:00
Colin Goodheart-Smithe 2ebf229632 Aggregations: Fixes serialization of HDRHistogram in percentiles aggregations
Previously we would write the entire ByteBuffer to the stream to serialise the HDRHistogram even if it was not all needed. Now we only write the bytes that are actually written to in the ByteBuffer.
2015-07-28 14:07:06 +01:00
Colin Goodheart-Smithe 7ab9bbbfad [Test] Muted all HDRPercentilesTests and HDRPercentileRanksTests 2015-07-28 10:17:47 +01:00
Nik Everett d7491515b2 _all: Stop NPE querying _all when it doesn't exist
This can happen in two ways:
1. The _all field is disabled.
2. There are documents in the index, the _all field is enabled, but there are
no fields in any of the documents.

In both of these cases we now rewrite the query to a MatchNoDocsQuery which
should be safe because there isn't anything to match.

Closes #12439
2015-07-27 16:23:32 -04:00
Boaz Leskes 616941e902 Internal: IndicesStore shouldn't try to delete index after deleting a shard
When a node discovers shard content on disk which isn't used, we reach out to all other nodes that supposed to have the shard active. Only once all of those have confirmed the shard active, the shard has no unassigned copies *and* no cluster state change have happened in the mean while, do we go and delete the shard folder.

Currently, after removing a shard, the IndicesStores checks the indices services if that has no more shard active for this index and if so, it tries to delete the entire index folder (unless on master node, where we keep the index metadata around). This is wrong as both the check and the protections in IndicesServices.deleteIndexStore make sure that there isn't any shard *in use* from that index. However, it may be the we erroneously delete other unused shard copies on disk, without the proper safety guards described above.

Normally, this is not a problem as the missing copy will be recovered from another shard copy on another node (although a shame). However, in extremely rare cases involving multiple node failures/restarts where all shard copies are not available (i.e., shard is red) there are race conditions which can cause all shard copies to be deleted.

Instead, we should change the decision to clean up an index folder to based on checking the index directory for being empty and containing no shards.
2015-07-27 16:09:25 -04:00
Lee Hinman b8b96679ea [TEST] Mark 2 HDRPercentileRanks tests with AwaitsFix 2015-07-27 11:40:20 -06:00
Jason Tedor cdd2da1e1c Check for existence of snapshot index file before attempting delete 2015-07-27 13:28:37 -04:00
Alexander Reelsen 9628d2632f Build: Split packages into submodules
This change creates a proper `distribution` modules in which we have today packaging for
all of our four current packages:

* zip
* tar.gz
* rpm
* deb

Licenes have moved into the distribution project as well. So have the config/ and the bin/ directory
from the core/ project.

The RPM package is now built, if rpmbuild exists.

The bats tests have been moved as well.

Also the zip distribution now executes the REST integration tests.
2015-07-27 17:50:54 +02:00
Tanguy Leroux 01ae730023 Remove Core Lib directory 2015-07-27 16:52:10 +02:00
Lee Hinman 5fdc6cfc24 Revert "Revert "Consistently name Groovy scripts with the same content""
This reverts commit a33cfe4b11.
2015-07-27 08:49:47 -06:00
Colin Goodheart-Smithe 26a299d0e7 [TEST] muted HDRPercentilesTests.testScript_ExplicitSingleValued_WithParams 2015-07-27 15:42:47 +01:00
Adrien Grand a832987ada Forbid Files.isHidden.
As Robert pointed out on #12465, it has the undesirable property of relying on
the operating system. So it would be better to use a simple rule such as
checking whether the file name starts with a dot.
2015-07-27 16:13:04 +02:00
Martijn van Groningen a14913f7b6 Left over from the `query_cache` to `request_cache` rename. 2015-07-27 13:28:15 +02:00
Britta Weber 20facccaf6 Merge pull request #11666 from brwe/meta-data-zen
[TEST] remove redundant tests and move to different suite
2015-07-27 12:40:11 +02:00
Britta Weber e44c5ff703 check if index is closed or was previously closed when gathering relevant indices to write meta state
When an index is opened it will not be assigned to a node but also not have closed state
anymore. Before we only checked if an index either is closed or assigned to the data node
and therefore the change from close->open was not written.
2015-07-27 12:35:25 +02:00
Britta Weber 2713e903ab [TEST] remove redundant tests and move to different suite
Some of the test for meta data are redundant. Also, since they
somewhat test service disruptions (start master with empty
data folder) we might move them to DiscoveryWithServiceDisruptionsTests.
Also, this commit adds a test for
https://github.com/elastic/elasticsearch/issues/11665
2015-07-27 12:35:13 +02:00
Adrien Grand ec79568e6f Merge pull request #12430 from ruflin/ip_range-mask-fix
Fix cidr mask conversion issue for 0.0.0.0/0 and add tests #12005
2015-07-27 12:12:20 +02:00
javanna 8e931d5767 Query DSL: don't cache type filter in DocumentMapper
If we cache the type filter and we e.g. set its boost which is now settable on all queries, the boost will change for all subsequent queries. We should rather create a new query every time.
2015-07-27 11:35:19 +02:00
Ruflin 91d1789258 Move index creation to test setup method 2015-07-27 10:39:04 +02:00
Adrien Grand 00ae4bb792 Merge pull request #12465 from xuzha/xu-skip-hidden
skip hidden files
2015-07-27 10:06:45 +02:00
Ruflin b8c2f05ff5 Revert change to set longTo to "MAX_IP -1" and improve test suite to check for range 2015-07-27 09:11:04 +02:00
Shay Banon a99ccb6112 No need to find replica copy when index is created
There is no need to try and go fetch replica copies for best allocation when the index is created
2015-07-27 07:01:48 +09:00
xuzha b0b9c121c8 skip hidden files 2015-07-26 01:16:29 -07:00
Jason Tedor b3272fe648 Preserve the root cause when encountering an exception expecting to have reached the end of the setting stream 2015-07-25 15:29:15 -04:00
Martijn van Groningen c73fff799d Cleaned up the data structures used in MetaData for alias and index lookups.
Major changes:
* Changed MetaData to holds alias and index lookup information into a single TreeMap instead of two separate maps.
* Moved the building of the alias / index lookup to the metadata builder.
2015-07-24 22:04:11 +02:00
Jason Tedor 267afe866f Merge pull request #12451 from jasontedor/fix/12382
Add explicit check that we have reached the end of the settings stream when parsing settings
2015-07-24 13:52:00 -04:00