Commit Graph

7129 Commits

Author SHA1 Message Date
Simon Willnauer 6dbe7d4b55 Make commitID byte[] final 2015-05-18 21:55:23 +02:00
Simon Willnauer 75b62e12a6 Merge pull request #11193 from s1monw/remove_commit_without_translog
[ENGINE] Remove the ability to flush without flushing the translog
2015-05-18 21:48:07 +02:00
Nik Everett 400abfceaf detect_noop now understands null as a valid value
If the source contrains a null value for a field then detect_noop should
consider setting it to null again to be a noop.

Closes #11208
2015-05-18 15:14:01 -04:00
Simon Willnauer 4b8ed1b0bf [TRANSLOG] Return null from read() if location generation is outdated
This behavior has changed been changed rescently to throw an IAE if
the translog we try to read from is already outdated. This is not
the expected behavior and this commit adds back the `old` way returning
`null` instead. The InternalEngine implementation will then go and ask the
lucene index for the document instead.
2015-05-18 20:14:39 +02:00
Alexander Reelsen 13e5c19dcf Test: Prevent automatic refresh in ContextAndHeaderTransportTests
In some cases due to calling checking `rarely()` the `indexRandom()` method
can potentially flush, which creates flush requests, that miss a certain
header in this test and allow the test to fail.

In addition unused configuration code for this test has been removed.
2015-05-18 18:22:48 +02:00
Adrien Grand 2999f53e86 Tests: Mark RelocationTests.testRelocationWithBusyClusterUpdateThread as @AwaitsFix. 2015-05-18 18:05:26 +02:00
Simon Willnauer 91d0580b0d Merge pull request #11200 from s1monw/cleanup_translog
Some smallish translog cleanups
2015-05-18 17:41:31 +02:00
Simon Willnauer a21e4449b7 Added additional assertion that the view to remove was actually registered. 2015-05-18 17:14:06 +02:00
Simon Willnauer bc810e1320 remove NoopOutputStream 2015-05-18 17:05:36 +02:00
Simon Willnauer 651c067fae Cleanup translog operation serialization
We used to double write the translog operation which is not needed except
of for recovery. This commit cuts over to a big-array based temporary serialiation
and removes the crazy double writing.
2015-05-18 17:05:36 +02:00
Simon Willnauer 60b66a7235 [TRANSLOG] Fold Translog.View into it's only implementation 2015-05-18 17:05:36 +02:00
Adrien Grand a75cfb42de Mappings: Make DocumentMapper.refreshSource() private.
This method should not be public, we should refresh the source automatically
when we change mappings.
2015-05-18 17:05:02 +02:00
Simon Willnauer 8aef499aaa review comments 2015-05-18 17:00:47 +02:00
Simon Willnauer 470e875445 Decrement reference even if IndexShard#postRecovery barfs
This can cause a reference leak if we call `IndexShard#postRecovery`
on an already closed shard.
2015-05-18 16:58:41 +02:00
Simon Willnauer bba1528fa4 [TEST] Enable MockFS on InternalEngineTests and TranslogTests 2015-05-18 16:58:19 +02:00
Simon Willnauer 7d1eb6e900 [ENGINE] Close Translog if initial commit fails 2015-05-18 16:52:49 +02:00
Adrien Grand 33adbe6082 Recovery: No need to send mappings to the master node on phase 2.
Now that mapping updates are synchronous, it is not necessary to send mappings
to the master node during the recovery process anymore: they will already be on
the master node since we ensure mappings are on the master node before indexing.
2015-05-18 16:38:13 +02:00
Adrien Grand 2c241e8a36 Mappings: Remove the `ignore_conflicts` option.
Mappings conflicts should not be ignored. If I read the history correctly, this
option was added when a mapping update to an existing field was considered a
conflict, even if the new mapping was exactly the same. Now that mapping updates
are smart enough to detect conflicting options, we don't need an option to
ignore conflicts.
2015-05-18 15:28:23 +02:00
Alexander Reelsen 8bdfd21b70 Internal: Propagate headers & contexts to sub-requests
Whenever a query parser (or any other component) issues another
request as part of a request, the headers and the context has to
be supplied as well.

