Commit Graph

81 Commits

Author SHA1 Message Date
Adrien Grand 6e15e08f5e Merge pull request #11693 from jpountz/fix/simplify_timestamp_dv
Simplify doc values handling for _timestamp.
2015-06-17 08:19:33 +02:00
Adrien Grand 891689ed1e Merge pull request #11697 from jpountz/fix/synchronous_fielddata_removal
Reclaim memory from fielddata synchronously when an explicit clear is performed.
2015-06-16 17:36:29 +02:00
Shay Banon 4e0d65453f Add Unassigned meta data
Unassigned meta includes additional information as to why a shard is unassigned, this is especially handy when a shard moves to unassigned due to node leaving or shard failure.

The additional data is provided as part of the cluster state, and as part of `_cat/shards` API.

The additional meta includes the timestamp that the shard has moved to unassigned, allowing us in the future to build functionality such as delay allocation due to node leaving until a copy of the shard is found.
closes #11653
2015-06-16 17:01:48 +02:00
Tanguy Leroux 3b4ca8e399 Create PID_DIR in init.d script
Since the /var/run/elasticsearch directory is cleaned when the operating system starts, the init.d script must ensure that the PID_DIR is correctly created.

Closes #11594
2015-06-16 16:16:29 +02:00
Adrien Grand 28e88e5bc0 Reclaim memory from fielddata synchronously when an explicit clear is performed.
The cache we are using for fielddata reclaims memory lazily/asynchronously. While this
helps with throughput this is an issue when a clear operation is issued manually since
memory is not reclaimed immediately. Since our clear methods already perform in linear
time anyway, this commit changes the fielddata cache to reclaim memory synchronously
when a clear command is issued manually. However, it remains lazy in case cache entries
are invalidated because segments or readers are closed, which is important since such
events happen all the time.

Close #11695
2015-06-16 12:08:39 +02:00
javanna 0a526be344 Query DSL: fix support for _name in some queries
Some of our Java api builders had wrong logic when it comes to serializing the query in json format, resulting in missing fields like _name. Also, regexp parser was ignoring the _name field.

Closes #11694
2015-06-16 12:04:51 +02:00
Adrien Grand 2bb923a06d Simplify doc values handling for _timestamp.
`_timestamp` uses NumericDocValues instead of SortedNumericDocValues like other
numeric fields since it is guaranteed to be single-valued. However, we don't
need a different fielddata impl for it since DocValues.getSortedNumeric already
falls back to NUMERIC doc values if SORTED_NUMERIC are not available.
2015-06-16 10:52:06 +02:00
Adrien Grand cdd13253de Tests: Add test case from #11692 2015-06-16 10:34:51 +02:00
David Pilato 49cd9f3be4 Merge pull request #11676 from dadoonet/maven/clean-pom
[maven] clean pom.xml

In Maven parent project, in dependency management, we should only declare which versions of 3rd party jars we want to use but not force any scope.
It makes then more obvious in modules what is exactly the scope of any dependency.

For example, one could imagine importing `jimfs` as a `compile` dependency in another module/plugin with:

```xml
<dependency>
   <groupId>com.google.jimfs</groupId>
   <artifactId>jimfs</artifactId>
</dependency>
```

But it won't work as expected as the default maven `scope` should be `compile` but here it's `test` as defined in the parent project.

So, if you want to use this lib for tests, you should simply define:

```xml
<dependency>
   <groupId>com.google.jimfs</groupId>
   <artifactId>jimfs</artifactId>
   <scope>test</scope>
</dependency>
```

We also remove `maven-s3-wagon` from gce plugin as it's not used.
2015-06-16 09:12:03 +02:00
Ryan Ernst 98a5dbb10a Merge pull request #11686 from rjernst/remove/smart-object-wrapper
Remove SmartNameObjectMapper
2015-06-16 00:00:03 -07:00
Ryan Ernst a23c5b8bbc Make conditional clearer 2015-06-15 23:59:09 -07:00
Ryan Ernst 6e75f9fc93 fix field type tests 2015-06-15 17:03:32 -07:00
Ryan Ernst 7ab0009e41 Merge pull request #11644 from rjernst/refactor/field-type-equality
Add equals/hashcode to fieldtypes
2015-06-15 15:42:53 -07:00
Ryan Ernst 5601cea083 Mappings: Remove SmartNameObjectMapper
This was previously a container for an ObjectMapper, along with the
DocumentMapper that ObjectMapper came from. However, there was
only one use of needing the associated DocumentMapper, and that
wasn't actually used.
2015-06-15 15:40:01 -07:00
Boaz Leskes 2fb8df0985 Test: NetworkPartitionTests should make sure MockTransportService is used. 2015-06-15 23:40:52 +02:00
Ryan Ernst a08f51e13b Address PR comments 2015-06-15 10:55:37 -07:00
David Pilato bd5c7d0ea2 [maven] clean pom.xml
In Maven parent project, in dependency management, we should only declare which versions of 3rd party jars we want to use but not force any scope.
It makes then more obvious in modules what is exactly the scope of any dependency.

