Commit Graph

7129 Commits

Author SHA1 Message Date
Adrien Grand 36884807b3 Merge pull request #11120 from jpountz/fix/bool_parsing
Query DSL: Fix `bool` parsing.
2015-05-13 11:09:12 +02:00
Adrien Grand 11db3170cd Query DSL: Fix `bool` parsing.
In #10985 I introduced a bug that should clauses are parsed as filters while
must_not clauses should be parsed as filters.
2015-05-13 11:08:36 +02:00
Adrien Grand 44e9b75296 Mappings: Make FieldNameAnalyzer less lenient.
In case FieldNameAnalyzer does not find an explicit analyzer for a given
field name, it returns the default analyzer. This behaviour can hide bugs
where the analyzer fails to be propagated to FieldNameAnalyzer or an
analyzer is requested for a field which is not mapped.
2015-05-13 11:01:38 +02:00
Simon Willnauer 6046ecbab3 Prevent PercolateResponse from serializing negative VLong
We are using a a VLong to serialize the PercolateResponse#tookInMillis. This
can due to several `System.currentTimeMillis()` implemenation details be negative.
We should prevent the negavite value for being serialized as a VLong and make sure
we use a valid value for this in the first place

Closes #11138
2015-05-13 10:22:08 +02:00
Adrien Grand f22935b1a8 Query DSL: Make geo filters queries.
This commit replaces geo filters with queries that support two-phase iteration.
2015-05-13 09:10:49 +02:00
Ryan Ernst f766b260ba Add tests for includeInObject backcompat 2015-05-12 23:11:15 -07:00
Ryan Ernst 565ffb16f1 Mappings: Remove ability to set meta fields inside documents
A few meta fields can currently be set within a document's source.
However, the recommended way to set meta fields like this is through
the api, and setting within the document can be a performance trap
(e.g. needing to find _id in order to route the document).

This change removes the ability to set meta fields within
a document source for 2.0+ indexes.

closes #11051
closes #11074
2015-05-12 23:09:03 -07:00
Robert Muir 5deba7264c Add tests.config support to BootstrapForTesting
Several plugins (e.g. elasticsearch-cloud-aws, elasticsearch-cloud-azure, elasticsearch-cloud-gce)
have integration tests that run with actual credentials to a remote service, so test runs
need access to this file.

These all require the tester (or jenkins) to supply the file with -Dtests.config.
2015-05-12 21:23:17 -04:00
Robert Muir 4473bb4275 Remove unnecessary permissions. 2015-05-12 19:15:59 -04:00
Lee Hinman 990c3a9093 Merge remote-tracking branch 'dakrone/acquire-write-lock-on-delete' 2015-05-12 13:23:09 -06:00
Lee Hinman f7e8d7c024 [CORE] Acquire IndexWriter's `write.lock` lock before shard deletion
In `NodeEnvironment.deleteShardDirectoryUnderLock`, we will now attempt
to acquire, then release, the `write.lock` file for the Lucene index in
question to ensure that no other `IndexWriter` has the directory open
before deleting the data.

Note that the `write.lock` file must be released before the actual
deletion in order to allow the directory to be deleted.

Fixes #11097
2015-05-12 13:19:29 -06:00
Robert Muir 262555079c Merge pull request #11106 from rmuir/symlink
Improve path mgmt on init, better error messages, symlink support
2015-05-12 14:21:19 -04:00
Adrien Grand 6936577c6e Query DSL: Make the script filter a query.
This change changes the script filter so that it produces scorers with two-phase
iteration support instead of doc id sets with random-access.
2015-05-12 19:20:37 +02:00
Britta Weber e6f5fb82f0 Merge remote-tracking branch 'origin/master' into feature/synced_flush 2015-05-12 14:50:42 +02:00
Britta Weber 24ffcc28ac fix merge conflict in javadoc 2015-05-12 14:40:56 +02:00
Simon Willnauer a7abe0a324 Make synced flush attemp async to run it easily from a TransportAction
Today we enforce blocking which doesnt' really fit in the elasticsearch model
this commit adds async execution to the synced flush service by passing a
ActinListener to the service returing immediately.
2015-05-12 11:54:56 +02:00
markharwood 89b95dccc8 Aggregations enhancement - remove pointless term frequency lookups.
If the user has set a shard_min_doc_count setting then avoid looking up background frequencies if the term fails to meet the foreground threshold on a shard.

Closes #11093
2015-05-12 08:45:17 +01:00
Simon Willnauer 236f6ccad7 [TEST] Reduce likelyness of sync on every operation 2015-05-12 09:32:12 +02:00
Robert Muir d1defef69d Properly handle the case where symlinks are supported, but
the user is not a windows administrator (can throw IOE in this case)
2015-05-12 00:53:51 -04:00
Robert Muir 019a9410a3 SecurityBootstrap -> BootstrapForTesting, and make less things public 2015-05-12 00:34:02 -04:00
Robert Muir 2cea5f2b38 Improve path management on init:
* Properly support symlinks (e.g. /tmp -> /mnt/tmp)
* Check all configured paths up front and deliver the best exception we can when things are wrong
* Initialize securitymanager earlier
* Fix too-loud error logging of Natives root check
2015-05-12 00:20:52 -04:00
Robert Muir 7c2a8dfb9e Merge pull request #11104 from rmuir/generate_paths
Generate access to tests paths like other paths.
2015-05-11 18:32:26 -04:00
Robert Muir 3ccdde7e2a Generate access to tests paths like other paths. 2015-05-11 18:04:14 -04:00
Ryan Ernst e7618b8528 Settings: Remove file based index templates
As a follow up to #10870, this removes support for
index templates on disk. It also removes a missed
place still allowing disk based mappings.

closes #11052
2015-05-11 12:51:22 -07:00
gmarz 6dcd5bf618 [TEST] Mlockall: Removing assertTrue until we have the proper test infra 2015-05-11 13:51:59 -04:00
Britta Weber 571feec451 Merge remote-tracking branch 'origin/master' into feature/synced_flush 2015-05-11 18:21:36 +02:00
gmarz 852482844c [TEST] Only check if mlockall succeeds on Windows for now 2015-05-11 12:12:32 -04:00
Michael McCandless 08f7caa56b Use System.nanoTime when measuring elapsed time
System.currentTimeMillis is more vulnerable when the clock shifts.

Closes #11058
2015-05-11 11:24:04 -04:00
gmarz cc3f02c0a0 [TEST] Fix mlockall test when running on Windows 2015-05-11 11:09:15 -04:00
gmarz 4fc08aa019 Revert "Revert "VirtualLock implementation for Windows (mlockall equivalent)""
This reverts commit 5dc8b99365.
2015-05-11 10:17:28 -04:00
Robert Muir 4b345ca78f Merge pull request #11069 from rmuir/ban_pathutils
Ban PathUtils.get (for now, until we fix the two remaining issues)
2015-05-11 08:52:45 -04:00
Colin Goodheart-Smithe 671e3ef074 Aggregations: Fix geo bounds aggregation when longitude is 0
When the longitude is zero for a document, the left and right bounds do not get updated in the geo bounds aggregation which can cause the bounds to be returned with Infinite values for longitude

Closes #11085
2015-05-11 13:43:13 +01:00
Colin Goodheart-Smithe 75ea807e63 [TEST] Remove ScriptTransformBackwardsCompatibilityTests 2015-05-11 11:01:48 +01:00
javanna d7e585ca4f REST: Unify query_string parameters parsing
There currently are small differences between search api and count, exists, validate query, explain api when it comes to reading query_string parameters.  `analyze_wildcard`, `lowercase_expanded_terms` and `lenient` are only read by the search api and ignored by all other mentioned apis. Unified code to fix this and make sure it doesn't happen again. Also shared some code when it comes to printing out the query as part of SearchSourceBuilder conversion to ToXContent.

