Commit Graph

24623 Commits

Author SHA1 Message Date
Adrien Grand 8ab7ca5284 Source filtering should treat dots in field names as sub objects. (#20736)
Mappings treat dots in field names as sub objects, for instance

```
{
  "a.b": "c"
}
```

generates the same dynamic mappings as

```
{
  "a": {
    "b": "c"
  }
}
```

Source filtering should be consistent with this behaviour so that an include
list containing `a` should include fields whose name is `a.b`.

To make this change easier, source filtering was refactored to use automata.
The ability to treat dots in field names as sub objects is provided by the
`makeMatchDotsInFieldNames` method of `XContentMapValues`.

Closes #20719
2016-10-10 09:32:26 +02:00
Nik Everett 741ecf80ff Loosen assertion in getting-started.asciidoc
We were asserting that the size of an index had a decimal point but it
doesn't always:
https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+5.0+java9-periodic/240/console
2016-10-09 13:47:59 -04:00
Nik Everett 6418f89feb Remove NodeServicesProvider
Instead provide services where they are needed. The class worked
well as a temporary measure to easy removal of guice from the index
level but now we can remove it entirely.

-1 @Inject annotation
2016-10-08 07:35:58 -04:00
Lucas Bremgartner 4bf45e53a5 Documentation: comments in index templates (#20701)
Fixes #20513
2016-10-08 12:38:45 +02:00
Clinton Gormley 22f1acde94 Docs: Pattern analyzer does not support a max_token_length parameter
Closes #20713
2016-10-08 12:27:33 +02:00
David Pilato 2e1539b879 Fix URL for plugins
Reported at https://discuss.elastic.co/t/ingest-geoip-for-beta1/62505
2016-10-07 23:33:13 +02:00
Nik Everett 06049283a0 CONSOLEify some _cat docs
`/_cat/count`, `/_cat/fielddata`, and `/_cat/health`.

Three more files down, 141 to go.

Relates to #18160
2016-10-07 16:30:45 -04:00
Tom Manterfield 1bf11dc09a Updated documentation to include precise version of gradle currently required for building (#20776) 2016-10-07 20:24:37 +02:00
Jason Tedor 535bf92280 Upgrade Log4j 2 to version 2.7
This commit upgrades the Log4j 2 dependency to version 2.7 and removes
some hacks that we had in place to work around bugs in Log4j 2 version
2.6.2.

Relates #20805
2016-10-07 13:05:30 -05:00
Clinton Gormley 2fa1d0d5f9 Added version 2.4.1 with bwc indices 2016-10-07 19:06:52 +02:00
Shane Connelly 78ae19ae5e Merge pull request #20784 from eskibars/master
Add a note that reindex does not set up mappings, etc
2016-10-07 09:39:10 -07:00
Nik Everett cf4038b668 DeGuice some of IndicesModule
UpdateHelper, MetaDataIndexUpgradeService, and some recovery
stuff.

Move ClusterSettings to nullable ctor parameter of TransportService
so it isn't forgotten.
2016-10-07 11:14:38 -04:00
Clinton Gormley 6cf7a93837 Better formatting of date-match URL encoding 2016-10-07 16:33:30 +02:00
Simon Willnauer 7452028e50 Simplify TransportAddress (#20798)
since TransportAddress is now final we can simplify it's interface a bit
and remove methods that are only used in tests or are plain delegates.
2016-10-07 15:56:54 +02:00
Clinton Gormley eb62f90578 Document date math use in the rollover API (#20780)
* Document date math use in the rollover API

Relates to #20709
2016-10-07 15:49:28 +02:00
Colin Goodheart-Smithe 4981f2fd51 Makes freezing QueryShardContext safer by stopping overrides (#20800)
The `QueryShardContext.failIfFrozen()` and `QueryShardContext.freezeContext()`
methods should be final so that overriding/bypassing the freezing of
`QueryShardContext` is not possible. This is important so that we can
trust when the `QueryShardContext` says a request is cacheable.

This change also makes the methods that call `QueryShardContext.failIfFrozen()`
`final` so they cannot be overridden to bypass setting the request as not
cacheable.
2016-10-07 14:37:29 +01:00
Adrien Grand 7a403f640b Clarify some docs about geo-distance sorting. (#20735)
This also improves formatting a bit.
2016-10-07 15:26:34 +02:00
Adrien Grand c1e5421b77 Make range queries round up upper bounds again. (#20582)
Elasticsearch 1.x used to implicitly round up upper bounds of queries when they
were inclusive so that eg. `[2016-09-18 TO 2016-09-20]` would actually run
`[2016-09-18T00:00:00.000Z TO 2016-09-20T23:59:59.999Z]` and include dates like
`2016-09-20T15:32:44`. This behaviour was lost in the cleanups of #8889.

Closes #20579
2016-10-07 14:22:15 +02:00
Jason Tedor d01a62908a Change separator for shards preference
The shards preference on a search request enables specifying a list of
shards to hit, and then a secondary preference (e.g., "_primary") can be
added. Today, the separator between the shards list and the secondary
preference is ';'. Unfortunately, this is also a valid separtor for URL
query parameters. This means that a preference like "_shards:0;_primary"
will be parsed into two URL parameters: "_shards:0" and "_primary". With
the recent change to strict URL parsing, the second parameter will be
rejected, "_primary" is not a valid URL parameter on a search
request. This means that this feature has never worked (unless the ';'
is escaped, but no one does that because our docs do not that, and there
was no indication from Elasticsearch that this did not work). This
commit changes the separator to '|'.

Relates #20786
2016-10-07 07:17:01 -05:00
Simon Willnauer 194a6b1df0 Remove LocalTransport in favor of MockTcpTransport (#20695)
This change proposes the removal of all non-tcp transport implementations. The
mock transport can be used by default to run tests instead of local transport that has
roughly the same performance compared to TCP or at least not noticeably slower.

This is a master only change, deprecation notice in 5.x will be committed as a
separate change.
2016-10-07 11:27:47 +02:00
Colin Goodheart-Smithe eba60ee63c Removes the now callable in the date math parser in favour of a LongSupplier (#20796)
Previous to this change the DateMathParser accepted a Callable<Long> to use for accessing the now value. The implementations of this callable would fall back on System.currentTimeMillis() if there was no context object provided. This is no longer necessary for two reasons:

We should not fall back to System.currentTimeMillis() as a context should always be provided. This ensures consistency between shards for the now value in all cases
We should use a LongSupplier rather than requiring an implementation of Callable. This means that we can just pass in context::noInMillis for this parameter and not have not implement anything.
2016-10-07 10:26:25 +01:00
Michael McCandless 0a1b8a3176 also ignore AccessDeniedException (for Windows) when checking file size for store stats (#20790)
Closes #17580
2016-10-07 05:24:15 -04:00
Ali Beyad 5d38248afa Shard Decision class improvements for Explain API (#20742)
This commit improves the shard decision container class in the following
ways:

 1. Renames UnassignedShardDecision to ShardAllocationDecision, so that
    the class can be used for general shard decisions, not just unassigned
    shard decisions.
 2. Changes ShardAllocationDecision to have the final decision as a Type
    instead of a Decision, because all the information needed from the final
    decision is contained in `Type`.
 3. Uses cached instances of ShardAllocationDecision for NO and THROTTLE
    decisions when no explanation is needed (which is the common case when
    executing reroute's as opposed to using the explain API).
2016-10-06 22:53:05 -04:00
Clinton Gormley e83e8e890e Fixed released_state docs switch to build correctly and include missing links 2016-10-06 21:42:11 +02:00
Shane Connelly 3164917fd4 Adds a note that reindex does not set up mappings, etc. Closes #20783 2016-10-06 12:27:08 -07:00
Clinton Gormley d822a642b0 Document how to run a single docs test 2016-10-06 21:10:49 +02:00
Simon Willnauer a6fa96d513 Remove confusing capturing groups in _rollover index name pattern 2016-10-06 20:41:19 +02:00
Nik Everett 6d42e197b8 CONSOLEify remaining getting-started docs
Moves some test data used by those docs into the Elasticsearch
repository so we can use it when we test the docs during the build.

Relates to #18160
2016-10-06 14:06:48 -04:00
Nik Everett d9781bd069 Fix broken regex in doc tests
Regexes are hard.
2016-10-06 13:53:20 -04:00
Simon Willnauer 9c9afe3f01 Remove SearchContext#current and all it's threadlocals (#20778)
Today SearchContext expose the current context as a thread local which makes any kind of sane interface design very very hard. This PR removes the thread local entirely and instead passes the relevant context anywhere needed. This simplifies state management dramatically and will allow for a much leaner SearchContext interface down the road.
2016-10-06 19:51:54 +02:00
Nik Everett d7d5df8863 CONSOLEify some _cat docs
Added `// NOTCONSOLE` to some `_cat` docs that rely on `sort` or
are otherwise too difficult for us to test at this point.

Relates to #20717
2016-10-06 13:37:21 -04:00
Clinton Gormley 40bf2c206c Add placeholder to the docs to distinguish released from unreleased from prerelease versions (#20644)
Closes https://github.com/elastic/stack/issues/18
2016-10-06 17:58:03 +02:00
Igor Motov 63bcb4f534 Named analyzer should close the analyzer that it wraps 2016-10-06 10:15:33 -04:00
Boaz Leskes b847a835e9 Improve scheduling fairness when batching cluster state changes with equal priority (#20775)
As the wise man @ywelsch said: currently when we batch cluster state update tasks by the same executor, we the first task un-queued from the pending task queue. That means that other tasks for the same executor are left in the queue. When those are dequeued, they will trigger another run for the same executor. This can give unfair precedence to future tasks of the same executor, even if they weren't batched in the first run. Take this queue for example (all with equal priority)

 ```
 T1 (executor 1)
 T2 (executor 1)
 T3 (executor 2)
 T4 (executor 2)
 T5 (executor 1)
 T6 (executor 1)
 ```

 If T1 & T2 are picked up first (when T5 & T6 are not yet queued), one would expect T3 & T4 to run second. However, since T2 is still in the queue, it will trigger execution of T5 & T6.

 The fix is easy - ignore processed tasks when extracting them from the queue.

Closes #20768
2016-10-06 16:11:27 +02:00
David Pilato 591a8d4ec6 Merge branch 'fix/20669-master-azure-log' 2016-10-06 16:00:43 +02:00
Clinton Gormley 43a851f1f6 Most date-math chars in index names need to be percent encoded
Updated docs to provide encodings
2016-10-06 15:44:42 +02:00
Colin Goodheart-Smithe 3aed047bde #20750 Prevent requests that use scripts or now() from being cached
Prevent requests that use scripts or now() from being cached
2016-10-06 10:24:57 +01:00
Colin Goodheart-Smithe 40f8f281e0 Merge branch 'master' into dont_cache_scripts 2016-10-06 09:09:23 +01:00
Colin Goodheart-Smithe ce6f6d3835 Review comments 2016-10-06 08:55:31 +01:00
Adrien Grand 6174e21f47 The `top_hits` aggregation should compile scripts only once. (#20738)
Today it compiles when creating the aggregator, meaning that scripts will be
compiled as many times as there are buckets. Instead it should compile when
creating the factory so that scripts are compiled only once regardless of the
number of buckets.
2016-10-06 09:55:30 +02:00
Boaz Leskes a2e82adc6f TransportReplicationAction subclasses shouldn't have to resolve shards (#20730)
TRA currently resolves incoming requests to IndexShards in order to acquire operations locks on them. There is no need for all subclasses to have to go through the same IndicesService/IndexService song and dance. Also, doing it once means we don't need to worry about edge cases where the shard is removed while a TRA is in flight.
2016-10-06 08:45:35 +02:00
Simon Willnauer ce21b607bb move test to a single node test 2016-10-05 21:55:50 +02:00
Simon Willnauer 134b1f9b4d Prevent thread suspension when inside SecurityManager (#20770)
LongGCDisruption suspends and resumes node threads but respects several
`unsafe` class name patterns where it's unsafe to suspend. For instance
log4j uses a global lock so we can't suspend a thread that is currently
calling into log4j. The same is true for the security manager, it's similar
to log4j a shared resource between the test and the node that is _suspended_.
This change adds `java.lang.SecrityManager` to the unsafe patterns.
This prevents test framework deadlocking if a nodes thread is supended
while it's calling into the security manager that uses synchronized maps etc.
2016-10-05 21:40:27 +02:00
Simon Willnauer 50ca10378e Merge branch 'master' into dont_cache_scripts 2016-10-05 20:43:52 +02:00
Simon Willnauer 838c28eeb4 add percolate with script query test 2016-10-05 20:43:46 +02:00
Ali Beyad 15950b71b8 BalancedShardAllocator code improvements (#20746)
This commit improves the logic flow of BalancedShardsAllocator in
preparation for separating out components of this class to be used
in the cluster allocation explain APIs.  In particular, this commit:

 1. Adds a minimum value for the index/shard balance factor settings (0.0)
 2. Makes the Balancer data structures immutable and pre-calculated at
    construction time.
 3. Removes difficult to follow labeled blocks / GOTOs
 4. Better logic for skipping over the same replica set when one of
    the replicas received a NO decision
 5. Separates the decision making logic for a single shard from the logic
    to iterate over all unassigned shards.
2016-10-05 14:23:25 -04:00
Jack Conradson 8e27d741c0 Merge pull request #20766 from jdconrad/now
Remove all date 'now' methods from Painless
2016-10-05 10:01:19 -07:00
Jack Conradson ba88d9af57 Remove all date 'now' methods from the Painless whitelist to ensure
Painless scripts are pure functions.
2016-10-05 09:47:20 -07:00
Dimitrios Liappis 02dd1ba61a [vagrant] packaging tests: add parametrized retries for dnf install (#20749)
* Add parametrized retries for dnf install

Given that dnf doesn't do retries installation of openjdk can sometimes
be affected by checksum or network issues with mirrors offered by
metalink.

Allow setting number of retries through the parameter
`install_command_retries`

* Insert delay between package install retries

Fedora's metalink occasionally returns broken mirrors. Pausing for a few
seconds between retries increases the chance of receiving a different
list of mirrors from metalink and success with package installation.
2016-10-05 11:42:25 -04:00
Jason Tedor 8c4108d886 Add response params to REST params did you mean
This commit adds the response params as candidates for the did you mean
suggestions for strict REST params handling.

Relates #20753
2016-10-05 11:26:19 -04:00