For example, one could imagine importing `jimfs` as a `compile` dependency in another module/plugin with:

```xml
<dependency>
   <groupId>com.google.jimfs</groupId>
   <artifactId>jimfs</artifactId>
</dependency>
```

But it won't work as expected as the default maven `scope` should be `compile` but here it's `test` as defined in the parent project.

So, if you want to use this lib for tests, you should simply define:

```xml
<dependency>
   <groupId>com.google.jimfs</groupId>
   <artifactId>jimfs</artifactId>
   <scope>test</scope>
</dependency>
```

We also remove `maven-s3-wagon` from gce plugin as it's not used.
2015-06-15 17:08:15 +02:00
Adrien Grand e817393c8d Merge pull request #11669 from jpountz/remove/esoteric_fielddata_formats
Remove non-default fielddata formats.
2015-06-15 16:19:48 +02:00
Britta Weber 997550f5a2 Merge pull request #11595 from brwe/netowrk-partition-test
[TEST] remove node from nodes list if disruption is removed from node
2015-06-15 16:09:01 +02:00
Adrien Grand 14c9c239bc Remove non-default fielddata formats.
Now that doc values are the default for fielddata, specialized in-memory
formats are becoming an esoteric option. This commit removes such formats:
 - `fst` on string fields,
 - `compressed` on geo points.

I also removed documentation and tests that the fielddata cache is shared if
you change the format, since this is only true for in-memory fielddata formats
(given that for doc values, the caching is done directly in Lucene).
2015-06-15 14:05:23 +02:00
Adrien Grand 36cab80cc8 Remove SimpleLuceneTests.testAddDocAfterPrepareCommit.
It is unnecessary to test features we are not using.
2015-06-15 11:26:28 +02:00
Adrien Grand ff279275b3 Upgrade to Lucene 5.2.1. 2015-06-15 10:51:05 +02:00
Simon Willnauer 9210aeacea Restore interrupt status when InterruptedException is caught 2015-06-15 09:40:28 +02:00
Shay Banon 87f0d09ace Add version 1.7.0
it was added in 1.x, but not in master
2015-06-14 23:43:45 +02:00
Simon Willnauer 02e540384d [TEST] Use NoMergePolicy in EngineTest#testVerboseSegments
These tests rely on that there are no merges but since MP is now
random this can break the test.
2015-06-14 12:20:28 +02:00
Simon Willnauer 0ac09fde95 [TEST] Use NoMergePolicy in EngineTest#testSegments
These tests rely on that there are no merges but since MP is now
random this can break the test.
2015-06-13 21:36:13 +02:00
Simon Willnauer 58ccb39dee Use CopyOnWrite list since list is concurrently modified as well as iterated 2015-06-13 21:17:57 +02:00
Simon Willnauer 09a30e7eee Remove deprecated script APIs
The script APIs have been deprecated long ago we can now remove them.
This commit still keeps the parsing code since it might be used in a
query that is still stuck in transaction log. This issue should be discussed
elsewhere.

Closes #11619
2015-06-13 10:11:43 +02:00
Ryan Ernst 0ef5a27556 Mappings: Add equals/hashcode to fieldtypes
In order to restrict a single set of field type settings for a given
field name across an index, we need the ability to compare field types.
This change adds equals and hashcode, as well as tests for every field
type.
2015-06-12 16:32:15 -07:00
Igor Motov e34cb18f8a Core: reduce the size of the XContent parsing exception
The content that caused the exception can be potentially very big and in most cases it's not very useful for debugging.
2015-06-12 19:06:56 -04:00
Shay Banon 3a97f322f7 Simplify ShardRouting and centralize move to unassigned
Make sure there is a single place where shard routing move to unassigned, so we can add additional metadata when it does, also, simplify shard routing implementations a bit
closes #11634
2015-06-12 22:51:21 +02:00
Shaunak Kashyap 2498cf9fab Revert "Removing top-level filter parameter from search API." 2015-06-12 11:09:58 -07:00
Shaunak Kashyap ffc4255041 Merge pull request #11600 from ycombinator/gh-8862
Removing top-level filter parameter from search API.
2015-06-12 10:07:40 -07:00
Michael McCandless f152614f92 use System.nanoTime for ThreadPool's estimated time, since it's less likely to go backwards 2015-06-12 09:16:23 -04:00
Simon Willnauer 5f40f97740 Fold ShardGetService creation away from Guice into IndexShard
it's always acccessed via IndexShard and has crazy circular dependencies or
rather had. It just makes IndexShard ctor bigger for no reason.
2015-06-12 13:45:10 +02:00
Simon Willnauer fab27f1bb0 Create ShardSuggestService/Metrics manually outside of guice
This ShardSuggestService is a simple metrics counter and doesn't need
to be injected. It just makes IndexShard ctor bigger for no reason.
2015-06-12 13:36:27 +02:00
Colin Goodheart-Smithe a216062d88 Aggregations: allow users to perform simple arithmetic operations on histogram aggregations
Closes #11029
2015-06-12 09:25:52 +01:00
Boaz Leskes df8a3006fc Merge pull request #11615 from bleskes/async_fetch_non_existent_nodes
Internal: AsyncShardFetch can hang if there are new nodes in cluster state
2015-06-12 09:57:25 +02:00
Robert Muir b2ced13f3d Tests: fix test bugs so tests pass on IBM J9 (at least once) 2015-06-12 01:11:32 -04:00
Boaz Leskes 532fa0663b Internal: AsyncShardFetch can hang if there are new nodes in cluster state
The AsyncShardFetch retrieves shard information from the different nodes in order to detirment the best location for unassigned shards. The class uses TransportNodesListGatewayStartedShards and TransportNodesListShardStoreMetaData in order to fetch this information. These actions, inherit from TransportNodesAction and are activated using a list of node ids. Those node ids are extracted from the cluster state that is used to assign shards.

