Commit Graph

10969 Commits

Author SHA1 Message Date
Simon Willnauer cef1c97ad4 [TEST] Add percolate type to the mapping 2015-02-18 16:06:28 +01:00
Christoph Büscher 6d41601b4e Aggregations: Format bucket key_as_string in `date_histogram` according to `time_zone`
Change bucket key_as_string to reflect `time_zone` parameter. Currently `time_zone`
shifts bucket boundaries to other time zone, but keys are displayed in UTC, so e.g.
daily buckets in "+01:00" time zone have key_as_string like "2014-01-01T23:00:00Z". With this
change the default is to format this dates according to the local time zone, so the
above bucket key would be "2014-01-02T00:00:00+01:00".

Closes #9710
Closes #9744
2015-02-18 15:49:38 +01:00
Simon Willnauer 4125e406c7 [TEST] prevent stackoverflow in mockInternalEngine 2015-02-18 14:40:22 +01:00
Simon Willnauer 8c3cb6c613 [TEST] don't cache store stats in tests that ensure stats are correct 2015-02-18 14:02:23 +01:00
Simon Willnauer dd740c2763 [TEST] remove wrong assertion - stream must be closed to assert the size 2015-02-18 13:54:14 +01:00
Simon Willnauer ddd16deb1d [ENGINE] Flush IndexWriter to disk on close and shutdown
Today we trash everything that has been indexed but not flushed to disk
if the engine is closed. This might not be desired if we shutting down a
node for restart / upgrade or if we close / archive an index. In such a
case we would like to flush the transaction log and commit everything to
disk. This commit adds a flag to the close method that is set on close
and shutdown but not when we remove the shard due to relocations
2015-02-18 13:41:28 +01:00
Simon Willnauer 85c611a1b7 [STORE] Add simple cache for StoreStats
this commit tries to reduce the filesystem calls to fetch metadata
by using a simple cache on top of the stats call.

Relates to #9683
2015-02-18 12:29:39 +01:00
Michael McCandless a7e238dbb8 Test: include dir listing when check index fails 2015-02-18 04:31:53 -05:00
David Pilato 3c2414128c Rename Maven repository id
We are using repository ids with spaces in our `pom.xml`. Although it's not forbidden, a common practice is to avoid space in id.

This commit changes codehaus snapshots and lucene snapshots to a consistent naming (using a dash, all lowercase).
We also add a name which is used by Maven when displaying some information about the repository.