Extended REST spec to include all the supported params (some that were already supported weren't listed), and added REST tests (also some basic tests for count and search_exists which weren't tested at all).

Closes #11057
2015-05-11 11:32:59 +02:00
Adrien Grand d577c07768 Internal: close caches after IndicesService. 2015-05-11 11:10:00 +02:00
Simon Willnauer 5578499d61 [TEST] Only corrupt translog header today we can't detecte truncation corruption 2015-05-11 10:34:26 +02:00
Shay Banon 9bd5df1e31 [TEST] use the correct translog setting 2015-05-11 10:24:19 +02:00
Simon Willnauer 5dc8b99365 Revert "VirtualLock implementation for Windows (mlockall equivalent)"
All test runs fail on windowns with this commit.

This reverts commit 6f99f5d5b2.
2015-05-11 09:21:09 +02:00
Simon Willnauer 3f02c989dd [TEST] Fix storeStats tests if extraFS is involved 2015-05-10 20:49:37 +02:00
Britta Weber f7cfafee63 [TEST] enable inline scripting for test 2015-05-10 18:22:17 +02:00
Martijn van Groningen acdd9a5dd9 parent/child: Removed the `top_children` query. 2015-05-10 16:30:19 +02:00
javanna 9e01dedef5 Java api: remove redundant BytesQueryBuilder in favour of using WrapperQueryBuilder internally
BytesQueryBuilder was introduced to be used internally by the phrase suggester and its collate feature. It ended up being exposed via Java api but the existing WrapperQueryBuilder could be used instead. Added WrapperQueryBuilder constructor that accepts a BytesReference as argument.

One other reason why this filter builder should be removed is that it gets on the way of the query parsers refactoring, given that it's the only query builder that allows to build a query through java api without having a respective query parser.

Closes #10919
2015-05-09 15:25:55 +02:00
javanna ba243e7a9d Java api: unify SearchResponse and BroadcastOperationResponse code around shards header
Different responses hold the shards header, search, count, flush etc. The code was duplicated in two different places, centralized in RestActions.
It turns out that only the search response printed out the status field before the reason, which was added to all other broadcast responses too.

Closes #11064
2015-05-09 14:55:28 +02:00
Igor Motov d2844e0210 Internal: prevent injection of unannotated dynamic settings
Dynamic settings has to be injected into constructor with either @ClusterDynamicSettings or @IndexDynamicSettings. If annotations are not specified an empty instance of Dynamic Settings is injected that can lead to difficult to discover errors such as #10614. This commit will make any attempt to inject unannotated dynamic settings to generate a giuce error.
2015-05-08 18:38:58 -04:00
Igor Motov 573cacab54 ThreadPool: make sure no leaking threads are left behind in case of initialization failure
Our ThreadPool constructor creates a couple of threads (scheduler and timer) which might not get shut down if the initialization of a node fails. A guice error might occur for example, which causes the InternalNode constructor to throw an exception. In this case the two threads are left behind, which is not a big problem when running es standalone as the error will be intercepted and the jvm will be stopped as a whole. It can become more of a problem though when running es in embedded mode, as we'll end up with lingering threads or testing an handling of initialization failures.

Closes #9107
2015-05-08 16:16:17 -04:00
Robert Muir 38cccfb057 cleanup and ban temp files going to jvm default location 2015-05-08 15:08:13 -04:00
Robert Muir 51c71c235b Ban PathUtils.get (for now, until we fix the two remaining issues) 2015-05-08 14:42:27 -04:00
gmarz 6f99f5d5b2 VirtualLock implementation for Windows (mlockall equivalent)
Closes #8480
2015-05-08 09:25:16 -04:00
Christoph Büscher acc42d5599 Transport: read/write support for list of strings
Add support for reading and writng string lists to existing StreamInput and StreamOutput class.
2015-05-08 14:24:17 +02:00
Ryan Ernst 748a040764 fix the build, remove usage of old ES specific IAE 2015-05-07 13:13:57 -07:00
Andrew Selden c953e99324 Merge pull request #10864 from aleph-zero/issues/9606
Remove (dfs_)query_and_fetch from the REST API
2015-05-07 12:51:28 -07:00
Simon Willnauer c53bde5c7b [TEST] only roll over translog if we at least add one operation 2015-05-07 21:18:25 +02:00
Adrien Grand 1cb6af7585 Tests: Fix bad parsing of empty filters. 2015-05-07 21:06:23 +02:00
Adrien Grand a0af88e996 Query DSL: Remove filter parsers.
This commit makes queries and filters parsed the same way using the
QueryParser abstraction. This allowed to remove duplicate code that we had
for similar queries/filters such as `range`, `prefix` or `term`.
2015-05-07 20:14:34 +02:00
Ryan Ernst 6dd843426c Mappings: Remove mapper listeners
The mapper listener concept is only now used as a callback to the
MapperService when new fields are added. This change removes the
listeners, instead storing a link to the mapper service in
each doc mapper.
2015-05-07 10:17:52 -07:00
Ryan Ernst f1e0fb6b85 Merge pull request #11027 from rjernst/pr/mapper-subfields
Mappings: Remove traverse functions from Mapper
2015-05-07 08:52:38 -07:00
Alex Ksikes 4787cf701f More Like This: remove percent_terms_to_match
Users should use minimum_should_match instead.

Closes #11030
2015-05-07 14:21:29 +02:00
Britta Weber 00f8dd60fe Merge remote-tracking branch 'origin/master' into feature/synced_flush 2015-05-07 13:40:59 +02:00
Shay Banon 8128f398ca Fix NPE in PendingDelete#toString
closes #11032
2015-05-07 12:36:55 +02:00
Colin Goodheart-Smithe 8905e7297b Merge pull request #10976 from colings86/fix/10926
Allow script language to be null when parsing
2015-05-07 09:46:37 +01:00
Simon Willnauer aa184029b1 Make modifying operations durable by default.
This commit makes create, update and delete operations on an index durable
by default. The user has the option to opt out to use async translog flushes
on a per-index basis by settings `index.translog.durability=request`.

Initial benchmarks running on SSDs have show that indexing is about 7% - 10% slower
with bulk indexing compared to async translog flushes. This change is orthogonal to
the transaction log sync interval and will only sync the transaction log if the operation
has not yet been concurrently synced. Ie. if multiple indexing requests are submitted and
one operations sync call already persists the operations of others only one sync call is executed.

Relates to #10933
2015-05-07 10:14:34 +02:00
Adrien Grand 80be0f7217 Merge pull request #11002 from jpountz/fix/numeric_resolution_string_date
Mappings: `numeric_resolution` should only apply to dates provided as numbers.
2015-05-07 09:39:58 +02:00
Martijn van Groningen f7c29457d0 parent/child: Deprecated the `top_children` in favour of the `has_child` query. 2015-05-07 09:27:54 +02:00
Ryan Ernst 0b31efb328 Mappings: Remove traverse functions from Mapper
The mapper listener abstractions for object and field mappers are used
to notify the mapper service of new fields, as well as collect
all object and field mappers through a set of traversal functions.

