Commit Graph

6225 Commits

Author SHA1 Message Date
Chris Earle 6a7309c09a Add "version" field to Pipelines
This adds a version field to Pipelines, which is itself is unused by Elasticsearch, but exists for users to better manage their own pipelines.
2016-09-07 10:27:40 -04:00
Igor Motov d34fdaac5e Parse script on storage instead of on retrieval
Parsing a script on retrieval causes it to be re-parsed on every single script call, which can be very expensive for large frequently called scripts. This change switches to parsing scripts only once during store operation.
2016-09-07 08:21:33 -04:00
javanna a96c76dcbd Remove FetchSubPhaseParseElement
With the search refactoring we don't use SearchParseElement anymore to define our own parsing code but only for plugins. There was an abstract subclass called FetchSubPhaseParseElement in our production code, only used in one of our tests. We can remove that abstract class as it is not needed and not that useful for the test that depends on it.
2016-09-07 10:05:21 +02:00
Luca Cavanna 0d21d9ff6e Merge pull request #20327 from javanna/enhancement/stats_writeable
NodeStats classes to implement Writeable rather then Streamable
2016-09-07 10:04:52 +02:00
Jun Ohtani bc3d1a8362 Merge pull request #20331 from johtani/cleanup_analyze_api_test
Clean up Analyze API test case
2016-09-07 17:04:28 +09:00
javanna dd9b29b6c6 remove stale comment from CircuitBreakerStats 2016-09-07 10:03:41 +02:00
javanna e3f2af8384 make memoryPools in JvmStats not nullable, default to empty list 2016-09-07 10:03:41 +02:00
javanna a33e4b1d76 use Collections.addAll rather manually copying array 2016-09-07 10:03:41 +02:00
javanna 1ff22fe32a remove bw comp layer that's not needed in CommonStatsFlags 2016-09-07 10:03:41 +02:00
javanna 1a2c7e0d25 [TEST] introduce more intermediate variables in NodeStatsTests to prevent too much line wrapping 2016-09-07 10:03:41 +02:00
javanna a035ca102f Use a list for JvmStats memoryPools rather than an array 2016-09-07 10:03:41 +02:00
javanna 42f88406ee add NodeStatsTests to test NodeStats serialization 2016-09-07 10:03:41 +02:00
javanna dae0580a67 add missing getters to FsInfo.IoStats class
Without the getters there is no way to retrieve the values for its instance members from the java api, they only get printed out on the REST layer
2016-09-07 10:03:41 +02:00
javanna af633a293c Eagerly compute FsInfo#total so that the member instance can become final
FsInfo#total is removed in favour of getTotal, which allows to retrieve the total value

[TEST] fix FsProbeTests: null is not accepted as path constructor argument
2016-09-07 10:03:41 +02:00
javanna f1b1d1cae0 CommonStats and CommonStatsFlags to implement Writeable rather than Streamable 2016-09-07 10:03:41 +02:00
javanna b36bad6cc2 AllCircuitBreakerStats and CircuitBreakerStats to implement Writeable rather than Streamable 2016-09-07 10:03:41 +02:00
javanna 38a7427c51 DiscoveryStats and PendingClusterStateStats to implement Writeable rather than Streamable 2016-09-07 10:03:41 +02:00
javanna d7ad748be7 ScriptStats to implement Writeable rather than Streamable
Also removed ScriptStats#add method which was unused
2016-09-07 10:03:41 +02:00
javanna 3521e2e1a9 HttpStats to implement Writeable rather than Streamable 2016-09-07 10:03:41 +02:00
javanna e263c64072 TransportStats to implement Writeable rather than Streamable 2016-09-07 10:03:41 +02:00
javanna 9c62a12fee ThreadPoolStats to implement Writeable rather than Streamable 2016-09-07 10:03:41 +02:00
javanna 102dac2cd9 JvmStats to implement Writeable rather than Streamable
also removed null checks in toXContent for subobjects that cannot be null and added @Nullable annotation for memory pools
2016-09-07 10:03:41 +02:00
javanna 931a164b1f ProcessStats to implement Writeable rather than Streamable 2016-09-07 10:03:41 +02:00
Colin Goodheart-Smithe 55d9e99f51 Fix filter cache setting to allow percentages
During adding the new settings infrastructure the option to specify the
size of the filter cache as a percentage of the heap size which accidentally
removed. This change adds that ability back.

In addition the `Setting` class had multiple `.byteSizeSetting` methods
which all except one used `ByteSizeValue.parseBytesSizeValue` to parse
the value. One method used `MemorySizeValue.parseBytesSizeValueOrHeapRatio`.
This was confusing as the way the value was parsed depended on how many
arguments were provided.