This naming is also consistent with [elasticsearch-parent project](https://github.com/elasticsearch/elasticsearch-parent) which will be used in the next future in 1.x and master branch.

**Important note**: If you have trouble to compile elasticsearch or a plugin using `mvn compile` and hit a `Access denied to: [URL_HERE], ReasonPhrase: Forbidden. -> [Help 1]`, you can remove related maven files:

```sh
find ~/.m2/repository -name _remote.repositories -exec rm -v {} \;
find ~/.m2/repository -name _maven.repositories -exec rm -v {} \;
```

Another option is to tell Maven not using those files with `--llr`:

```sh
mvn compile --llr
```
2015-02-17 20:39:04 +01:00
Lee Hinman a22bd493a4 [CORE] move InternalEngine.segmentStats() into abstract Engine 2015-02-17 10:17:12 -07:00
Martijn van Groningen add4339446 Added nested scope to query parse context that keeps track the current nested level during search request parsing.
The nested scope is set by any nested feature, so that sub nested queries and filters know about their context and these sub nested queries and filters can construct the right parent filter.
Removed the LateBindingParentFilter workaround in the nested query parser in favour of the nested scope maintained in the query parse context.
Due to this change nested queries and filters can now also be included in nested sorting and inner hits, because those features also now use the nested scope.

This change doesn't fix the usage of nested filters in nested and reverse_nested aggregations. The `nested` filter shouldn't be used inside these aggregations and instead the `nested` and `reverse_nested` aggs should be used to query on the right level. In a different change `nested` inside a `nested` and `reverse_nested` aggregation should result in a parse error.

Closes #9305
2015-02-17 17:53:46 +01:00
Simon Willnauer 41fd4d8722 [GATEWAY] Don't rename recovery translog in gateway
we used to reuse files / write them twice in translog. Today we don't
do this anymore so the rename logic is unneeded.
2015-02-17 12:55:48 +01:00
Simon Willnauer 2e3c6a9118 [ENGINE] Move more methods into abstract Engine 2015-02-17 11:04:46 +01:00
Simon Willnauer 1b8d8da648 [TEST] use util method to propperly shudtown threadpools 2015-02-17 09:32:50 +01:00
Christoph Büscher 30fd70f07b Aggregations: Simplify time zone option in `date_histogram`
Removed the existing `pre_zone` and `post_zone` option in `date_histogram` in favor of
the simpler `time_zone` option. Previously, specifying different values for these could
lead to confusing scenarios where ES would return bucket keys that are not UTC.
Now `time_zone` is the only option setting, the calculation of date buckets to take place in the
preferred time zone, but after rounding converting the bucket key values back to UTC.

Closes #9062
Closes #9637
2015-02-16 16:54:06 +01:00
Alex Ksikes 455a85dc3b Term Vectors: requests are now timed
When asking for term statistics, generating term vectors on the fly or with
`dfs` set to `true`, some requests may take a while, so it is useful to know
exactly how long.

Closes #9583
2015-02-16 14:08:15 +01:00
Adrien Grand 9f4c56a7b8 Internal: Remove XCollector.
We don't actually need this interface, we can just run the post-collection
operation once collection is finished on impls that need it.

Close #9677
2015-02-16 12:03:54 +01:00
Adam 460e8d34fc Removed 'Master' from names.txt
Fixes #9698
2015-02-16 10:59:50 +00:00
Simon Willnauer 0698af93c2 [BUILD] Add marvel and license to the release script 2015-02-16 09:46:12 +01:00
Alexander Reelsen 5092904885 Packaging: Add antlr and asm dependencies 2015-02-13 23:55:35 +01:00
Lee Hinman 305ba33710 [CORE] Move as much as possible into abstract Engine
This paves the way for more shared code between the `InternalEngine` and
`ShadowEngine` by way of the abstract `Engine` class. No actual
functionality has been changed.
2015-02-13 14:43:58 -07:00
Blake Niemyjski 8cba6c3abb Fixed an invalid query
Closes #9682
2015-02-13 21:11:42 +01:00
Christoph Büscher c597d8d56b Aggregations: Prevent negative intervals in date_histogram
Negative settings for interval in date_histogram could lead to OOM errors in conjunction
with min_doc_count=0. This fix raises exceptions in the histogram builder and the
 TimeZoneRounding classes so that the query fails before this can happen.

Closes #9634
Closes #9690
2015-02-13 16:05:46 +01:00
Simon Willnauer 616d0c044f remove dead code 2015-02-13 13:43:00 +01:00
Simon Willnauer 287fab46a1 [STORE] use Directory#fileLength() less during calculating checksums 2015-02-13 13:42:11 +01:00
Simon Willnauer 09eb8d1383 [RECOVERY] Handle corruptions during recovery finalization
Today we sometimes have to transfer files without verifying the checksum
ie. if the file had an old alder32 checksum but was using random access
while writing such that we can only verify they files length. We will likely
not detect corruptions there and with the new checks during recovery finalization
we might run into corrupt index exceptions in that stage. This causes
the primary to be failed as well since we don't handle the exception today. This commit
adds better handling and a test for this scenario.
2015-02-13 12:10:37 +01:00
Boaz Leskes c9480783b3 Rest: expose `master_timeout` flag on `GET _template` & `HEAD _template`
These are master level operation but we currently don't expose this parameter

Closes #9688
2015-02-13 11:25:26 +01:00
Boaz Leskes 51ba120b54 Internal: only ack index store deletion on data nodes
When an index is deleted we wait on all nodes to ack the delete. Data nodes are expected to both ack the remove of the index from their IndicesService and also the deletion of the store from disk. At the moment all nodes sends this ack which causes wrong counting on the master side. On top of this, we currently have an unneeded WARN message in the logs when client nodes try to acquire locks but do not have a data folder.

Relates to #9605

Closes #9672
2015-02-13 10:38:41 +01:00
Simon Willnauer 8dad914a1c Remove obsolet deleteFile call in Store 2015-02-13 10:18:52 +01:00
javanna 8c0ea251f7 [TEST] declare support for groovy-scripting feature in the Java REST tests runner
Groovy was disabled by default, but we turn it on in our test infra. We can then declare support for it so we go and execute script related tests as part of the REST tests suite.
2015-02-13 16:18:28 +11:00
javanna c8b9228dd6 [TEST] allow to disable REST spec validation
With #9629 we introduced REST spec validation, which barfs whenever the REST spec don't follow the defined conventions. That said, we sometimes execute tests against previous branches and tags which have spec that needs fixing but we can't go back and fix them. We now support the `-Dtests.rest.validate_spec` system property that allows to turn off REST spec validation (enabled by default) so that we can still run tests against old branches/tags.
2015-02-13 15:50:34 +11:00
Ryan Ernst 1e67b9edbd Fix test failure resulting from #8872 change. 2015-02-12 13:59:59 -08:00
Clinton Gormley 75e7ce9c51 REST Test: Lucene segment format can have two or three numbers: 4.10.2 or 4.9 2015-02-12 19:59:43 +01:00
Ryan Ernst 533fdbdf75 Mappings: Remove support for field access by short name
When multiple fields under object fields share the same name, accessing
by short name is ambiguous.  This removes support for short names,
always requiring the full name when used in queries.

closes #8872
2015-02-12 09:58:37 -08:00
Clinton Gormley 93fe4495ae REST tests - add feature groovy_scripting to skip tests if groovy not enabled 2015-02-12 18:08:35 +01:00
Clinton Gormley 36758ce81b Fixed cat.segments and indices.segments tests - bad YAML indenting 2015-02-12 17:35:19 +01:00
Andreas Kohn 01b8479179 Allow configuration of the GC log file via an environment variable
Enabling GC logging works now by setting the environment variable ES_GC_LOG_FILE
to the full path to the GC log file. Missing directories will be created as needed.

The ES_USE_GC_LOGGING environment variable is no longer used.

Closes #8471
Closes #8479
2015-02-12 17:07:57 +01:00
Boaz Leskes 35f6496694 Internal: Pending Task listing should account for task being nulled
This caused by #9671 and #9621 working together and cause an NPE
2015-02-12 15:50:54 +01:00
Alexander Reelsen ce24e10783 Testing: Ensure RepeatOnExceptionRule is available in test-jar
This moves the rule, so it is made available in the test.jar. In
addition, you can now specify the exception, which triggers a rerun
of the test in order to make it reusable for others.

Also ensured that the NettyTransportTest frees all resources inside
of its testing method instead of pre/post running methods, as those
are still called only once, even though a failed test might be repeated.
2015-02-12 15:12:54 +01:00
Victor Buldakov f500293ffb Dependencies: Update joda-time to v2.7
Closes #9338
Closes #9610
2015-02-12 15:06:18 +01:00
Boaz Leskes d6e9101f42 Internal: Introduce TimedPrioritizedRunnable base class to all commands that go into InternalClusterService.updateTasksExecutor
At the moment we sometime submit generic runnables, which make life slightly harder when generated pending task list which have to account for them. This commit adds an abstract TimedPrioritizedRunnable class which should always be used. This class also automatically measures time in queue, which is needed for the pending task reporting.

Relates to #8077

Closes #9354
Closes #9671
2015-02-12 15:05:34 +01:00
Christoph Büscher 41befaf6b5 Change behaviour of indices segments api to allow no indices
Using '_cat/segments' or the indices segments api without matching any index
now returns empty result instead of throwing IndexMissingException.

Closes #9219
2015-02-12 14:42:15 +01:00
Adrien Grand de41981373 Aggs: Refactor aggregations to use lucene5-style collectors.
Aggregators now return a new collector instance per segment, like Lucene 5 does
with its oal.search.Collector API. This is important for us because things like
knowing whether the field is single or multi-valued is only known at a segment
level.

In order to do that I had to change aggregators to notify their sub aggregators
of new incoming segments (pretty much in the spirit of #6477) while everything
used to be centralized in the AggregationContext class. While this might slow
down a bit deeply nested aggregation trees, this also makes the children
aggregation and the `breadth_first` collection mode much better options since
they can now only replay what they need while they used to have to replay the
whole aggregation tree.

I also took advantage of this big refactoring to remove some abstractions that
were not really required like ValuesSource.MetaData or BucketAnalysisCollector.
I also splitted Aggregator into Aggregator and AggregatorBase in order to
separate the Aggregator API from implementation helpers.

Close #9544
2015-02-12 14:13:31 +01:00
gseng d1deb6bd1e Update update-settings.asciidoc
Updating to the fields as mentioned on http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/index-modules-fielddata.html

Closes #9657
2015-02-12 13:09:16 +01:00
Clinton Gormley 856b0fa1a0 Docs: Fixed explanation of how the query string query is rewritten 2015-02-12 12:46:44 +01:00
javanna 4e94be8a37 [TEST] Introduce basic validation of our REST spec
Whenever we have an api that supports GET with a body, we always support the POST method too, as well as providing the body as a query_string parameter called `source`. Our REST spec should reflect this convention. FIxed them and introduced a hard check at parse time in our Java REST tests runner, which will cause the tests to fail if spec are not compliant.

Closes #9629
2015-02-12 22:25:17 +11:00
Clinton Gormley 20ece4acb5 Update core-types.asciidoc
Provide an example of how to disable norms

Closes #9641
2015-02-12 12:10:11 +01:00
Alexander Reelsen dfc2e6381b CliTool: CheckFileCommand checks for file existence
As a CliTool command could potentially also delete files, the
CheckFileCommand needs to check if those files exist, before
trying to get permissions/owners/groups from that path.
2015-02-12 11:36:47 +01:00
Alexander Reelsen 9cd14a5c29 CliTool: Add command to warn on permission/owner change
When using the CLI tool infrastructure, a command can potentially write
a new file. In case it overwrites an existing one, you may want to ensure
that the permissions, the owner and the group are kept the same and do not
accidentally change when overwriting those files.

This PR introduces a command that allows you to execute this check per path.

It also adds a new testing dependency, namely jimfs, which allows you to create
in-memory filesystems with certain properties (like supporting or not posix permissions
on this filesystem), so that you can test those features, without executing
tests on a certain operating system.
2015-02-12 10:10:11 +01:00
Alexander Reelsen 30a9d97a71 FileSystemUtils: Only create backup copies if files differ
The FileSystemUtils class has a helper method to create files with
a .new suffix, in case the file, which should be created already
exists. If you install plugins and those have configuration files,
even without changes, you will end up with tons of .new files.

This commit checks the file size and sha-256 sum, and only if those
differ, a .new file is actually being created.
2015-02-12 10:08:14 +01:00