This change removes the traversal functions in favor of simple
iteration over subfields of a mapper.
2015-05-06 23:40:07 -07:00
Simon Willnauer 00e9654006 Verify shard state if prepareCreate/prepareIndex fails
This is pretty much a workaround for the fact that we simply
close the downstream resources once the shard is closed. This means
the document parser will barf with NPE or something similar while
AlreadyClosedException would be approriate.
2015-05-07 07:06:54 +02:00
Simon Willnauer 4db689f05e Merge pull request #11018 from brwe/counter-test
[TEST] don't check shard counter if there are still write operations ongoing after test
2015-05-07 06:32:10 +02:00
Britta Weber 790318c65a [TEST] don't check shard counter if there are still write operations ongoing after test 2015-05-06 18:23:26 +02:00
Alex Ksikes ec4f12f9ef More Like This: removal of the MLT API
Removes the More Like This API, users should now use the More Like This query.
The MLT API tests were converted to their query equivalent. Also some clean
ups in MLT tests.

Closes #10736
Closes #11003
2015-05-06 18:11:11 +02:00
Colin Goodheart-Smithe c860c1b437 Merge pull request #11013 from colings86/feature/11007
Adding Sum Bucket Aggregation
2015-05-06 15:50:14 +01:00
Adrien Grand 19a6cb246e Merge pull request #10949 from jpountz/fix/wait_for_mappings_on_primary
Mappings: Wait for mappings to be available on the primary before indexing.
2015-05-06 16:22:37 +02:00
Adrien Grand 8a19bf3aed Mappings: Wait for mappings to be available on the primary before indexing.
In some cases it might happen that a mapping which is already available on the
master node is not available yet on the node that holds the primary shard.
This commit changes indexing on the primary shard so that if a dynamic update
is triggered then the index operation is re-tried until required mappings are
available locally (using cluster state observing).
2015-05-06 16:19:22 +02:00
Colin Goodheart-Smithe cf1251796f Aggregations: Adding Sum Bucket Aggregation
Closes #11007
2015-05-06 14:44:56 +01:00
Zachary Tong e70a8d4ee9 Merge pull request #10964 from polyfractal/feature/aggs_movavg_rename
Rename Moving Average models to their "common" names
2015-05-06 09:07:23 -04:00
Zachary Tong 3eb9cb913d Rename Moving Average models to their "common" names
Previously, we were using the "statistical", technically accurate name.  Instead, we
should probably use the name that people are familiar with, e.g. "Holt Winters" instead
of "triple exponential".  To that end:

- `single_exp` becomes `ewma` (exponentially weighted moving average)
- `double_exp` becomes `holt`

When the `triple_exp` is added, it will be called `holt_winters`.
2015-05-06 09:04:44 -04:00
Colin Goodheart-Smithe 72d99773dc Aggregations: Adding Average Bucket Aggregation
Also includes changes to the other bucket metric aggregations to share code

Closes #11006
2015-05-06 13:53:57 +01:00
Shay Banon 8f163ad4b0 [TEST] Randomize translog settings 2015-05-06 12:23:12 +02:00
Colin Goodheart-Smithe 644fd00714 Aggregations: x-axis units normalisation for derivative aggregation 2015-05-06 10:31:16 +01:00
Adrien Grand c355bd60a4 Mappings: `numeric_resolution` should only apply to dates provided as numbers.
Close #10995
2015-05-06 11:00:53 +02:00
Simon Willnauer 67ed182347 [TEST] Remove unexpected extraFS file check - this was wrongly added before 2015-05-06 10:48:53 +02:00
Ryan Ernst 7a7bd6086a Mappings: Remove ability to disable _source field
Current features (eg. update API) and future features (eg. reindex API)
depend on _source. This change locks down the field so that
it can no longer be disabled. It also removes legacy settings
compress/compress_threshold.

closes #8142
closes #10915
2015-05-05 22:04:18 -07:00
Robert Muir fe5af6f34d Tests: fix test bug (foo -> bar) 2015-05-06 01:03:03 -04:00
Robert Muir 5351fbd8a0 Merge pull request #10997 from rmuir/groovy_better
Load fielddata on behalf of scripts.
2015-05-05 21:26:29 -07:00
Robert Muir 020f7d7195 Load fielddata on behalf of scripts.
If we have to do the one-time loading of fieldata, it requires
more permissions than groovy scripts currently have (zero). This
is because of RamUsageEstimator reflection and so on in PagedBytes.

GroovySecurityTests only test a numeric field, so add a string field
to the test (so pagedbytes fielddata gets created etc).
2015-05-06 00:16:03 -04:00
Robert Muir f613413ce4 Merge pull request #10970 from rmuir/bad_idea
bail if ES is run as root
2015-05-05 17:09:00 -07:00
Robert Muir e4beda94f9 Merge pull request #10983 from rmuir/no_check_certificate
Let HTTPS work correctly
2015-05-05 14:47:37 -07:00
Jack Conradson 9fae152cf5 Scripting: Minor TimeZone Fix
Changed DateMethodFunctionValues to use UTC instead of GMT.  Should
not affect any existing code, but is correct and consistent.

closes #10994
2015-05-05 14:20:54 -07:00
Shay Banon b4b5603617 Merge pull request #10993 from kimchy/sync_interval_not_to_control_type
Use buffered tanslog type also when sync is set to 0
2015-05-05 23:06:11 +02:00
Nicholas Knize 0553001369 [GEO] Remove local lucene spatial package
LUCENE-6422 - PackedQuadTree enhancement - was committed in Lucene 5.2 which is now integrated w/ ES 2.0. This eliminates the need to carry our own local lucene.spatial package. This commit removes the now unnecessary files.
2015-05-05 14:24:31 -05:00
Simon Willnauer 0b256cc629 [TEST] also close wrapped readers 2015-05-05 20:46:07 +02:00
Robert Muir 11394983d9 Merge pull request #10969 from rmuir/grooooooovy
Run groovy scripts with no permissions
2015-05-05 11:36:12 -07:00
Shay Banon ebac29d8a2 Use buffered tanslog type also when sync is set to 0
When settings sync to 0, we benefit from using the buffered type, no need to change to simple, since we get a chance to fsync multiple operations (for that single operation) and not have to sync for the other ones before returning each one
2015-05-05 20:17:36 +02:00
Tanguy Leroux 3976724882 Add pid file to Environment
This commit adds the path of the PID file to the Environment. It also add it to the Security Manager since the PID file is deleted by a shutdown hook when the JVM is exited.
2015-05-05 18:39:19 +02:00
Zachary Tong 4f65130703 [TEST] Fix min/max accumulator in MovAvg tests
Double.MIN_VALUE does not follow the same semantics as Integer.MIN_VALUE.  Namely, it
represents the smallest positive, non-zero value a double can hold.  Since the test uses negative
doubles, this can incorrectly find the min/max metric for a set of values.

Instead, Double.NEGATIVE_INFINITY needs to be used, which represents the smallest value possible.