In order to do this, the `SearchContext` has to have those headers
available, which in turn means, the shard level request needs to
copy those from the original `SearchRequest`

This commit introduces two new interface to supply the needed methods
to work with context and headers.

Closes #10979
2015-05-18 14:50:16 +02:00
Simon Willnauer 98640310c2 Remove dead code / unused class 2015-05-18 14:32:36 +02:00
Britta Weber 64956d2d87 add check at end of each test to see if documents are the same 2015-05-18 12:19:20 +02:00
Britta Weber f039c5de7a add rest statuses but need to discuss if they are the right ones 2015-05-18 11:06:36 +02:00
Simon Willnauer 7892c7c869 remove flushing before running checkindex 2015-05-18 11:03:11 +02:00
Adrien Grand 61a31dd57f Tests: Add information about shards that are not closed when the filter cache gets closed. 2015-05-18 10:42:45 +02:00
Britta Weber c4f9a41581 more comments and formatting 2015-05-18 10:41:13 +02:00
Simon Willnauer 6c56cedf9a Prevent MockStore where commits should be prevented on close 2015-05-18 10:12:15 +02:00
Simon Willnauer 03e5149994 [ENGINE] Remove the ability to flush without flushing the translog
This is a leftover from the times where we failed a flush when
recoveries are ongoing. This code is really not needed anymore and
we can luckily flush the translog all the time as well.
2015-05-18 09:56:25 +02:00
Simon Willnauer 8b8ba9a44f Implement toXContent on ShardOpertionFailureException
ShardOperationFailureException implementations alread provide structured
exception support but it's not yet exposed on the interface. This change
allows nice rendering of structured REST exceptions also if searches fail on
only a subset of the shards etc.

Closes #11017
2015-05-18 09:54:04 +02:00
Simon Willnauer f7696ec149 Merge pull request #11143 from elastic/feature/translog_checkpoints
Add translog checkpoints to prevent translog corruption

Closes to #10933
Relates to #11011
2015-05-18 09:42:51 +02:00
Adrien Grand b16e47c5fb Tests: Mark IndexCacheableQueryTests.testCache as @AwaitsFix. 2015-05-18 08:38:10 +02:00
Britta Weber 6ed472f873 comments for SyncedFlushService 2015-05-17 22:12:31 +02:00
Britta Weber 9ca17f834b inherit from BroadcastOperationRequest 2015-05-17 21:42:27 +02:00
Britta Weber 771763ae58 add error for inactive primary 2015-05-17 21:34:35 +02:00
Britta Weber a0315b5cb8 remove FAILED suffix 2015-05-17 21:29:31 +02:00
Britta Weber fcea10113c remove impl details from method name 2015-05-17 21:29:31 +02:00
Britta Weber 5ac07481eb assign variables 2015-05-17 21:29:31 +02:00
Britta Weber 018ad0bd76 final 2015-05-17 21:29:30 +02:00
Britta Weber 81e3d5cdcb use imutable object for commit id 2015-05-17 21:29:24 +02:00
Simon Willnauer 54ae0a557d [TEST] use correct index name created for this test 2015-05-17 20:26:13 +02:00
Simon Willnauer f9f0e99eae Merge branch 'master' into feature/translog_checkpoints
Conflicts:
	src/main/java/org/elasticsearch/index/engine/InternalEngine.java