If we perform a reroute and adding new news in the same cluster state update task, it is possible that the AsyncShardFetch administration is based on
a different cluster state then the one used by TransportNodesAction to resolve nodes. This can cause a problem since TransportNodesAction filters away unkown nodes, causing the administration in AsyncShardFetch to get confused.

This commit fixes this allowing to override node resolving in TransportNodesAction and uses the exact node ids transfered by AsyncShardFetch
2015-06-11 23:16:09 +02:00
Igor Motov 93beea1f67 Snapshot/Restore: Move in-progress snapshot and restore information from custom metadata to custom cluster state part
Information about in-progress snapshot and restore processes is not really metadata and should be represented as a part of the cluster state similar to discovery nodes, routing table, and cluster blocks. Since in-progress snapshot and restore information is no longer part of metadata, this refactoring also enables us to handle cluster blocks in more consistent manner and allow creation of snapshots of a read-only cluster.

Closes #8102
2015-06-11 15:21:18 -04:00
Simon Willnauer 440580dd55 Cleanup MergeScheduler infrastrucutre
This commit cleans up all the MergeScheduler infrastructure
and simplifies / removes all unneeded abstractions. The MergeScheduler
itself is now private to the Engine and all abstractions like Providers
that had support for multiple merge schedulers etc. are removed.

Closes #11602
2015-06-11 20:49:42 +02:00
Lee Hinman 483a15a12b Use task's class name if not a TimedPrioritizeRunnable
This is helpful to track down the origin of pending_tasks that aren't
expected. In tests we catch this with an assert, but in production
asserts may not be enabled so we should at least add the class name.
2015-06-11 12:39:24 -06:00
Shaunak Kashyap acfb3196f4 Removing top-level filter parameter from search API 2015-06-11 09:40:31 -07:00
Simon Willnauer b0fe0096c4 [TEST] Prevent merges from being kicked off after two docs 2015-06-11 12:49:56 +02:00
Simon Willnauer f77804dad3 Bake in TieredMergePolicy
Today we provide the ability to plug in MergePolicy and
we provide the once lucene ships with. We do not recommend to change
the default and even only a small number of expert users would ever touch
this. This commit removes the ancient log byte size and log doc count
merge policy providers, simplifies the MergePolicy wiring and makes the
tiered MP the one and only default. All notions of a merge policy has been
removed from the docs and should be deprecated in the previous version.

Closes #11588
2015-06-11 11:58:30 +02:00
Britta Weber e7a99501b0 [TEST] remove node from nodes list if disruption is removed from node
If we don't remove the node from the nodes list then later clearDisruption might fail
in case we shut down the node before.
2015-06-11 09:08:10 +02:00
Ryan Ernst d372bf7d7a Merge pull request #11586 from rjernst/fix/field-names-null
Mappings: Shortcut exists and missing queries when no types/docs exist
2015-06-10 14:58:57 -07:00
Simon Willnauer 657d6dd9cf Remove MergeScheduler pluggability
Nobody should really plug in a different merge scheduler for elasticsearch.
This is too expert and might cause catastrophic failures.
2015-06-10 20:28:30 +02:00
Boaz Leskes 650950c7f4 Merge pull request #11583 from bleskes/mapper_exception_unwrap
Recovery: Fix MapperException detection during translog ops replay
2015-06-10 19:06:53 +02:00