Not strictly necessary, but MAX_VALUE was switched to POSITIVE_INFINITY just to be 100% correct
2015-05-05 12:29:49 -04:00
Simon Willnauer d20202a963 Remove double exceptin handling that causes false replica failures
we already fail the shard in the `onFailure` method if the replica
operation barfs. This additional check has been added lately that
bypasses the clusterstate observer which causes replicas to fail
if the mappings are not yet present.
2015-05-05 18:04:27 +02:00
Robert Muir afdec4c84c Merge pull request #10989 from rmuir/jna_optional
ensure JNA is fully loaded when its avail, but don't fail its not
2015-05-05 09:03:16 -07:00
Robert Muir 15e6d3ec6c ensure JNA is fully loaded when its avail, but don't fail its not 2015-05-05 11:49:40 -04:00
Britta Weber dc2eed9681 fix after merge with master 2015-05-05 17:45:41 +02:00
Simon Willnauer 200174aa37 Remove Translog interface
We only have one implementation of this interface which makes not much
sense. This commit removes the abstraction.
2015-05-05 17:34:59 +02:00
Britta Weber e3d346d3b7 cleanup 2015-05-05 17:32:03 +02:00
Britta Weber 8349a3ee1e call sync flush when shard is marked as inactive 2015-05-05 17:19:09 +02:00
Robert Muir 9c0d379254 style cleanups (assume and suppressforbidden) 2015-05-05 10:59:39 -04:00
Simon Willnauer fafd67e1ae [TEST] Mute local tests with Java9EA
Relates to #10984
2015-05-05 16:50:57 +02:00
Britta Weber fbc26ca49b implement check for in flight now that we have the counter 2015-05-05 16:15:25 +02:00
Britta Weber 87af6491c9 Merge remote-tracking branch 'origin/master' into feature/synced_flush 2015-05-05 16:15:13 +02:00
Britta Weber 14e5880fea [TEST] don't fail if meta state cannot be loaded
Loading of meta state fails rarely if the state is deleted while we try to load it.
We should try again in this case instead of failing the test.
2015-05-05 15:20:57 +02:00
Robert Muir 13636dcfef Let HTTPS work correctly 2015-05-05 09:14:51 -04:00
Simon Willnauer 00d663f594 [TRANSLOG] Make translog file parsing more picky 2015-05-05 14:11:32 +02:00
Britta Weber 3cda9b2bd7 Write state also on data nodes if not master eligible
When a node was a data node only then the index state was not written.
In case this node connected to a master that did not have the index
in the cluster state, for example because a master was restarted and
the data folder was lost, then the indices were not imported as dangling
but instead deleted.
This commit makes sure that index state for data nodes is also written
if they have at least one shard of this index allocated.

closes #8823
closes #9952
2015-05-05 12:15:40 +02:00
Colin Goodheart-Smithe 12e39a0d5a Scripting: allow script language to be null when parsing
Closes #10926
2015-05-05 11:11:40 +01:00
Simon Willnauer fe5a35b68e Merge branch 'master' into pr-10624
Conflicts:
	src/main/java/org/elasticsearch/index/shard/IndexShard.java
2015-05-05 11:46:02 +02:00
Simon Willnauer 767309265b [ENGINE] Make translog fully private to the engine
This commit moves the translog creation into the InternalEngine
to ensure the transactino log is created after we acquired the write
lock on the index. This also prevents races when ShadowEngines are shutting
down due to node restarts where another node already takes over the not yet
fully synced transaction log.
2015-05-05 11:36:51 +02:00
Colin Goodheart-Smithe 123b0723fe Aggregations: Fixes Infinite values return from geo_bounds with non-zero bucket-ordinals
If the collect method was called with a bucketOrd of > 0 the arrays holding the state for the aggregation would be grown but the initial values for the bucketOrds > 0 were all set to Double.NEGATIVE_INFINITY meaning that for the bottom, posLeft and negLeft values no collected document would change the value since NEGATIVE_INFINITY is always less than every other value.

Closes #10804
2015-05-05 09:58:31 +01:00
Simon Willnauer 1bc159ebf7 mute test in favor of #10972 2015-05-05 10:04:52 +02:00
Robert Muir 6ec6567bad bail if ES is run as root 2015-05-05 01:29:57 -04:00
Robert Muir a7774f2d8b Run groovy scripts with no permissions 2015-05-05 00:33:29 -04:00
Robert Muir d62771ac5d Merge pull request #10965 from rmuir/lockdown4
make testing better mimic reality for securitymanager
2015-05-04 17:06:24 -07:00
Ryan Ernst b889b3b437 Use java sys prop override in tests instead of flag to createPermissions 2015-05-04 15:28:08 -07:00
Shay Banon 187d79b6df Centralize admin implementations and action execution
This change removes the multiple implementations of different admin interfaces and centralizes it with AbstractClient. It also makes sure *all* executions of actions now go through a single AbstractClient#execute method, taking care of copying headers and wrapping listener.
This also has the side benefit of removing all the code around differnet possible clients, and removes quite a bit of code (most of the + code is actually removal of generics and such).

This change also changes how TransportClient is constructed, requiring a Builder to create it, its a breaking change and its noted in the migration guide.

Yea another step towards simplifying the action infra and making it simpler...
2015-05-04 23:40:17 +02:00
Robert Muir 072b90296a Use the special java.ext.dirs path instead of 4 tomcat heuristics 2015-05-04 17:16:08 -04:00
Igor Motov bd453db411 Docs: clarify cluster state handling 2015-05-04 17:00:36 -04:00
Robert Muir 8e8b95faeb fix wrong comment change 2015-05-04 16:30:42 -04:00
Robert Muir 2ed2c4f884 fix permissions bugs 2015-05-04 16:27:24 -04:00
Lee Hinman eabeae980b Merge remote-tracking branch 'dakrone/sharedfs-recovery-any-node' 2015-05-04 14:15:30 -06:00
Lee Hinman 18ab718693 Allow shards on shared filesystems to be recovered on any node
Currently, when all copies of a shard are lost, we reach out to all
other nodes to see whether they have a copy of the data. For a shared
filesystem, though, we can assume that each node has a copy of the data
available, so return a state version of at least 0 for each node.

This feature is set using the dynamic index setting
`index.shared_filesystem.recover_on_any_node`, which defaults to
`false`.

Fixes #10932
2015-05-04 14:03:31 -06:00
Simon Willnauer 7e5c238998 Only mark translog committed in restore recovery 2015-05-04 21:39:17 +02:00
Robert Muir fe046df125 hacky state 2015-05-04 15:38:46 -04:00
Robert Muir 06482e8424 Use Releasables.close here 2015-05-04 14:55:10 -04:00
Robert Muir 2be1a09c77 add a null check for safety 2015-05-04 14:21:11 -04:00
Robert Muir a048f8944b Remove exitVM permission 2015-05-04 14:06:32 -04:00
Zachary Tong babfd8a181 [TEST] Stabilize MovAvgTests with more lenient floating point checks
It appears the previous failure (-Dtests.seed=D9EF60095522804F) is just accumulation of
floating point error differences between expected and actual results.  Making the tests less
stringent by requiring closeTo(0.1) instead of the previous 0.00001
2015-05-04 13:33:20 -04:00
Robert Muir 54d361259e Merge pull request #10962 from rmuir/lockdown2
Remove JNI permissions, improve JNI testing.
2015-05-04 10:22:46 -07:00
Robert Muir b8efa8ea21 Remove JNI permissions, improve JNI testing. 2015-05-04 12:30:03 -04:00
Britta Weber 7bf83ff924 ref count write operations on IndexShard
This commit adds a counter for IndexShard that keeps track of how many write operations
are currently in flight on a shard. The counter is incremented whenever a write request is
submitted in TransportShardReplicationOperationAction and decremented when it is finished.
On a primary it stays incremented while replicas are being processed.
The counter is an instance of AbstractRefCounted. Once this counter reaches 0
each write operation will be rejected with an IndexClosedException.

closes #10610
2015-05-04 18:03:29 +02:00
Ryan Ernst ba68d354c4 Merge pull request #10934 from mattweber/custom_analyzer_pos_offset_gap
document and test custom analyzer position offset gap
2015-05-04 08:56:50 -07:00
Matt Weber 63c4a214db document and test custom analyzer position offset gap 2015-05-04 08:53:45 -07:00
Britta Weber 43eae13c57 use sync id when recovering
Skip phase 1 of recovery in case an identical sync id was found on primary
and replica. Relates to #10032