This change makes all `Setting.byteSizeSetting` methods parse the value
the same way using `ByteSizeValue.parseBytesSizeValue` and adds
`Setting.memorySizeSetting` methods to parse settings that express memory
sizes (i.e. can be absolute bytes values or percentages). Relevant settings
have been moved to use these new methods.

Closes #20330
2016-09-07 08:53:41 +01:00
Alexander Lin f825e8f4cb Exposing lucene 6.x minhash filter. (#20206)
Exposing lucene 6.x minhash tokenfilter

Generate min hash tokens from an incoming stream of tokens that can
be used to estimate document similarity.

Closes #20149
2016-09-07 09:38:12 +02:00
Lee Hinman 7da8be9874 Merge remote-tracking branch 'dakrone/disk-decider-relocation-switcharoo' 2016-09-06 14:46:15 -06:00
Lee Hinman 28d3c4488e Change DiskThresholdDecider's behavior when factoring in leaving shards
This changes DiskThresholdDecider to only factor in leaving shards when
checking if a shard can remain. Previously, leaving shards were factored
in for both the `canAllocate` and `canRemain` checks, however, this
makes only the leaving shard sizes subtracted in the `canRemain` check.

It was possible that multiple shards relocating away from the node would
have their entire size subtracted, and the node had a chance to go over
the disk threshold (or hit the disk full) because it subtracted space
that was still being used for other in-progress relocations.
2016-09-06 14:26:18 -06:00
Nik Everett eb9d2b6659 Make ConcreteShardRequest public and static
Request interceptors need to be able to work with it.
2016-09-06 15:41:14 -04:00
Martijn van Groningen 245882cde3 * Removed `script.default_lang` setting and made `painless` the hardcoded default script language.
** The default script language is now maintained in `Script` class.
* Added `script.legacy.default_lang` setting that controls the default language for scripts that are stored inside documents (for example percolator queries).  This defaults to groovy.
** Added `QueryParseContext#getDefaultScriptLanguage()` that manages the default scripting language. Returns always `painless`, unless loading query/search request in legacy mode then the returns what is configured in `script.legacy.default_lang` setting.
** In the aggregation parsing code added `ParserContext` that also holds the default scripting language like `QueryParseContext`. Most parser don't have access to `QueryParseContext`. This is for scripts in aggregations.
* The `lang` script field is always serialized (toXContent).

Closes #20122
2016-09-06 18:44:48 +02:00
Jason Tedor 0d7dfcd798 Merge pull request #20338 from jasontedor/remove-plugin
Print message when removing plugin with config
2016-09-06 11:43:51 -04:00
Jason Tedor 6df70444a3 Remove Log4j 1 jar hell exemption
When Elasticsearch depended on Log4j 1, there was jar hell from the
log4j and the apache-log4j-extras jar. As these dependencies are gone,
the jar hell exemption for Log4j 1 can be removed.

Relates #20336
2016-09-06 10:25:22 -04:00
Jason Tedor f427d7fe74 More verbose message on preserving plugin config
This commit expands on the message printed when config files are
preserved when removing a plugin to give the user an indication of the
reason the config files are preserved.
2016-09-06 08:51:12 -04:00
Boaz Leskes c56cd46162 Verify AllocationIDs in replication actions (#20320)
Replicated operation consist of a routing action (the original), which is in charge of sending the operation to the primary shard, a primary action which executes the operation on the resolved primary and replica actions which performs the operation on a specific replica. This commit adds the targeted shard's allocation id to the primary and replica actions and makes sure that those match the shard the actions end up executing on.

This helps preventing extremely rare failure mode where a shard moves off a node and back to it, all between an action is sent and the time it's processed. 

For example:
1) Primary action is sent to a relocating primary on node A.
2) The primary finishes relocation to node B and start relocating back.
3) The relocation back gets to the phase and opens up the target engine, on the original node, node A.
4) The primary action is executed on the target engine before the relocation finishes, at which the shard copy on node B is still the official primary - i.e., it is executed on the wrong primary.
2016-09-06 14:32:48 +02:00
Jason Tedor 75956604eb Print message when removing plugin with config
When removing a plugin with a config directory, we preserve the config
directory. This is because the workflow for upgrading a plugin involves
removing and then installing the plugin again and losing the plugin
config in this case would be terrible. This commit causes a message
regarding this to be printed in case the user wants to manually delete
these files.
2016-09-06 08:01:43 -04:00
Jason Tedor ab86660c65 Add finals to RemovePluginCommand
This commit marks the RemovePluginCommand class as final, and marks
some local variables as final too.
2016-09-06 07:39:23 -04:00
Jason Tedor e081b2b2e8 Remove length violation in RemovePluginCommand
This commit removes a line-length violation in RemovePluginCommand.java
and removes this file from the list of files for which the line-length
check is suppressed.
2016-09-06 07:28:05 -04:00
Jason Tedor 7b43d9b0ec Add test for Log4j throwable proxy leniency
We have intentionally introduced leniency for ThrowableProxy from Log4j
to work around a bug there. Yet, a test for this introduced leniency was
not addded. This commit introduces such a test.

