Commit Graph

30334 Commits

Author SHA1 Message Date
Tanguy Leroux 4756790d6e
Use fixture to test the repository-gcs plugin (#28788)
This commit adds a GoogleCloudStorageFixture that uses the
logic of a GoogleCloudStorageTestServer (added in #28576)
to emulate a remote Google Cloud Storage service.

By adding this fixture and a more complete integration test, we 
should be able to catch more bugs when upgrading the client library.

The fixture is started by the googleCloudStorageFixture task
and a custom Service Account file is created and added to the
Elasticsearch keystore for each test.
2018-03-09 13:57:27 +01:00
David Turner 033a83b98b
Use String.join() to describe a list of tasks (#28941)
This change replaces the use of string concatenation with a call to
String.join(). String concatenation might be quadratic, unless the compiler can
optimise it away, whereas String.join() is more reliably linear. There can
sometimes be a large number of pending ClusterState update tasks and #28920
includes a report that this operation sometimes takes a long time.
2018-03-09 09:42:44 +00:00
Martijn van Groningen 41519da45a Fixed incorrect test try-catch statement 2018-03-09 09:38:16 +01:00
Ryan Ernst 62293ec1c9
Plugins: Consolidate plugin and module loading code (#28815)
At one point, modules and plugins were very different. But effectively
now they are the same, just from different directories. This commit
unifies the loading methods so they are simply two different
directories. Note that the main codepath to load plugin bundles had
duplication (was not calling getPluginBundles) since previous
refactorings to add meta plugins. Note this change also rewords the
primary exception message when a plugin descriptor is missing, as the
wording asking if the plugin was built before 2.0 isn't really
applicable anymore (it is highly unlikely someone tries to install a 1.x
plugin on any modern version).
2018-03-08 22:49:27 -08:00
Martijn van Groningen beb22d89c8 percolator: Take `matchAllDocs` and `verified` of the sub result into account when analyzing a function_score query.
Before the `matchAllDocs` was ignored and this could lead to percolator queries not matching when
the inner query was a match_all query and min_score was specified.

Before when `verified` was not taken into account if the function_score query wrapped an unverified query this could
lead to matching percolator queries that shouldn't match at all.
2018-03-09 07:16:21 +01:00
Ryan Ernst 0f95636a91
Build: Remove rest tests on archive distribution projects (#28952)
This commit removes running rest tests on the full zip and tar
distributions in favor of doing a simple extraction check like is done
for rpm and deb files. The rest tests are still run on the integ test
zip, at least for now (this should eventually be moved out to a different
location).
2018-03-08 19:46:54 -08:00
Lee Hinman 46a79127ed
Remove FastStringReader in favor of vanilla StringReader (#28944)
This allows us to remove another dependency in the decoupling of the XContent
code. Rather than move this class over or decouple it, it can simply be removed.

Relates tangentially to #28504
2018-03-08 17:17:36 -07:00
Lee Hinman d6d7ee7320
Remove FastCharArrayReader and FastCharArrayWriter (#28951)
These classes are used only in two places, and can be replaced by the
`CharArrayReader` and `CharArrayWriter`. The JDK can also perform lock biasing
and elision as well as escape analysis to optimize away non-contended locks,
rendering their lock-free implementations unnecessary.
2018-03-08 17:05:11 -07:00
Tal Levy 7784c1bff9
Continue registering pipelines after one pipeline parse failure. (#28752)
Ingest has been failing to apply existing pipelines from cluster-state
into the in-memory representation that are no longer valid. One example of
this is a pipeline with a script processor. If a cluster starts up with scripting
disabled, these pipelines will not be loaded. Even though GETing a pipeline worked,
indexing operations claimed that this pipeline did not exist. This is because one
gets information from cluster-state and the other is from an in-memory data-structure.

Now, two things happen
1. suppress the exceptions until after other successful pipelines are loaded
2. replace failed pipelines with a placeholder pipeline

If the pipeline execution service encounters the stubbed pipeline, it is known that
something went wrong at the time of pipeline creation and an exception was thrown to
the user at some point at start-up.

closes #28269.
2018-03-08 15:22:59 -08:00
Ryan Ernst d972db7eb7
Build: Fix ability to ignore when no tests are run (#28930)
Running any randomized testing task within Elasticsearch currently fails
if a project has zero tests. This was supposed to be overrideable, but
it was always set to 'fail', and the system property to override was
passed down to the test runner, but never read there. This commit
changes the value of the ifNoTests setting to randomized runner to be
read from system properties and continue to default to 'fail'.
2018-03-08 15:21:45 -08:00
Spencer 9709d89daf
[rest-api-spec] update doc link for /_rank_eval 2018-03-08 16:06:23 -07:00
Lee Hinman 17fc07a193
Switch XContentBuilder from BytesStreamOutput to ByteArrayOutputStream (#28945)
This switches the underlying byte output representation used by default in
`XContentBuilder` from `BytesStreamOutput` to a `ByteArrayOutputStream` (an
`OutputStream` can still be specified manually)

This is groundwork to allow us to decouple `XContent*` from the rest of the ES
core code so that it may be factored into a separate jar.

Since `BytesStreamOutput` was not using the recycling instance of `BigArrays`,
this should not affect the circuit breaking capabilities elsewhere in the
system.

Relates to #28504
2018-03-08 15:45:51 -07:00
Lee Hinman 697f3f1a3b
Factor UnknownNamedObjectException into its own class (#28931)
* Factor UnknownNamedObjectException into its own class

This moves the inner class `UnknownNamedObjectException` from
`NamedXContentRegistry` into a top-level class. This is so that
`NamedXContentRegistry` doesn't have to depend on StreamInput and StreamOutput.

Relates to #28504
2018-03-08 15:32:41 -07:00
Tim Brooks 7d434c16f9
Remove NioNotEnabledBootstrapCheck bootstrap check (#28901)
This is related to #27260. This commit removes the bootstrap check that
prevents nio from being enabled.
2018-03-08 11:06:36 -07:00
Tim Brooks d8d1f0d4f0
Give transport-nio plugin socket permissions (#28900)
This is related to #27260. The transport-nio plugin needs socket
permissions to operate as a transport. This commit gives it these
permissions in the policy file.
2018-03-08 09:33:39 -07:00
Lee Hinman ec92796ed8
Remove now-unused createParser that uses BytesReference (#28926)
This removes `BytesReference` use from XContent and all subclasses.

Relates to #28504
2018-03-08 09:10:21 -07:00
Craig van Tonder 95a13ea01c Update bucket-sort-aggregation.asciidoc (#28937)
Added two trailing braces that were missing within the first example.
2018-03-08 15:05:34 +01:00
Holger Bartnick b42804d182 [Docs] REST high-level client: Fix code for most basic search request (#28916)
We also need to add the query to the request.
2018-03-08 04:14:50 -08:00
Martijn van Groningen bcfb7ab591
Improved percolator's random candidate query duel test and
fixed bugs that were exposed by this:

* Duplicates query leafs were not detected in a multi level boolean query
* Tracking fields for numeric range queries did not work properly.
* The sorting that was used to find the less restrictive clauses in
  disjunction query did not work too.
2018-03-08 11:39:03 +01:00
Jim Ferenczi bc8b3fc71c Revert "Rescore collapsed documents (#28521)"
This reverts commit f057fc294a.
The rescorer does not resort the collapsed values inside the top docs
during rescoring. For this reason the Lucene rescorer is not compatible
with collapsing.
Relates #27243
2018-03-08 11:20:29 +01:00
Ryan Ernst ea5b6c4fc1
Build: Fix test logger NPE when no tests are run (#28929)
This commit fixes the test progress logging to not produce an NPE when
there are no tests run. The onQuit method is always called, but onStart
would not be called if no tests match the test patterns.
2018-03-07 15:51:49 -08:00
Lee Hinman 9d4f09db68 [TEST] AwaitsFix QueryRescorerIT.testRescoreAfterCollapse
See: https://github.com/elastic/elasticsearch/issues/28932
2018-03-07 15:32:29 -07:00
Lee Hinman 818920a281
Decouple XContentType from StreamInput/Output (#28927)
This removes the readFrom and writeTo methods from XContentType, instead using
the more generic `readEnum` and `writeEnum` methods. Luckily they are both
encoded exactly the same way, so there is no compatibility layer needed for
backwards compatibility.

Relates to #28504
2018-03-07 14:50:30 -07:00
Lee Hinman 2d1d6503a4
Remove BytesRef usage from XContentParser and its subclasses (#28792)
* Remove BytesRef usage from XContentParser and its subclasses

This removes all the BytesRef usage from XContentParser in favor of directly
returning a CharBuffer (this was originally what was returned, it was just
immediately wraped in a BytesRef).

Relates to #28504

* Rename method after Ryan's feedback
2018-03-07 10:09:56 -07:00
Jonathan Pool 861d80fff0 [DOCS] Correct typo in configuration (#28903) 2018-03-06 15:50:46 +01:00
Aaron Mildenstein 7f4131f923 Fix incorrect datemath example (#28904)
The original example resulted in a 400 error due to the example being `-` separated instead of the default `.` separation.
```
failed to parse date field [2001-01-01] with format [YYYY.MM.dd]
```
2018-03-06 15:46:21 +01:00
Menno Oudshoorn d018a0008e Add a usage example of the JLH score (#28905)
Adds a usage example of the JLH score used in significant terms aggregation.
All other methods to calculate significance score have such an example

Closes #28513
2018-03-06 15:37:18 +01:00
Lee Hinman e7d1e12675
Wrap stream passed to createParser in try-with-resources (#28897)
* Wrap stream passed to createParser in try-with-resources

This wraps the stream (`.streamInput()`) that is passed to many of the
`createParser` instances in the enclosing (or a new) try-with-resources block.
This ensures the `BytesReference.streamInput()` is closed.

Relates to #28504

* Use try-with-resources instead of closing in a finally block
2018-03-04 16:48:03 -07:00
Sergey Galkin f057fc294a Rescore collapsed documents (#28521)
This change adds the ability to rescore collapsed documents.
2018-03-04 13:39:50 -08:00
Jim Ferenczi c26bd6046b
Fix (simple)_query_string to ignore removed terms (#28871)
This change ensures that we ignore terms removed from the analysis rather than returning a match_no_docs query for the part
that contain the stop word. For instance a query like "the AND fox" should ignore "the" if it is considered as a stop word instead of
adding a match_no_docs query.
This change also fixes the analysis of prefix terms that start with a stop word (e.g. `the*`). In such case if `analyze_wildcard` is true and `the`
is considered as a stop word this part of the query is rewritten into a match_no_docs query. Since it's a prefix query this change forces the prefix query
on `the` even if it is removed from the analysis.

Fixes #28855
Fixes #28856
2018-03-04 13:25:46 -08:00
Tim Roes 5689dc1182 [Docs] Fix typo in composite aggregation (#28891) 2018-03-04 11:47:24 -08:00
Simon Willnauer 5a1d9f33a0
Try if tombstone is eligable for pruning before locking on it's key (#28767)
Pruning tombstones is quite expensive since we have to walk though all
deletes in the live version map and acquire a lock on every value even though
it's impossible to prune it. This change does a pre-check if a delete is old enough
and if not it skips acquireing the lock.
2018-03-04 11:31:13 -08:00
Mayya Sharipova f53d159aa1
Limit analyzed text for highlighting (improvements) (#28808)
Increase the default limit of `index.highlight.max_analyzed_offset` to 1M instead of previous 10K.

Enhance an error message when offset increased to include field name, index name and doc_id.

Relates to https://github.com/elastic/kibana/issues/16764
2018-03-02 08:09:05 -08:00
Andrew Odendaal f207aacac0 Missing `timeout` parameter from the REST API spec JSON files (#28328)
Closes #28200
2018-03-02 14:47:06 +01:00
Jim Ferenczi 48a7425ae6
Clarifies how query_string splits textual part (#28798)
* Clarifies how the query_string splits textual part to build a query

Whitespaces are not considered as operators anymore in 6x but the documentation is not clear about it.
This commit changes the example in the documentation and adds a note regarding whitespaces and operators.

Closes #28719
2018-03-01 15:08:25 -08:00
Ivan Brusic 6fb8319ffc Update outdated java version reference (#28870)
It is only a comment, but can confuse those reading the code

Used 6.0 as an arbitrary elasticsearch.version value since it is version that required Java 8
2018-03-01 14:17:24 -08:00
olcbean 472acf7833 [DOCS] fix put_mapping snippet (#28814)
Add a java snippet to be run in an integration test
in order to guarantee that the snippet is correct

Closes #28778
2018-03-01 10:59:52 +01:00
olcbean 25834e2d26 REST api spec: remove a common param from nodes.usage.json (#28835)
"human" is a common parameter defined in `_common.json`
It should not be repeated again for a concrete api.

Closes #28226
2018-03-01 10:58:38 +01:00
olcbean ec0a1b36c9 REST api spec: remove unsupported parameter `parent_node` (#28841) 2018-03-01 10:57:25 +01:00
Luca Cavanna 184a8718d8
REST high-level client: add flush API (#28852)
Relates to #27205
2018-03-01 10:56:03 +01:00
Bojan Matić 742e9f5078 Document removal of forced versioning for update API (#28834) 2018-02-28 09:41:44 -08:00
Yu 95dea2408d Add Refresh API for RestHighLevelClient (#27799)
Relates to #27205
2018-02-28 11:49:14 +01:00
Jason Tedor 303ce30f77 Add note regarding quoting values for network.host
Values for the network.host setting can often contain a colon which is a
character that is considered special by YAML (these arise in IPv6
addresses and some of the special tags like ":ipv4"). As such, these
values need to be quoted or a YAML parser will be unhappy with
them. This commit adds a note to the docs regarding this.
2018-02-27 10:33:45 -08:00
FUJI Goro 2baa19ea64 [Docs] Specify function score logarithm modifiers (#28821)
The logarithm with base 10 is called "Common Logarithm".
2018-02-27 10:29:43 -08:00
olcbean c5821f9645 [docs] Line breaks for High-level REST Client (#28825)
Wrap code snippets for better display in the generated docs.
2018-02-26 14:03:03 -05:00
Jason Tedor fb073216b1 Move search concurrency and parallelism paragraphs
These paragraphs should be on the top-level search page for visibility
so this commit moves them, and puts them under a clear heading.
2018-02-26 07:47:57 -08:00
olcbean beb8b10556 Fix inconsistency in docs regarding single types (#28715)
This commit fixes some inconsistencies in the docs regarding single
types. The inconsistencies are between the verbiage and the relevant
snippets.
2018-02-26 07:08:37 -08:00
lzh3636 929dba8667 Fix log message when virtual lock not possible (#28829)
When virtual lock is not possible because JNA is unavailable, we log a
warning message. Yet, this log message refers to mlockall rather than
virtual lock, presumably because of a copy/paste error. This commit
fixes this issue.
2018-02-26 06:55:32 -08:00
Jason Tedor 57225652b3 Revert "Destroy test VMs on clean (#28818)"
This reverts commit f66234bdd5.
2018-02-25 21:49:36 -05:00
Jason Tedor f66234bdd5
Destroy test VMs on clean (#28818)
This commit adds a dependency on the destroy task to the clean task so
that the VMs are destroyed when the clean task is executed.
2018-02-25 17:02:38 -05:00