closes #10775
2015-05-04 17:07:03 +02:00
Simon Willnauer 930eacd457 Merge branch 'master' into pr-10624 2015-05-04 17:06:05 +02:00
Simon Willnauer 29e5f76920 [INDICES] Wait forever (or one day) for indices to close
Today we wait 30 sec for shards to flush and close and then simply exit the process.
This is often not desired and we should by default wait long enough for shards to
close etc. This commit adds a default timeout of one day which simplifies the code
and gives us _enough_ time to shut down.

Closes #10680
2015-05-04 16:56:03 +02:00
Simon Willnauer 10ee8f7793 [ENGINE] Mark current translog as committed if initial recovery is skipped
If the initial recovery is skipped all uncommitted changes are lost. This
must be enforced otherwise primary and replica will go out of sync once the
primary is started after restore and a replica recovers from it applying the
still referenced transaction logs.
2015-05-04 16:26:24 +02:00
Simon Willnauer b5a5bc4f89 [CORE] Allow rebalancing primary shards on shared filesystems
Instead of failing the Engine for a shared filesystem, this change
allows a "soft close" of the Engine, where only the IndexWriter is
closed so that the replica can open an IndexWriter using the same
filesystem directory/mount.

Fixes #10469
2015-05-04 16:26:18 +02:00
Robert Muir 5a701c1f9f remove shutdownHooks permission 2015-05-04 10:18:09 -04:00
Robert Muir 01d6f0dc1d Merge branch 'master' into die_cwd_die
Conflicts:
	src/test/java/org/elasticsearch/client/AbstractClientHeadersTests.java
2015-05-04 09:55:29 -04:00
Britta Weber d6e0ab3a10 Merge remote-tracking branch 'origin/master' into feature/synced_flush 2015-05-04 14:21:15 +02:00
Simon Willnauer 24e73a2c83 [TRANSLOG] Remove channel refcounting for assertions
This refcounting doesn't work for shadow replicas since we open
the same translog file from more than one node while running a rolling
restart. This functionality is also superseeded by our filesystem abstraction
which detects file leaks under the hood.
2015-05-04 14:20:39 +02:00
Robert Muir f042b8f2e1 Merge pull request #10936 from rmuir/eight_point_three
simplify securitymanager init
2015-05-04 04:53:18 -07:00
Simon Willnauer bbffca193c Fail engine if metadata is corrupted on recovery start 2015-05-04 12:18:22 +02:00
Simon Willnauer 7e5f9d5628 Merge branch 'master' into pr-10624
Conflicts:
	src/main/java/org/elasticsearch/index/engine/EngineConfig.java
	src/main/java/org/elasticsearch/index/shard/IndexShard.java
	src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java
	src/test/java/org/elasticsearch/index/engine/ShadowEngineTests.java