Relates #20329
2016-09-06 05:55:06 -04:00
Jason Tedor 0003196749 Remove Joda-Time jar hell exemption
Previously we had an exemption for Joda-Time BaseDateTime because we
forked this class to remove the usage of a volatile field. This hack is
no longer in place, so the exemption is no longer necessary. This commit
removes that exemption.

Relates #20328
2016-09-06 04:47:42 -04:00
Jun Ohtani f0be657699 Clean up Analyze API test case
Using expectThrows instead of using try-catch
2016-09-06 15:46:18 +09:00
Simon Willnauer 5c2d9fa158 Improve error reporting for tests with BackgroundIndexer (#20324)
The BackgroundIndexer now uses auto-generated IDs randomly. This causes some problems
for tests that still rely on the fact that the IDs are increasing integers. This change
exposes all IDs via a Set<String> to iterate over for tests.
2016-09-05 16:28:49 +02:00
Jason Tedor 433cae47ed Mark CSIT#testLoggerLevelUpdate as awaits fix
This commit marks ClusterSettingsIT#testLoggerLevelUpdate as awaiting a
fix due to a test bug.
2016-09-04 11:09:08 -04:00
Jason Tedor 41637a1294 Only warn on old log configs if resolving configs
A warning was introduced if old log config files are present (e.g.,
logging.yml). However, this check is executed unconditionally. This can
lead to no such file exceptions when logging configs are not being
resolved, for example when installing a plugin. This commit moves this
check to only execute when logging configs are being resolved.
2016-09-03 09:48:09 -04:00
Jason Tedor e297fd419b Workaround possible JVM bug on Windows
Some assertions in MaxMapCountCheckTests assert that certain messages
are logged. These assertions pass everywhere except Windows where the
JVM seems confused. The issue is not the javac compiler as the bytecode
produced on OS X and Windows is identical for the relevant classes so
this leaves a possible JVM bug. It is not worth investigating the
ultimate cause of this bug so instead this commit introduces a
workaround.
2016-09-03 09:26:03 -04:00
Jason Tedor b9966fed36 Hack around Log4j bug rendering exceptions
Log4j has a bug where it does not handle a security exception that can
be thrown when it is rendering a stack trace. This commit intentionally
introduces jar hell with the ThrowableProxy class to work around this
bug until a fix is a released.

Relates #20306
2016-09-02 20:26:32 -04:00
Jason Tedor 40f889b825 Warn if unsupported logging configuration present
This commit adds a warning that an unsupported logging configuration is
present and points users to the new logging configuration file.

Relates #20309
2016-09-02 18:36:57 -04:00
Simon Willnauer c992a007c8 Pass on maxUnsafeAutoIdTimestamp on recovery / relocation (#20300)
To ensure we don't add documents more than once even if it's mostly paranoia
except of one case where we relocated a shards away and back to the same node
while an initial request is in flight but has not yet finished AND is retried.

Yet, this is a possible case and for that reason we ensure we pass on the
maxUnsafeAutoIdTimestamp on when we prepare for translog recovery.

Relates to #20211
2016-09-02 21:07:55 +02:00
Ali Beyad d2ab42eabe [TESTS] added higher level logging to the testShadowReplicaNaturalRelocation
test
2016-09-02 14:57:22 -04:00
Jun Ohtani c4759bcc02 Merge pull request #20285 from johtani/fix/remove_token_filter_param_in_analyze_api
Remove `token_filter` in _analyze API
2016-09-03 02:03:51 +09:00
Masaru Hasegawa af959c0c91 Merge pull request #20299 from masaruh/query_string_fuzzy
query_string_query should take term length into consideration when fuzziness is auto
2016-09-02 23:33:49 +09:00
Nik Everett 549ca3178b Rename method in OldIndexUtils
loadIndexList -> loadDataFilesList. The new method name is more accurate.
2016-09-02 10:16:30 -04:00