2015-05-17 20:11:19 +02:00
Igor Motov 1038933832 Snapshot/Restore: Fix cluster state task name for update snapshot task
This commit fixes the name of the upated_snapshot task from something like "update_snapshot [org.elasticsearch.cluster.metadata.SnapshotMetaData$Entry@de00bc50]" to a more readable "update_snapshot [test-snap]"
2015-05-15 19:54:35 -04:00
Lee Hinman 22ae561bfd [GATEWAY] When using `recover_on_any_node`, respect Deciders
When in a shared filesystem environment and recovering the primary to
any node. We should respect the allocation deciders if possible (still
force-allocting to another node if there aren't any "YES" decisions).

The AllocationDeciders should take precedence over the shard state
version when force-allocating an unassigned primary shard.
2015-05-15 16:08:03 -06:00
Robert Muir b2a0ed3878 allow mockito to be used in tests 2015-05-15 16:33:24 -04:00
Robert Muir fc73540aac include rest tests in test-framework.jar
Closes #11192 which I accidentally already closed.

Squashed commit of the following:

commit f23faccddc2a77a880841da4c89c494edaa2aa46
Author: Robert Muir <rmuir@apache.org>
Date:   Fri May 15 16:04:55 2015 -0400

    Simplify this FileUtils even more: its either from the filesystem, or the classpath,
    not both. Its already trying 4 different combinations of crazy paths for either of these anyway.

commit c7016c8a2b5a6043e2ded4b48b160821ba196974
Author: Robert Muir <rmuir@apache.org>
Date:   Fri May 15 14:21:37 2015 -0400

    include rest tests in test-framework jar
2015-05-15 16:16:24 -04:00
Simon Willnauer 217fd4443a Make SearchFactory static class in InternalEngine
Now that lucene provides a way to identify if the warming reader is
the first initial opened reader we can detach this class from the
enclosing and make it static. This is important since it might access
not fully initialized members of the enclosing class since it's initialized
and used during constructor invocation.
2015-05-15 22:02:00 +02:00
javanna a843008b17 Highlighting: require_field_match set to true by default
The default `false` for `require_field_match` is a bit odd and confusing for users, given that field names get ignored by default and every field gets highlighted if it contains terms extracted out of the query, regardless of which fields were queries. Changed the default to `true`, it can always be changed per request.

Closes #10627
Closes #11067
2015-05-15 21:38:45 +02:00
javanna 46c521f7ec Highlighting: nuke XPostingsHighlighter
Our own fork of the lucene PostingsHighlighter is not easy to maintain and doesn't give us any added value at this point. In particular, it was introduced to support the require_field_match option and discrete per value highlighting, used in case one wants to highlight the whole content of a field, but get back one snippet per value. These two features won't
 make it into lucene as they slow things down and shouldn't have been supported from day one on our end probably.

One other customization we had was support for a wider range of queries via custom rewrite etc. (yet another way to slow
 things down), which got added to lucene and works much much better than what we used to do (instead of or rewrite, term
s are pulled out of the automata for multi term queries).

Removing our fork means the following in terms of features:
- dropped support for require_field_match: the postings highlighter will only highlight fields that were queried
- some custom es queries won't be supported anymore, meaning they won't be highlighted. The only one I found up until now is the phrase_prefix. Postings highlighter rewrites against an empty reader to avoid slow operations (like the ones that we were performing with the fork that we are removing here), thus the prefix will not be expanded to any term. What the postings highlighter does instead is pulling the automata out of multi term queries, but this is not supported at the moment with our MultiPhrasePrefixQuery.

Closes #10625
Closes #11077
2015-05-15 20:41:33 +02:00
markharwood caf723570d Aggregations improvement: exclude clauses with a medium/large number of clauses fail.
The underlying automaton-backed implementation throws an error if there are too many states.

This fix changes to using an implementation based on Set lookups for lists of excluded terms.
If the global-ordinals execution mode is in effect this implementation also addresses the slowness identified in issue 11181 which is caused by traversing the TermsEnum - instead the excluded terms’ global ordinals are looked up individually and unset the bits of acceptable terms. This is significantly faster.

Closes #11176
2015-05-15 19:17:53 +01:00
Adrien Grand 1a967ce267 Merge pull request #11180 from jpountz/enhancement/faster_scan
Search: Make SCAN faster.
2015-05-15 19:26:11 +02:00
Adrien Grand 22bba91a16 Search: Make SCAN faster.
When scrolling, SCAN previously collected documents until it reached where it
had stopped on the previous iteration. This makes pagination slower and slower
as you request deep pages. With this change, SCAN now directly jumps to the
doc ID where is had previously stopped.
2015-05-15 18:23:10 +02:00
Simon Willnauer 5d4db0edde Remove accidential modification 2015-05-15 17:03:45 +02:00
Simon Willnauer 9f81ae4845 Merge branch 'master' into feature/translog_checkpoints
Conflicts:
	src/main/java/org/elasticsearch/action/termvectors/TermVectorsFields.java
2015-05-15 17:01:23 +02:00
Michael McCandless a42d92df21 Small fixes:
- rename one method
  - move "generation == null" check under existing "if (createNew == false)"
  - fix typo/whitespace
  - add a TODO
2015-05-15 10:47:17 -04:00
Adrien Grand c5e74a8d72 Merge pull request #11141 from jpountz/fix/fieldnameanalyzer_leniency
Mappings: Make FieldNameAnalyzer less lenient.
2015-05-15 16:41:44 +02:00
Adrien Grand bf599d68dd Merge pull request #11042 from jpountz/feature/aggs_missing
Aggs: Make it possible to configure missing values.
2015-05-15 16:33:29 +02:00
Adrien Grand 32e23b9100 Aggs: Make it possible to configure missing values.
Most aggregations (terms, histogram, stats, percentiles, geohash-grid) now
support a new `missing` option which defines the value to consider when a
field does not have a value. This can be handy if you eg. want a terms
aggregation to handle the same way documents that have "N/A" or no value
for a `tag` field.

This works in a very similar way to the `missing` option on the `sort`
element.

One known issue is that this option sometimes cannot make the right decision
in the unmapped case: it needs to replace all values with the `missing` value
but might not know what kind of values source should be produced (numerics,
strings, geo points?). For this reason, we might want to add an `unmapped_type`
option in the future like we did for sorting.

Related to #5324
2015-05-15 16:26:58 +02:00
Adrien Grand 3e215e720a Merge pull request #11144 from jpountz/fix/remove_hppc_esoteric_dep
Internal: remove dependency on hppc:esoteric.
2015-05-15 16:25:51 +02:00
Martijn van Groningen 719252a138 Merge pull request #11183 from martijnvg/parent-child/remove_id_cache_from_stats_and_clear_cache_apis
Removed `id_cache` from stats and cat apis.
2015-05-15 14:39:35 +02:00
Martijn van Groningen ece18f162e Removed `id_cache` from stats and cat apis.
Also removed the `id_cache` option from the clear cache api.

Closes #5269
2015-05-15 14:06:18 +02:00
Jun Ohtani 3a1a4d3e89 Analysis: Add multi-valued text support
Add support array text as a multi-valued for AnalyzeRequestBuilder
Add support array text as a multi-valued for Analyze REST API
Add docs

Closes #3023
2015-05-15 20:01:10 +09:00
Adrien Grand 66921ffa50 Remove unused docidset-related code. 2015-05-15 12:33:19 +02:00
Britta Weber 7a8d08a4a3 Merge remote-tracking branch 'origin/master' into feature/synced_flush 2015-05-15 10:35:36 +02:00
Britta Weber 36e6718bf5 some more docs and cleanup 2015-05-15 10:35:15 +02:00
Alexander Reelsen f05808d59e HttpServer: Support relative plugin paths in configuration
When specifying relative paths on startup, handling plugin
paths failed due to recently added security fix. This fix
ensures normalization of the plugin path as well.

In addition a new matcher has been added to easily check for a
status code of an HTTP response likes this

assertThat(response, hasStatus(OK));

Closes #10958
2015-05-15 08:40:40 +02:00
Simon Willnauer 50c771be29 [ENGINE] Signal when a new index is created also in Translog creation code
Clarify when a new tranlog should be created by passing the
same create flag to the IndexWriter as well as to the Translog creation
2015-05-15 08:31:56 +02:00
Nicholas Canzoneri 8831ae6e5c Add index name to log statements when settings update fails
When an index setting is invalid and fails to be set, a WARN statement
is logged but it doesn't contain the index name, making tracking down
and fixing the problem more difficult. This commit adds the index name
to the log statement.
2015-05-14 18:44:48 -04:00
Ryan Ernst 91aeea9c66 Make highlighter check source enabled again instead of source complete...for now. 2015-05-14 15:21:07 -07:00
Areek Zillur ac4942b5a7 [TEST] improve Phrase Collate filter test 2015-05-14 18:16:03 -04:00
Ryan Ernst 7cacfa0769 Change includes/excludes back to null based for now, since it
complicates serialization and causes a number of test failures.
2015-05-14 14:58:06 -07:00
Ryan Ernst a6b0f0a8c1 Merge pull request #11171 from rjernst/fix/11116
Mappings: Add back support for enabled/includes/excludes in _source
2015-05-14 14:41:47 -07:00
Ryan Ernst 0e14c6d256 Fix includes/excludes to be handled on merge conflict checking when they
are null
2015-05-14 14:36:26 -07:00
Areek Zillur 7efc43db25 Re-structure collate option in PhraseSuggester to only collate on local shard.
Previously, collate feature would be executed on all shards of an index using the client,
this leads to a deadlock when concurrent collate requests are run from the _search API,
due to the fact that both the external request and internal collate requests use the
same search threadpool.

As phrase suggestions are generated from the terms of the local shard, in most cases the
generated suggestion, which does not yield a hit for the collate query on the local shard
would not yield a hit for collate query on non-local shards.

Instead of using the client for collating suggestions, collate query is executed against
the ContextIndexSearcher. This PR removes the ability to specify a preference for a collate
query, as the collate query is only run on the local shard.

closes #9377
2015-05-14 17:21:53 -04:00
Simon Willnauer 08d7638ed1 apply review comments 2015-05-14 22:57:53 +02:00
Areek Zillur af6b69e791 Ensure empty completion entries are never indexed
closes #10987
2015-05-14 16:48:49 -04:00
Ryan Ernst d31ce43452 Mappings: Add back support for enabled/includes/excludes in _source
This adds back the ability to disable _source, as well as set includes
and excludes. However, it also restricts these settings to not be
updateable. enabled was actually already not modifiable, but no
conflict was previously given if an attempt was made to change it.

This also adds a check that can be made on the source mapper to
know if the the source is "complete" and can be used for
purposes other than returning in search or get requests. There is
one example use here in highlighting, but more need to be added
in a follow up issue (eg in the update API).

closes #11116
2015-05-14 13:04:39 -07:00
Jack Conradson df59288b72 Fixed a broken import in MultiValueMode. 2015-05-14 09:53:26 -07:00
Jack Conradson a5c0ac0d67 Scripting: Add Multi-Valued Field Methods to Expressions
Add methods to operate on multi-valued fields in the expressions language.
Note that users will still not be able to access individual values
within a multi-valued field.

The following methods will be included:

* min
* max
* avg
* median
* count
* sum

Additionally, changes have been made to MultiValueMode to support the
new median method.

closes #11105
2015-05-14 08:27:24 -07:00
Simon Willnauer 91cfba3485 move reading opSize into the catch block to transform EOF into TruncatedTranslogException 2015-05-13 21:12:54 +02:00
Simon Willnauer 19155d8fd8 Simplify new translog creation - pending files are not needed anymore 2015-05-13 20:52:59 +02:00
Robert Muir c949ce00e8 Add test group for third-party tests 2015-05-13 14:34:53 -04:00
Simon Willnauer 96df7ba7eb Applied review comments from @mikemccand
- Renamed TranslogSnapshot to MultiSnapshot
 - moved legacy logic for trucation into LegacyTranslogReaderBase
 - made several methods private and pkg private where applicable
 - renamed arguments for consistency
2015-05-13 20:32:25 +02:00
Britta Weber 5eafc9198f rename as requested by Luca 2015-05-13 18:06:59 +02:00
Britta Weber 3a9c2bd639 fix test 2015-05-13 18:05:32 +02:00
Britta Weber 2b03a03c0c Merge remote-tracking branch 'origin/master' into feature/synced_flush 2015-05-13 18:00:18 +02:00
Robert Muir 33fd25083e Merge pull request #11134 from rmuir/tests_config
Add tests.config support to BootstrapForTesting
2015-05-13 11:35:16 -04:00
Adrien Grand b64e54c424 Merge pull request #11137 from jpountz/enhancement/geo_queries
Query DSL: Make geo filters queries.
2015-05-13 17:27:15 +02:00
Britta Weber 471cd54e39 fix api hangs if no shards allocated 2015-05-13 17:05:29 +02:00
Simon Willnauer 869baeea0c Don't throw an exception if repositories are unregister with match all
Today we barf if repositories are unregistered with a `*` pattern. This
happens on almost every test and adds weird log messages. I dont' think
we should barf in that case.

Closes #11113
2015-05-13 17:01:04 +02:00
Simon Willnauer 6a43fe348d Fail recovery if retry recovery if resetRecovery fails
This might fail if the shard is closed for instance. This will leak
a shard lock causing the shard being locked on this node forever.
2015-05-13 16:47:18 +02:00
javanna add18a5c99 Java api: remove duplicated buildAsBytes and corresponding toString methods
We have some builders, specifically query builders, `SearchSourceBuilder`, `QuerySourceBuilder` and `SuggestBuilder`, that implement `ToXContent` and also allow to build their content as bytes by simply creating a `BytesReference` that holds their json (or yaml etc.) content (`buildAsBytes` methods). They can also print out their content through `toString`. Made sure that those common methods are in one single place and reused where needed.

Also, merged `QueryBuilder` and `BaseQueryBuilder` and made `QueryBuilder` an abstract class instead of an interface.

Closes #11063
2015-05-13 16:14:16 +02:00
Simon Willnauer 807b3c6b95 [TEST] Add basic unittest like tests for SyncedFlushService
This commit adds a SingleNodeTest that runs through the different fialure szenarios
on a single shard to test the basic operations.
2015-05-13 16:05:34 +02:00
javanna d2765a2e26 Java api: add missing rewrite parameter to FuzzyQueryBuilder
We parse the rewrite field in FuzzyQueryParser but we don't allow to set it via FuzzyQueryBuilder for our java api users. Added missing field and setter.

Closes #11130
Closes #11139
2015-05-13 15:46:57 +02:00
Britta Weber f1948cf95c doc for seal api and doc for syned flush in general 2015-05-13 15:43:05 +02:00
Britta Weber c628d67f9e api for synced flush
closes #11098
2015-05-13 14:45:24 +02:00
Adrien Grand 5c9c4776cd Internal: remove dependency on hppc:esoteric.
The esoteric classifier contains in particular maps that take bytes or doubles
as keys. In the byte case, we can just use integer, and in the double case we
can use their long bits instead.
2015-05-13 14:13:10 +02:00
Dawid Weiss 491b00c4ec Updating to HPPC-0.7.1
Close #11035
2015-05-13 13:53:14 +02:00
Simon Willnauer 43ff544117 Add translog checkpoints to prevent translog corruption
Today we are almost intentionally corrupt the translog if we loose
a node due to powerloss or similary disasters. In the translog reading
code we simply read until we hit an EOF exception ignoring the rest of the
translog file once hit. There is no information stored how many records
we are expecting or what the last written offset was.

This commit restructures the translog to add checkpoints that are written
with every sync operation recording the number of synced operations as well
as the last synced offset. These checkpoints are also used to identify the actual
transaction log file to open instead of relying on directory traversal.

This change adds a significant amount of additional checks and pickyness to the translog
code. For instance is the translog now associated with a specific engine via a UUID that is
written to each translog file as part of it's header. If an engine opens a translog file it
was not associated with the operation will fail.

Closes to #10933
Relates to #11011
2015-05-13 12:40:35 +02:00
Adrien Grand 472cc0af08 Merge pull request #11142 from jpountz/feature/bool_filter
Query DSL: Add `filter` clauses to `bool` queries.
2015-05-13 12:25:32 +02:00
Adrien Grand 630757906a Query DSL: Add `filter` clauses to `bool` queries.
These clauses filter the document space without affecting scoring and map to
Lucene's BooleanClause.Occur.FILTER. The `filtered` query is now deprecated and

```json
{
  "filtered": {
    "query": { //query },
    "filter": { //filter }
  }
}
```
should be replaced with
```json
{
  "bool": {
    "must": { //query },
    "filter": { //filter }
  }
}
```
2015-05-13 12:04:56 +02:00
Shay Banon ba20d4b6ba [TEST] fix unintended relocation 2015-05-13 11:18:28 +02:00
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