2015-05-04 11:37:54 +02:00
Shay Banon b87d360e79 Automatically thread client based action listeners
Today, we rely on the user to set request listener threads to true when they are on the client side in order not to block the IO threads on heavy operations. This proves to be very trappy for users, and end up creating problems that are very hard to debug.
Instead, we can do the right thing, and automatically thread listeners that are used from the client when the client is a node client or a transport client.
This change also removes the ability to set request level listener threading, in the effort of simplifying the code path and reasoning around when something is threaded and when it is not.
closes #10940
2015-05-04 11:05:42 +02:00
Britta Weber 8b7b2f3cdf remove replica response from TransportShardReplicationOperation. not needed anymore 2015-05-04 10:56:34 +02:00
Simon Willnauer 23ac32e616 Remove old 0.90 shard allocator
the `even_shard` allocator has been replaced years ago in early 0.90.
We can remove it now in 2.0 since the new one is considered stable.
2015-05-04 10:48:18 +02:00
Simon Willnauer fe7d018f0c [TEST] make LuceneTest extraFS proof 2015-05-04 10:33:47 +02:00
Adrien Grand b72f27a410 Core: Cut over to the Lucene filter cache.
This removes Elasticsearch's filter cache and uses Lucene's instead. It has some
implications:
 - custom cache keys (`_cache_key`) are unsupported
 - decisions are made internally and can't be overridden by users ('_cache`)
 - not only filters can be cached but also all queries that do not need scores
 - parent/child queries can now be cached, however cached entries are only
   valid for the current top-level reader so in practice it will likely only
   be used on read-only indices
 - the cache deduplicates filters, which plays nicer with large keys (eg. `terms`)
 - better stats: we already had ram usage and evictions, but now also hit count,
   miss count, lookup count, number of cached doc id sets and current number of
   doc id sets in the cache
 - dynamically changing the filter cache size is not supported anymore

Internally, an important change is that it removes the NoCacheFilter infrastructure
in favour of making Query.rewrite specializing the query for the current reader so
that it will only be cached on this reader (look for IndexCacheableQuery).

Note that consuming filters with the query API (createWeight/scorer) instead of
the filter API (getDocIdSet) is important for parent/child queries because
otherwise a QueryWrapperFilter(ParentQuery) would run the wrapped query per
segment while relations might be cross segments.
2015-05-04 09:02:15 +02:00
Robert Muir 3a89b990ea remove another unnecessary permission 2015-05-03 23:37:05 -04:00
Robert Muir fc54ff5f10 remove now-unnecessary test permission 2015-05-02 15:19:01 -04:00
Robert Muir 86fc8ceac7 simplify security rules 2015-05-02 14:42:06 -04:00
Robert Muir 8c0d03c3ee add a hack for windows 2015-05-02 12:41:38 -04:00
Robert Muir bdd6d9c705 heisenbug 2015-05-02 12:27:38 -04:00
Robert Muir e1238c5e4c add 2 more
x
2015-05-02 12:11:33 -04:00
Robert Muir ff44f45af1 log this 2015-05-02 12:08:46 -04:00
Robert Muir db003a0b32 remove hack 2015-05-02 10:52:27 -04:00
Robert Muir 50a785c546 add a hack to see if this fixes windows issues 2015-05-01 16:41:49 -04:00
Robert Muir dbcdb40f68 fix sigar policy line that cannot be really working 2015-05-01 16:02:00 -04:00
Robert Muir 6e6949d3f4 Add debugging when security init screws up (or at trace level if you wish) 2015-05-01 15:47:50 -04:00
Robert Muir 5e87801a4b Merge branch 'master' into eight_point_three 2015-05-01 15:24:06 -04:00
Robert Muir 09ff11812e add debugging 2015-05-01 14:58:18 -04:00
Robert Muir c15f3eff3a Merge branch 'die_cwd_die' of github.com:elastic/elasticsearch 2015-05-01 12:06:02 -04:00
Robert Muir 260f5eb9ff Merge pull request #10913 from rmuir/spanspanspanspanspan
Add span within/containing queries.
2015-05-01 11:26:08 -04:00
Robert Muir aade6194b7 Add span within/containing queries.
Expose new span queries from https://issues.apache.org/jira/browse/LUCENE-6083

Within returns matches from 'little' that are enclosed inside of a match from 'big'.
Containing returns matches from 'big' that enclose matches from 'little'.
2015-04-30 23:31:31 -04:00
Igor Motov c165afb4d5 Logging: Add logging of slow cluster state tasks
Closes #10874
2015-04-30 19:13:49 -04:00
Jack Conradson aa968f6b65 Scripting: Add Field Methods
Added infrastructure to allow basic member methods in the expressions
language to be called.  The methods must have a signature with no arguments.  Also
added the following member methods for date fields (and it should be easy to add more)
* getYear
* getMonth
* getDayOfMonth
* getHourOfDay
* getMinutes
* getSeconds

Allow fields to be accessed without using the member variable [value].
(Note that both ways can be used to access fields for back-compat.)

closes #10890
2015-04-30 15:36:46 -07:00
Ryan Ernst 4ef9f3ca63 Mappings: Remove file based default mappings
Using files that must be specified on each node is an anti-pattern
from the API based goal of ES. This change removes the ability
to specify the default mapping with a file on each node.

closes #10620
2015-04-30 13:50:35 -07:00
Ryan Ernst a0451a37cc Upgrade lucene snapshot to r1677039 2015-04-30 13:43:19 -07:00
Boaz Leskes d596f5cc45 Decouple recoveries from engine flush
In order to safely complete recoveries / relocations we have to keep all operation done since the recovery start at available for replay. At the moment we do so by preventing the engine from flushing and thus making sure that the operations are kept in the translog. A side effect of this is that the translog keeps on growing until the recovery is done. This is not a problem as we do need these operations but if the another recovery starts concurrently it may have an unneededly long translog to replay. Also, if we shutdown the engine for some reason at this point (like when a node is restarted)  we have to recover a long translog when we come back.

To void this, the translog is changed to be based on multiple files instead of a single one. This allows recoveries to keep hold to the files they need while allowing the engine to flush and do a lucene commit (which will create a new translog files bellow the hood).

Change highlights:
- Refactor Translog file management to allow for multiple files.
- Translog maintains a list of referenced files, both by outstanding recoveries and files containing operations not yet committed to Lucene.
- A new Translog.View concept is introduced, allowing recoveries to get a reference to all currently uncommitted translog files plus all future translog files created until the view is closed. They can use this view to iterate over operations.
- Recovery phase3 is removed. That phase was replaying operations while preventing new writes to the engine. This is unneeded as standard indexing also send all operations from the start of the recovery  to the recovering shard. Replay all ops in the view acquired in recovery start is enough to guarantee no operation is lost.
- IndexShard now creates the translog together with the engine. The translog is closed by the engine on close. ShadowIndexShards do not open the translog.
- Moved the ownership of translog fsyncing to the translog it self, changing the responsible setting to `index.translog.sync_interval` (was `index.gateway.local.sync`)

Closes #10624
2015-04-30 23:42:50 +03:00
Adrien Grand 12c19508fb Tests: Fix test bug in aggregations' EquivalenceTests due to the change of the default min_doc_count. 2015-04-30 19:14:56 +02:00
Martijn van Groningen 7a6fe809d0 inner_hits: Don't use bitset cache for children filters.
Only parent filters should use bitset filter cache, to avoid memory being wasted.
Also in case of object fields inline the field name into the nested object,
instead of creating an additional (dummy) nested identity.

Closes #10662
Closes #10629
2015-04-30 16:56:43 +02:00
Adrien Grand e5be85d586 Aggs: Change the default `min_doc_count` to 0 on histograms.
The assumption is that gaps in histogram are generally undesirable, for instance
if you want to build a visualization from it. Additionally, we are building new
aggregations that require that there are no gaps to work correctly (eg.
derivatives).
2015-04-30 15:48:23 +02:00
Colin Goodheart-Smithe d16bf992a9 Aggregations: min_bucket aggregation
An aggregation to calculate the minimum value in a set of buckets.

Closes #9999
2015-04-30 13:34:21 +01:00
javanna 77ac4528fb Transport: read/writeGenericValue to support BytesRef
Add support for BytesRef to existing StreamInput#readGenericValue and StreamOutput#writeGenericValue

Closes #10878
2015-04-30 10:59:01 +02:00
Ryan Ernst 2fd387d378 fix dumb test copy/paste mistake 2015-04-29 23:33:43 -07:00
Ryan Ernst 79a1c38ed6 Mappings: Fix _field_names to not have doc values
When doc values were turned on a by default, most meta fields
had it explicitly disabled.  However, _field_names was missed.
This change forces doc values to be off always for _field_names
and removes the unnecessary support when creating index fields.

closes #10892
2015-04-29 23:12:16 -07:00
Ryan Ernst d8fed71fd4 Merge branch 'master' into die_cwd_die 2015-04-29 16:48:13 -07:00
Ryan Ernst 5236a3d226 fix some tests, all fast tests now pass 2015-04-29 16:32:54 -07:00
Igor Motov 8e5543dea0 Test: ignore cluster state differences on the nodes that disconnected from the master 2015-04-29 12:49:41 -04:00
Igor Motov bac135261c Test: make sure that tests are not affected by changing in address resolution settings 2015-04-29 12:49:40 -04:00
Igor Motov 38be1e8a1a Test: remove reference to the local node before comparing cluster states in ensureClusterStateConsistency 2015-04-29 12:49:40 -04:00
Simon Willnauer 9828e955f3 [TEST] enable host name resolving to gain consistent transport addresses in clusterstate 2015-04-29 12:49:40 -04:00
Simon Willnauer 58eed45ee5 [TEST] Move XContentTestUtils.java into o.e.test folder
Classes referenced by the Test base classes must be under this
package otherwise the test jar can't be used in a 3rd party application.
2015-04-29 12:49:40 -04:00
Igor Motov 478c253f89 Add support for cluster state diffs
Adds support for calculating and sending diffs instead of full cluster state of the most frequently changing elements - cluster state, meta data and routing table.

Closes #6295
2015-04-29 12:49:40 -04:00
Lee Hinman 6e1c995741 Clarify logging about disk thresholds in DiskThresholdDecider 2015-04-29 10:43:00 -06:00
David Pilato 3c3e9b63a7 fix: query string time zone not working
If you define exactly the same date range query using either `DATE+0200` notation or `DATE` and set `timezone: +0200`, elasticsearch gives back different results:

```
DELETE foo
PUT /foo
{
  "mapping": {
    "tweets": {
      "properties": {
        "tweet_date": {
          "type": "date"
        }
      }
    }
  }
}

POST /foo/tweets/1/
{
  "tweet_date": "2015-04-05T23:00:00+0000"
}
POST /foo/tweets/2/
{
  "tweet_date": "2015-04-06T00:00:00+0000"
}

GET /foo/tweets/_search?pretty
{
    "query": {
        "query_string": {
            "query": "tweet_date:[2015-04-06T00:00:00+0200 TO 2015-04-06T23:00:00+0200]"
        }
    }
}
GET /foo/tweets/_search?pretty
{
    "query": {
        "query_string": {
            "query": "tweet_date:[2015-04-06T00:00:00 TO 2015-04-06T23:00:00]",
            "time_zone": "+0200"
        }
    }
}
```

This PR fixes it and will also allow us to add the same feature to simple_query_string as well in another PR.

Closes #10477.

(cherry picked from commit 880f4a0)
2015-04-29 18:10:02 +02:00
Simon Willnauer d4463602f6 [TEST] Use a high shard delete timeout when clusterstates are delayed
`IndiceStore#indexCleanup` uses a disruption scheme to delay cluster state
processing. Yet, the delay is [1..2] seconds but tests are setting the shard
deletion timeout to 1 second to speed up tests. This can cause random not
reproducible failures in this test since the timeouts and delays are bascially
overlapping. This commit adds a longer timeout for this test to prevent these
problems.
2015-04-29 17:51:21 +02:00
Colin Goodheart-Smithe 0589adb8b4 Merge branch 'master' into feature/aggs_2_0
# Conflicts:
#	src/main/java/org/elasticsearch/search/builder/SearchSourceBuilder.java
2015-04-29 16:32:05 +01:00
javanna eb44e950d4 Java Api: remove unused private static class PartialField from SearchSourceBuilder
Partial fields have been removed from master a while ago, this is a leftover.
2015-04-29 17:26:32 +02:00
Colin Goodheart-Smithe 88aa8934a3 Merge branch 'master' into feature/aggs_2_0 2015-04-29 16:10:19 +01:00
Britta Weber a202c2a434 Revert "Write state also on data nodes if not master eligible"
This reverts commit 4088dd38cb.
2015-04-29 17:07:07 +02:00
Colin Goodheart-Smithe a33e77ff96 Muted intermittently failing tests
To reproduce the failures use `-Dtests.seed=D9EF60095522804F`
2015-04-29 16:04:29 +01:00
Colin Goodheart-Smithe 57a8885964 Merge branch 'master' into feature/aggs_2_0
# Conflicts:
#	src/main/java/org/elasticsearch/index/query/CommonTermsQueryBuilder.java
#	src/main/java/org/elasticsearch/search/aggregations/AggregationModule.java
#	src/main/java/org/elasticsearch/search/aggregations/AggregatorFactories.java
#	src/main/java/org/elasticsearch/search/aggregations/AggregatorParsers.java
#	src/main/java/org/elasticsearch/search/aggregations/InternalMultiBucketAggregation.java
#	src/main/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregator.java
#	src/main/java/org/elasticsearch/search/aggregations/metrics/InternalNumericMetricsAggregation.java
#	src/test/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregatorTest.java
2015-04-29 15:49:41 +01:00
Robert Muir 9dec558ea1 nuke more cwd usage 2015-04-29 10:43:11 -04:00
markharwood 528f6481ea Query enhancement: return positions of parse errors found in JSON
Extend SearchParseException and QueryParsingException to report position information in query JSON where errors were found. All query DSL parser classes that throw these exception types now pass the underlying position information (line and column number) at the point the error was found.

Closes #3303
2015-04-29 15:02:46 +01:00
Colin Goodheart-Smithe 3bb8ff2a92 fixed issue with eggs in percolation request for 1 shard 2015-04-29 14:55:20 +01:00
javanna 1d4df4b628 [TEST] remove source parameter validation from REST tests runner
source parameter is implicitly supported and doesn't need to be declared in rest spec. It is tested though, as every api that supports get with body can also get requests using POST with body or get with source query_string parameter.
2015-04-29 15:44:43 +02:00
Robert Muir c0587cb244 fix CWD usage in analysis tests 2015-04-29 09:44:37 -04:00
Britta Weber 4088dd38cb Write state also on data nodes if not master eligible
When a node was a data node only then the index state was not written.
In case this node connected to a master that did not have the index
in the cluster state, for example because a master was restarted and
the data folder was lost, then the indices were not imported as dangling
but instead deleted.
This commit makes sure that index state for data nodes is also written
if they have at least one shard of this index allocated.

closes #8823
closes #9952
2015-04-29 15:27:21 +02:00
Robert Muir 6bd69b74f1 Merge branch 'master' into die_cwd_die 2015-04-29 09:15:18 -04:00
Adrien Grand ccca0386ef Other indentation fixes 2015-04-29 15:14:23 +02:00
Robert Muir a7d16a1dd1 first strike against crazy CWD usages 2015-04-29 09:10:19 -04:00
Adrien Grand 891dfee0d6 Fix some indentation issues. 2015-04-29 15:06:58 +02:00
Shay Banon c55818fa2d Merge pull request #10873 from kimchy/remove_preconditions
Remove Preconditions class
2015-04-29 12:55:23 +02:00
Simon Willnauer 94d8b20611 Add multi data.path to migration guide
this commit removes the obsolete settings for distributors and updates
the documentation on multiple data.path. It also adds an explain to the
migration guide.

Relates to #9498
Closes #10770
2015-04-29 11:51:37 +02:00
Shay Banon 11bf7074d7 Remove Preconditions class
We don't need our own anymore, since we removed the Elasticsearch illegal argument exception
2015-04-29 11:37:32 +02:00
Simon Willnauer 32759398a5 added missing { 2015-04-29 10:53:33 +02:00
Simon Willnauer b4efb6c472 Remove unused / obsolete import and throws statements
This commit removes unused thorws statements when RuntimeExceptions are
mentioned in the throws statement. It also removes obsolete import statements
for java.lang.IllegalArgumentException and java.lang.IllegalStateException
2015-04-29 10:42:31 +02:00
Simon Willnauer 4f14af21c5 Remove ElasticsearchIAE and ElasticsearchISE
This commit removes ElasticsearchIAE and ElasticsearchISE in favor of
the JDKs IAE and ISE.

Closes #10794
2015-04-29 10:42:31 +02:00
Michael McCandless ab11be55a2 add another delete-by-query deprecation 2015-04-29 04:39:41 -04:00
Adrien Grand c23d550823 Merge pull request #10856 from jpountz/fix/remove_qparser_cache
Internal: Remove the query parser cache.
2015-04-29 09:45:51 +02:00
Simon Willnauer f18f623878 [TEST] Remove searchers from tracking map once they are closed 2015-04-29 09:33:20 +02:00
aleph-zero 89542facb3 Remove (dfs_)query_and_fetch from the REST API
Remove the ability to specify search type ‘query_and_fetch’ and
‘df_query_and_fetch’ from the REST API.

- Adds REST tests
- Updates REST API spec to remove ‘query_and_fetch’ and
‘df_query_and_fetch’ as options
- Removes documentation for these options

Closes #9606
2015-04-28 15:27:59 -07:00
Ryan Ernst bf09e58cb3 Mappings: Remove includes and excludes from _source
Regardless of the outcome of #8142, we should at least enforce that
when _source is enabled, it is sufficient to reindex. This change
removes the excludes and includes settings, since these modify
the source, causing us to lose the ability to reindex some fields.

closes #10814
2015-04-28 15:03:51 -07:00
Ryan Ernst 99584deae8 Mappings: Consolidate document parsing logic
The code to parse a document was spread across 3 different classes,
and depended on traversing the ObjectMapper hiearchy. This change
consolidates all the doc parsing code into a new DocumentParser.
This should allow adding unit tests (future issue) for document
parsing so the logic can be simplified.  All code was copied
directly for this change with only minor modifications to make
it work within the new location.

closes #10802
2015-04-28 14:51:47 -07:00
Ryan Ernst f6d8b12796 Mappings: Explicitly disallow multi fields from using object or nested fields
Multi fields currently parse any field type passed in.  However, they
were only intended to support copying simple values from the outter
field. This change adds validation to ensure object and nested
fields are not used within multi fields.

closes #10745
2015-04-28 14:39:39 -07:00
Shay Banon 0a61d03ea2 Remove index/indices replication infra code
now that delete by query is out, we don't need this infrastructure code. The delete by query will be implenented as a plugin, with scan scroll + bulk delete, so it will not need this infra anyhow
2015-04-28 22:49:49 +02:00
Michael McCandless cf2fb4ed0f Remove core delete-by-query implementation, to be replaced with a plugin
The current implementation is dangerous: it unexpectedly refreshes,
which can quickly cause an unhealthy index (segment explosion).  It
can also delete different documents on primary vs replicas, causing
inconsistent replicas.

For 2.0 we will replace this with an optional plugin that does a
scan/scroll search and then issues bulk delete requests.

Closes #10859
2015-04-28 16:09:04 -04:00
Boaz Leskes 7d8f39fc27 Discovery: Unicast Ping should close temporary connections after returning ping results
During pinging we open light , temporary connections to the the unicast hosts. After the pinging is done we close those. At the moment we do so before returning the results of the pings to the caller. On the other hand, in our transport logic we acquire a lock specific to the node id while opening a connection. When disconnecting from node, we have to acquire the same lock in order to guarantee the the connection opening has finished. This can cause big delays in environments where opening a connection is very slow, as the connection closing has to wait *after* the pinging was done.. This can be problematic as  it causes master election to use stale data.

Closes #10849
2015-04-28 22:32:47 +03:00
Simon Willnauer c0d3205146 Fix more download URLs 2015-04-28 20:40:14 +02:00
Brian Murphy 3ad279b8fd Add `fairness` option to KeyedLock.
This change adds the ability of a `KeyedLock` to be `fair` this means that threads will aquire the lock in the order they ask for it.
2015-04-28 12:41:29 -04:00
Adrien Grand 9d890c472b Internal: Remove the query parser cache.
The original goal of this cache was to avoid parsing the same query several
times in case several shards are held on the same node. While this might
sound like a good idea, this would only help when parsing the query takes
non-negligible time compared to actually running the query, which should not
be the case.
2015-04-28 18:05:34 +02:00
Robert Muir 88e90ecaa5 Merge pull request #10848 from rmuir/sm_cleanup2
Remove reflection permission for sun.management.
2015-04-28 12:01:41 -04:00
Simon Willnauer 87cf1452d5 [REST] Render non-elasticsearch exception as root cause
if we don't have an ElasticsearchException as the wrapper of the
actual cause we don't render a root cause today. This commit adds
support for 3rd party exceptions as root causes.

Closes #10836
2015-04-28 17:46:31 +02:00
Lee Hinman 04f6067c66 Merge branch 'pr/10845' 2015-04-28 09:13:26 -06:00
Simon Willnauer bc3136a345 [TEST] Cleanup Direcotry and Searcher mock code
We deployed our own code to check if directories are closed etc an d
if serachers are still open. Yet, since we don't have a global cluster
anymore we can just use lucene's internal mechanism to do that. This commit
removes all special handling and usese LuceneTestCase.closeAfterSuite to
fail if certain resources are not closed

Closes #10853
2015-04-28 17:11:39 +02:00
Nik Everett cb89a14010 Add default to field_value_factor
field_value_factor now takes a default that is used if the document doesn't
have a value for that field. It looks like:
"field_value_factor": {
  "field": "popularity",
  "missing": 1
}

Closes #10841
2015-04-28 11:06:24 -04:00
Simon Willnauer 4f0492a780 [TEST] Run tests with 1 or 2 nodes by default
This commit adds support for running with only one node and sets the
maximum number of nodes to 3 by default. if run with test.nighly=true
at most 6 nodes are used. This gave a 20% speed improvement compared to
the previoulys minimum number of nodes of 3.
2015-04-28 14:38:53 +02:00
javanna b8caa52e7c [TEST] make CountRequestBuilder#toString and SearchRequestBuilder#toString tests non platform dependent 2015-04-28 14:25:00 +02:00
Boaz Leskes 54f2a91aff Test: testMinimumMasterNodes should use at least min_master_nodes unicast hosts 2015-04-28 13:09:00 +03:00
javanna c914134355 Scripting: remove groovy sandbox
Groovy sandboxing was disabled by default from 1.4.3 on though since we found out that it could be worked around, so it makes little sense to keep it and maintain it.

Closes #10156
Closes #10480
2015-04-28 11:27:50 +02:00
Robert Muir c9ccfb6341 Remove reflection permission for sun.management.
This is no longer needed after #10553
2015-04-28 05:25:42 -04:00
javanna 371bc5a6b3 Java api: implement toString in CountRequestBuilder
Similarly to what SearchRequestBuilder does, we print out a string representation of the query that the count request builder holds.

Closes #5555
2015-04-28 11:22:15 +02:00
javanna 78608536e2 Java api: SearchRequestBuilder#toString to print out the query without wiping the request source
Best effort to print out the search source depending on how it was set to the SearchRequestBuilder, don't call `internalBuilder() as that causes the content of the request to be wiped.

Closes #5576
2015-04-28 11:22:15 +02:00
Robert Muir 10f2e0e2ba Merge pull request #10844 from rmuir/sm_cleanup
Security manager cleanups
2015-04-28 05:12:07 -04:00
Tanguy Leroux 8b0674c18d Tests: Add backward compatibility test for cluster state with blocks 2015-04-28 10:50:53 +02:00
Jun Ohtani 933edf7bcc Analysis: Fix wrong position number by analyze API
Add breaking chages comment to migrate docs
Fix the stopword included text using stopword filter
2015-04-28 17:44:41 +09:00
Tanguy Leroux 2ce0ea15b0 Internal: Remove deprecated METADATA cluster block level
This commit removes the deprecated ClusterBlockLevel.METADATA, replaced in #9203 with METADATA_READ and METADATA_WRITE.
2015-04-28 10:25:06 +02:00
Isabel Drost-Fromm 180403fc32 Fix JSON encoding for Mustache templates.
This pull request replaces the current self-made implementation of JSON encoding special chars with re-using the Jackson JsonStringEncoder. Turns out the previous implementation also missed a few special chars so had to adjust the tests accordingly (looked at RFC 4627 for reference).

Note: There's another JSON String encoder on our classpath (org.apache.commons.lang3.StringEscapeUtils) that essentially does the same thing but adds quoting to more characters than the Jackson Encoder above.

Relates to #5473
2015-04-28 10:11:45 +02:00
Ryan Ernst 5812753dbc Backcompat: Add test for missing filter
The _field_names field was fixed in 1.5.1 (#10268) to correctly be
disabled for indexes before 1.3.0.  However, only the exists filter
was updated to check this enabled flag on 1.x/1.5. The missing
filter on those branches still checks the field type to see if it
is indexed, which causes the filter to always try and use
the _field_names field for those old indexes.

This change adds a test to the old index tests for missing filter.

closes #10842
2015-04-28 01:08:12 -07:00
Robert Muir f599c237bd Security manager cleanups
1. initialize SM after things like mlockall. Their tests currently
   don't run with securitymanager enabled, and its simpler to just
   run mlockall etc first.
2. remove redundant test permissions (junit4.childvm.cwd/temp). This
   is alreay added as java.io.tmpdir.
3. improve tests to load the generated policy with some various
   settings and assert things about the permissions on configured
   directories.
4. refactor logic to make it easier to fine-grain the permissions later.
   for example we currently allow write access to conf/. In the future
   I think we can improve testing so we are able to make improvements here.
2015-04-27 20:29:57 -04:00
Lee Hinman 240bcc3f08 Don't create a new BigArrays instance for every call of `withCircuitBreaking`
Since the circuit breaking service doesn't actually change for
BigArrays, we can eagerly create a new instance only once and use that
for all further invocations of `withCircuitBreaking`.
2015-04-27 12:47:56 -06:00
Zachary Tong 935144a064 review comment fixes 2015-04-27 14:32:20 -04:00
Colin Goodheart-Smithe 31f26ec115 review comment fixes 2015-04-27 17:10:03 +01:00
Simon Willnauer d164526d27 Remove `_shutdown` API
Thsi commit removes the `_shutdown` API entirely without any replacement.
Nodes should be managed from the operating system not via REST APIs
2015-04-27 17:19:36 +02:00
Adrien Grand 2f777e4736 Release: Add bw indices for 1.4.5 and 1.5.2. 2015-04-27 13:56:02 +02:00