75 Commits

Author SHA1 Message Date
Martijn van Groningen
a61ec11f36
Expose Engine.Searcher provider to ingest plugins. ()
Relates to 
2019-04-24 20:49:16 +02:00
Adrien Grand
9fd5237fd4
Clean up Node#close. () ()
`Node#close` is pretty hard to rely on today:
 - it might swallow exceptions
 - it waits for 10 seconds for threads to terminate but doesn't signal anything
   if threads are still not terminated after 10 seconds

This commit makes `IOException`s propagated and splits `Node#close` into
`Node#close` and `Node#awaitClose` so that the decision what to do if a node
takes too long to close can be done on top of `Node#close`.

It also adds synchronization to lifecycle transitions to make them atomic. I
don't think it is a source of problems today, but it makes things easier to
reason about.
2019-04-17 16:10:53 +02:00
Ryan Ernst
5cdd87deb7 Remove settings members from Node ()
This commit removes the settings member variable from Node.
This member made it confusing which settings should actually be looked
at. Now all settings are accessed through the final environment.
2019-04-11 13:59:54 -07:00
Jason Tedor
9ce740a2eb
Modfiy casing in JVM home log message
This makes the log message consistent with the following line that shows
the JVM arguments.
2019-03-20 00:06:16 -04:00
Ryan Ernst
465343f12a
Bundle java in distributions ()
* Bundle java in distributions

Setting up a jdk is currently a required external step when installing
elasticsearch. This is particularly problematic for the rpm/deb packages
as installing a jdk in the same package installation command does not
guarantee any order, so must be done in separate steps. Additionally,
JAVA_HOME must be set and often causes problems in selecting a correct
jdk when, for example, the system java is an older unsupported version.

This commit bundles platform specific openjdks into each distribution.
In addition to eliminating the issues above, it also presents future
possible improvements like using jlink to build jdk images only
containing modules that elasticsearch uses.

closes 
2019-03-08 11:04:18 -08:00
Przemyslaw Gomulka
28b5c7ce78
Do not set up NodeAndClusterIdStateListener in test ()
When extending ESIntegTestCase are run on the same jvm, the static field in
NodeAndClusterIdConverter will throw an AlreadySet exceptions.
overriding the configuration method from Node.configureNodeAndClusterIdStateListener in the MockNode will prevent the listener registration from happening
relates 
2019-01-31 18:59:40 +01:00
Przemyslaw Gomulka
891320f5ac
Elasticsearch support to JSON logging ()
In order to support JSON log format, a custom pattern layout was used and its configuration is enclosed in ESJsonLayout. Users are free to use their own patterns, but if smooth Beats integration is needed, they should use ESJsonLayout. EvilLoggerTests are left intact to make sure user's custom log patterns work fine.

To populate additional fields node.id and cluster.uuid which are not available at start time, 
a cluster state update will have to be received and the values passed to log4j pattern converter.
A ClusterStateObserver.Listener is used to receive only one ClusteStateUpdate. Once update is received the nodeId and clusterUUid are set in a static field in a NodeAndClusterIdConverter. 

Following fields are expected in JSON log lines: type, tiemstamp, level, component, cluster.name, node.name, node.id, cluster.uuid, message, stacktrace
see ESJsonLayout.java for more details and field descriptions

Docker log4j2 configuration is now almost the same as the one use for ES binary. 
The only difference is that docker is using console appenders, whereas ES is using file appenders.

relates: 
2019-01-29 07:20:09 +01:00
Dimitrios Liappis
63793499bd
Fix line length for node and remove suppresion ()
Relates 
2019-01-15 19:57:24 +02:00
Ryan Ernst
8ec8342a52
Internal: Remove originalSettings from Node ()
This commit removes the originalSettings member from Node. It was only
needed to allows test clusters to recreate the node in certain
situations. Instead, the test cluster now keeps track of these settings.
2018-12-18 10:05:27 -08:00
David Roberts
13cb0fb98b
Periodically try to reassign unassigned persistent tasks ()
Previously persistent task assignment was checked in the
following situations:

- Persistent tasks are changed
- A node joins or leaves the cluster
- The routing table is changed
- Custom metadata in the cluster state is changed
- A new master node is elected

However, there could be situations when a persistent
task that could not be assigned to a node could become
assignable due to some other change, such as memory
usage on the nodes.

This change adds a timed recheck of persistent task
assignment to account for such situations.  The timer
is suspended while checks triggered by cluster state
changes are in-flight to avoid adding burden to an
already busy cluster.

Closes 
2018-12-13 09:15:27 +00:00
Tal Levy
cd1bec3a06
[refactor] add Environment in BootstrapContext ()
There are certain BootstrapCheck checks that may need access environment-specific
values. Watcher's EncryptSensitiveDataBootstrapCheck passes in the node's environment
via a constructor to bypass the shortcoming in BootstrapContext. This commit
pulls in the node's environment into BootstrapContext.

Another case is found in , where it is useful to check the state of the
data-path. Since PathUtils.get and Paths.get are forbidden APIs, we rely on
the environment to retrieve references to things like node data paths.

This means that the BootstrapContext will have the same Settings used in the
Environment, which currently differs from the Node's settings.
2018-12-12 21:07:21 -08:00
Tim Brooks
790f8102e9
Modify BigArrays to take name of circuit breaker ()
This commit modifies BigArrays to take a circuit breaker name and
the circuit breaking service. The default instance of BigArrays that
is passed around everywhere always uses the request breaker. At the
network level, we want to be using the inflight request breaker. So this
change will allow that.

Additionally, as this change moves away from a single instance of
BigArrays, the class is modified to not be a Releasable anymore.
Releasing big arrays was always dispatching to the PageCacheRecycler,
so this change makes the PageCacheRecycler the class that needs to be
managed and torn-down.

Finally, this commit closes  be making the serialization of
transport messages use the inflight request breaker. With this change,
we no longer push the global BigArrays instnace to the network level.
2018-12-11 11:55:41 -07:00
Andrey Ershov
35e3d77e2c
[Zen2] Implement state recovery ()
This commit implements proper metadata recovery for Zen2.

GatewayService is responsible for the recovery. In Zen1 GatewayService
creates an instance of Gateway, that is used to reach out to other cluster
nodes, get their state and calculate the most up-to-date state based on
versions. After that Gateway performs upgrade and archival of
 ClusterSettings and closes bad indices. Then recovered state is passed to GatewayService.GatewayRecoveryListener that mixes up current state
and restored state, removes state not recovered block, creates the
routing table and performs re-routing.

In Zen2 we should perform this kind of logic on cluster startup, except
mixing state (because there is nothing to mix) and opening routing table.

This commit refactors out all `ClusterUpdate` functions in a separate class
`ClusterStateUpdaters`, which is used by `Gateway` and `GatewayService`
in case of Zen1, and by `GatewayMetaState` and `GatewayService` in case of
Zen2.

This commit also switches all integration tests that are already using Zen2 from
InMemoryPersistedState to GatewayMetaState.
2018-12-04 14:45:45 +01:00
Yannick Welsch
80ee7943c9 Merge remote-tracking branch 'elastic/master' into zen2 2018-12-04 09:37:09 +01:00
Ryan Ernst
afd42df15f
Core: Deguice RepositoriesService ()
This commit moves the RepositoriesService to be created outside of
guice.
2018-11-28 21:20:44 -08:00
Andrey Ershov
0e283f9670
[Zen2] PersistedState interface implementation ()
Today GatewayMetaState is capable of atomically storing MetaData to
disk. We've also moved fields that are needed to be persisted in Zen2
from ClusterState to ClusterState.MetaData.CoordinationMetaData.

This commit implements PersistedState interface.

version and currentTerm are persisted as a part of Manifest.
GatewayMetaState now implements both ClusterStateApplier and
PersistedState interfaces. We started with two descendants
Zen1GatewayMetaState and Zen2GatewayMetaState, but it turned
out to be not easy to glue it.
GatewayMetaState now constructs previousClusterState (including
MetaData) and previousManifest inside the constructor so that all
PersistedState methods are usable as soon as GatewayMetaState
instance is constructed. Also, loadMetaData is renamed to
getMetaData, because it just returns
previousClusterState.metaData().
Sadly, we don't have access to localNode (obtained from 
TransportService in the constructor, so getLastAcceptedState
should be called, after setLocalNode method is invoked.
Currently, when deciding whether to write IndexMetaData to disk,
we're comparing current IndexMetaData version and received
IndexMetaData version. This is not safe in Zen2 if the term has changed.
So updateClusterState now accepts incremental write
method parameter. When it's set to false, we always write
IndexMetaData to disk.
Things that are not covered by GatewayMetaStateTests are covered
by GatewayMetaStatePersistedStateTests.
This commit also adds an option to use GatewayMetaState instead of
InMemoryPersistedState in TestZenDiscovery. However, by default
InMemoryPersistedState is used and only one test in PersistedStateIT
used GatewayMetaState. In order to use it for other tests, proper
state recovery should be implemented.
2018-11-27 15:04:52 +01:00
Andrey Ershov
f9ecd0c49e
[Zen2] Write manifest file ()
Elasticsearch node is responsible for storing cluster metadata. 
There are 2 types of metadata: global metadata and index metadata. 
`GatewayMetaState` implements `ClusterStateApplier` and receives all 
`ClusterStateChanged` events and is responsible for storing modified 
metadata to disk. 

When new `ClusterStateChanged` event is received, `GatewayMetaState` 
checks if global metadata has changed and if it's the case writes new 
global metadata to disk. After that `GatewayMetaState` checks if index 
metadata has changed or there are new indices assigned to this node and 
if it's the case writes new index metadata to disk. Atomicity of global 
metadata and index metadata writes is ensured by `MetaDataStateFormat` 
class.

Unfortunately, there is no atomicity when more than one metadata changes
(global and index, or metadata for two indices). And atomicity is 
important for Zen2 correctness.
This commit adds atomicity by adding a notion of manifest file, 
represented by `MetaState` class. `MetaState` contains pointers to
current metadata.
More precisely, it stores global state generation as long and map from 
`Index` to index metadata generation as long. Atomicity of writes for 
manifest file is ensured by `MetaStateFormat` class.

The algorithm of writing changes to the disk would be the following:

1. Write global metadata state file to disk and remember
it's generation.
2. For each new/changed index write state file to disk and remember
it's generation. For each not-changed index use generation from 
previous manifest file. If index is removed or this node is no longer
responsible for this index - forget about the index.
3. Create `MetaState` object using previously remembered generations and
write it to disk.
4. Remove old state files for global metadata, indices metadata and 
manifest.

Additonally new implementation relies on enhanced `MetaDataStateFormat` 
failure semantics, `applyClusterState` throws IOException, whose 
descendant `WriteStateException` could be (and should be in Zen2) 
explicitly handled.
2018-11-19 19:49:44 +01:00
Jason Tedor
4f4fc3b8f8
Replicate index settings to followers ()
This commit uses the index settings version so that a follower can
replicate index settings changes as needed from the leader.

Co-authored-by: Martijn van Groningen <martijn.v.groningen@gmail.com>
2018-11-07 21:20:51 -05:00
Alpar Torok
8a85b2eada
Remove build qualifier from server's Version ()
With this change, `Version` no longer carries information about the qualifier,
we still need a way to show the "display version" that does have both
qualifier and snapshot. This is now stored  by the build and red from `META-INF`.
2018-11-07 14:01:05 +02:00
Nik Everett
e28509fbfe
Core: Less settings to AbstractComponent ()
Stop passing `Settings` to `AbstractComponent`'s ctor. This allows us to
stop passing around `Settings` in a *ton* of places. While this change
touches many files, it touches them all in fairly small, mechanical
ways, doing a few things per file:
1. Drop the `super(settings);` line on everything that extends
`AbstractComponent`.
2. Drop the `settings` argument to the ctor if it is no longer used.
3. If the file doesn't use `logger` then drop `extends
AbstractComponent` from it.
4. Clean up all compilation failure caused by the `settings` removal
and drop any now unused `settings` isntances and method arguments.

I've intentionally *not* removed the `settings` argument from a few
files:
1. TransportAction
2. AbstractLifecycleComponent
3. BaseRestHandler

These files don't *need* `settings` either, but this change is large
enough as is.

Relates to 
2018-10-31 21:23:20 -04:00
lipsill
2b652f3242 Logging: server: clean up logging ()
Replace internal deprecated calls to `Loggers.getLogger(Class)`
with direct calls to log4j `LogManager.getLogger(Class)`
2018-10-25 09:52:50 -04:00
Nik Everett
26c4f1fb6c
Core: Default node.name to the hostname ()
Changes the default of the `node.name` setting to the hostname of the
machine on which Elasticsearch is running. Previously it was the first 8
characters of the node id. This had the advantage of producing a unique
name even when the node name isn't configured but the disadvantage of
being unrecognizable and not being available until fairly late in the
startup process. Of particular interest is that it isn't available until
after logging is configured. This forces us to use a volatile read
whenever we add the node name to the log.

Using the hostname is available immediately on startup and is generally
recognizable but has the disadvantage of not being unique when run on
machines that don't set their hostname or when multiple elasticsearch
processes are run on the same host. I believe that, taken together, it
is better to default to the hostname.

1. Running multiple copies of Elasticsearch on the same node is a fairly
advanced feature. We do it all the as part of the elasticsearch build
for testing but we make sure to set the node name then.
2. That the node.name defaults to some flavor of "localhost" on an
unconfigured box feels like it isn't going to come up too much in
production. I expect most production deployments to at least set the
hostname.

As a bonus, production deployments need no longer set the node name in
most cases. At least in my experience most folks set it to the hostname
anyway.
2018-09-19 15:21:29 -04:00
Jason Tedor
6bb817004b
Add infrastructure to upgrade settings ()
In some cases we want to deprecate a setting, and then automatically
upgrade uses of that setting to a replacement setting. This commit adds
infrastructure for this so that we can upgrade settings when recovering
the cluster state, as well as when such settings are dynamically applied
on cluster update settings requests. This commit only focuses on cluster
settings, index settings can build on this infrastructure in a
follow-up.
2018-09-09 20:49:19 -04:00
Nik Everett
190ea9a6de
Logging: Configure the node name when we have it ()
Change the logging infrastructure to handle when the node name isn't
available in `elasticsearch.yml`. In that case the node name is not
available until long after logging is configured. The biggest change is
that the node name logging no longer fixed at pattern build time.
Instead it is read from a `SetOnce` on every print. If it is unset it is
printed as `unknown` so we have something that fits in the pattern.
On normal startup we don't log anything until the node name is available
so we never see the `unknown`s.
2018-09-07 14:31:23 -04:00
Tim Brooks
88c178dca6
Add sni name to SSLEngine in netty transport ()
This commit is related to . It allows an "server_name"
attribute on a DiscoveryNode to be propagated to the server using
the TLS SNI extentsion. This functionality is only implemented for
the netty security transport.
2018-09-05 16:12:10 -06:00
Jason Tedor
09bf4e5f00
Introduce private settings ()
This commit introduces the formal notion of a private setting. This
enables us to register some settings that we had previously not
registered as fully-fledged settings to avoid them being exposed via
APIs such as the create index API. For example, we had hacks in the
codebase to allow index.version.created to be passed around inside of
settings objects, but was not registered as a setting so that if a user
tried to use the setting on any API then they would get an
exception. This prevented users from setting index.version.created on
index creation, or updating it via the index settings API. By
introducing private settings, we can continue to reject these attempts,
yet now we can represent these settings as actual settings. In this
change, we register index.version.created as an actual setting. We do
not cutover all settings that we had been treating as private in this
pull request, it is already quite large due to moving some tests around
to account for the fact that some tests need to be able to set the
index.version.created. This can be done in a follow-up change.
2018-09-03 19:17:57 -04:00
Nhat Nguyen
d3f32273eb Merge branch 'master' into ccr 2018-08-30 23:22:58 -04:00
David Turner
47859e56ac
Move file-based discovery to core ()
Today we support a static list of seed hosts in core Elasticsearch, and allow a
dynamic list of seed hosts to be provided via a file using the `discovery-file`
plugin. In fact the ability to provide a dynamic list of seed hosts is
increasingly useful, so this change moves this functionality to core
Elasticsearch to avoid the need for a plugin.

Furthermore, in order to start up nodes in integration tests we currently
assign a known port to each node before startup, which unfortunately sometimes
fails if another process grabs the selected port in the meantime. By moving the
`discovery-file` functionality into the core product we can use it to avoid
this race.

This change also moves the expected path to the file from
`$ES_PATH_CONF/discovery-file/unicast_hosts.txt` to
`$ES_PATH_CONF/unicast_hosts.txt`. An example of this file is not included in
distributions.

For BWC purposes the plugin still exists, but does nothing more than create the
example file in the old location, and issue a warning when it is used. We also
continue to support the old location for the file, but warn about its
deprecation.

Relates 
Closes 
2018-08-30 06:43:04 +01:00
Martijn van Groningen
82592dda5a
Merge remote-tracking branch 'es/master' into ccr
* es/master: (62 commits)
  [DOCS] Add docs for Application Privileges ()
  Add versions 5.6.12 and 6.4.1
  Do NOT allow termvectors on nested fields ()
  [Rollup] Return empty response when aggs are missing ()
  [TEST] Add some ACL yaml tests for Rollup ()
  Move non duplicated actions back into xpack core ()
  Test fix - GraphExploreResponseTests should not randomise array elements Closes 
  Use `addIfAbsent` instead of checking if an element is contained
  TESTS: Fix Random Fail in MockTcpTransportTests ()
  HLRC: Fix Compile Error From Missing Throws ()
  [DOCS] Remove reload password from docs cf. 
  HLRC: Add ML Get Buckets API ()
  Watcher: Improve error messages for CronEvalTool ()
  Search: Support of wildcard on docvalue_fields ()
  Change query field expansion ()
  INGEST: Cleanup Redundant Put Method ()
  SQL: skip uppercasing/lowercasing function tests for AZ locales as well ()
  Fix the default pom file name ()
  Switch ml basic tests to new style Requests ()
  Switch some watcher tests to new style Requests ()
  ...
2018-08-24 12:22:11 +07:00
Armin Braun
8fc213f237
INGEST: Move all Pipeline State into IngestService ()
* INGEST: Move all Pipeline State into IngestService

* Moves all pipeline state into the ingest service
   * Retains the existing pipeline store and pipeline execution service as inner classes to make the review easier, they should be flattened out in the next step
   * All tests for these classes were copied (and adapted) to the ingest service tests
* This is a refactoring step to enable a clean implementation of a pipeline processor (See )
2018-08-21 05:05:32 +02:00
Nhat Nguyen
6eeb628d6d Merge branch 'master' into ccr
* master:
  HLRC: Move commercial clients from XPackClient ()
  Add cluster UUID to Cluster Stats API response ()
  Security: move User to protocol project ()
  [TEST] Test for shard failures, add debug to testProfileMatchesRegular
  Minor fix for javadoc (applicable for java 11). ()
  Painless: Move Some Lookup Logic to PainlessLookup ()
  TEST: Avoid merges in testSeqNoAndCheckpoints
  [Rollup] Remove builders from HistoGroupConfig ()
  Mutes failing SQL string function tests due to 
  fixed elements in array of produced terms ()
  INGEST: Enable default pipelines ()
  Remove cluster state initial customs ()
  Mutes LicensingDocumentationIT due to 
  [ML] Remove multiple_bucket_spans ()
  [ML] Rename JobProvider to JobResultsProvider ()
  Correct minor typo in explain.asciidoc for HLRC
  Build: Add elastic maven to repos used by BuildPlugin ()
  Clarify the error message when a pipeline agg is used in the 'order' parameter. ()
  Revert "[test] turn on host io cache for opensuse ()"
  Enable packaging tests on suse boxes
  [ML] Improve error when no available field exists for rule scope ()
  [ML] Improve error for functions with limited rule condition support ()
  Painless: Clean Up PainlessField ()
  Add @AwaitsFix for 
  Remove broken @link in Javadoc
  Scripting: Conditionally use java time api in scripting ()
  [ML] Fix thread leak when waiting for job flush () ()
  Add AwaitsFix to failing test - see 
  Core: Minor size reduction for AbstractComponent ()
  SQL: Added support for string manipulating functions with more than one parameter ()
  [DOCS] Reloadable Secure Settings ()
  Watcher: Reenable HttpSecretsIntegrationTests#testWebhookAction test ()
  [Rollup] Remove builders from TermsGroupConfig ()
  Use hostname instead of IP with SPNEGO test ()
  Switch x-pack rolling restart to new style Requests ()
  NETWORKING: Fix Netty Leaks by upgrading to 4.1.28 ()
  [DOCS] Small fixes in rule configuration page ()
  Painless: Clean up PainlessMethod ()
  Build: Remove shadowing from benchmarks ()
  Docs: Add all JDKs to CONTRIBUTING.md
  Add licensing enforcement for FIPS mode ()
  SQL: Add test for handling of partial results ()
  Mute testFilterCacheStats
  [ML][DOCS] Fix typo applied_to => applies_to
  Scripting: Fix painless compiler loader to know about context classes ()
2018-08-02 23:14:37 -04:00
Yannick Welsch
db6e8c736d
Remove cluster state initial customs ()
This infrastructure was introduced in  and made obsolete in 
2018-08-02 15:49:59 +02:00
Nhat Nguyen
036cb3f864 Merge branch 'master' into ccr
* master:
  Logging: Make node name consistent in logger ()
  Mute SSLTrustRestrictionsTests on JDK 11
  Increase max chunk size to 256Mb for repo-azure ()
  Docs: Fix README upgrade mention ()
  Changed ReindexRequest to use Writeable.Reader ()
  Mute KerberosAuthenticationIT
  Fix AutoIntervalDateHistogram.testReduce random failures ()
  fix no=>not typo ()
  Mute QueryProfilerIT#testProfileMatchesRegular()
  HLRC: Add delete watch action ()
  High-level client: fix clusterAlias parsing in SearchHit ()
  Fix calculation of orientation of polygons ()
  [Kerberos] Add missing javadocs ()
  [Kerberos] Remove Kerberos bootstrap checks ()
  Make get all app privs requires "*" permission ()
  Switch security to new style Requests ()
  Switch security spi example to new style Requests ()
  Painless: Add PainlessConstructor ()
  update rollover to leverage write-alias semantics ()
  Update Fuzzy Query docs to clarify default behavior re max_expansions ()
  INGEST: Clean up Java8 Stream Usage ()
  Ensure KeyStoreWrapper decryption exceptions are handled ()
2018-07-31 10:56:10 -04:00
Nik Everett
22459576d7
Logging: Make node name consistent in logger ()
First, some background: we have 15 different methods to get a logger in
Elasticsearch but they can be broken down into three broad categories
based on what information is provided when building the logger.

Just a class like:
```
private static final Logger logger = ESLoggerFactory.getLogger(ActionModule.class);
```
or:
```
protected final Logger logger = Loggers.getLogger(getClass());
```

The class and settings:
```
this.logger = Loggers.getLogger(getClass(), settings);
```

Or more information like:
```
Loggers.getLogger("index.store.deletes", settings, shardId)
```

The goal of the "class and settings" variant is to attach the node name
to the logger. Because we don't always have the settings available, we
often use the "just a class" variant and get loggers without node names
attached. There isn't any real consistency here. Some loggers get the
node name because it is convenient and some do not.

This change makes the node name available to all loggers all the time.
Almost. There are some caveats are testing that I'll get to. But in
*production* code the node name is node available to all loggers. This
means we can stop using the "class and settings" variants to fetch
loggers which was the real goal here, but a pleasant side effect is that
the ndoe name is now consitent on every log line and optional by editing
the logging pattern. This is all powered by setting the node name
statically on a logging formatter very early in initialization.

Now to tests: tests can't set the node name statically because
subclasses of `ESIntegTestCase` run many nodes in the same jvm, even in
the same class loader. Also, lots of tests don't run with a real node so
they don't *have* a node name at all. To support multiple nodes in the
same JVM tests suss out the node name from the thread name which works
surprisingly well and easy to test in a nice way. For those threads
that are not part of an `ESIntegTestCase` node we stick whatever useful
information we can get form the thread name in the place of the node
name. This allows us to keep the logger format consistent.
2018-07-31 10:54:24 -04:00
Nhat Nguyen
2f756b00f6 Merge branch 'master' into ccr
* master:
  Remove reference to non-existent store type ()
  [TEST] Mute failing FlushIT test
  Fix ordering of bootstrap checks in docs ()
  [TEST] Mute failing InternalEngineTests#testSeqNoAndCheckpoints
  [TEST] Mute failing testConvertLongHexError
  bump lucene version after backport
  Upgrade to Lucene-7.5.0-snapshot-608f0277b0 ()
  [Kerberos] Avoid vagrant update on precommit ()
  TESTS: Move netty leak detection to paranoid level ()
  [DOCS] Fixes formatting of scope object in job resource
  Copy missing segment attributes in getSegmentInfo ()
  AbstractQueryTestCase should run without type less often ()
  INGEST: Fix Deprecation Warning in Script Proc. ()
  Switch x-pack/plugin to new style Requests ()
  Docs: Correcting a typo in tophits ()
  Build: Stop double generating buildSrc pom ()
  TEST: Avoid triggering merges in FlushIT
  Fix missing JavaDoc for @throws in several places in KerberosTicketValidator.
  Switch x-pack full restart to new style Requests ()
  Release requests in cors handler ()
  Painless: Clean Up PainlessClass Variables ()
  Docs: Fix callouts in put license HL REST docs ()
  [ML] Consistent pattern for strict/lenient parser names ()
  Update update-settings.asciidoc ()
  Remove some dead code ()
  Introduce index store plugins ()
  Rank-Eval: Reduce scope of an unchecked supression
  Make sure _forcemerge respects `max_num_segments`. ()
  TESTS: Fix Buf Leaks in HttpReadWriteHandlerTests ()
  Only enforce password hashing check if FIPS enabled ()
2018-07-27 16:24:03 -04:00
Jason Tedor
eb675a1c4d
Introduce index store plugins ()
Today we allow plugins to add index store implementations yet we are not
doing this in our new way of managing plugins as pull versus push. That
is, today we still allow plugins to push index store providers via an on
index module call where they can turn around and add an index
store. Aside from being inconsistent with how we manage plugins today
where we would look to pull such implementations from plugins at node
creation time, it also means that we do not know at a top-level (for
example, in the indices service) which index stores are available. This
commit addresses this by adding a dedicated plugin type for index store
plugins, removing the index module hook for adding index stores, and by
aggregating these into the top-level of the indices service.
2018-07-26 08:05:49 -04:00
Nhat Nguyen
a55f614b85 Merge branch 'master' into ccr
* master:
  ingest: Add ignore_missing property to foreach filter () ()
  Fix a formatting issue in the docvalue_fields documentation. ()
  reduce log level at gradle configuration time
  [TEST] Close additional clients created while running yaml tests ()
  Docs: Clarify sensitive fields watcher encryption ()
  Watcher: Remove never executed code ()
  Add support for switching distribution for all integration tests ()
  Improve robustness of geo shape parser for malformed shapes ()
  QA: Create xpack yaml features ()
  Improve test times for tests using `RandomObjects::addFields` ()
  [Test] Add full cluster restart test for Rollup ()
  Enhance thread context uniqueness assertion
  [DOCS] Fix heading format errors ()
  fix writeIndex evaluation for aliases ()
  Add x-opaque-id to search slow logs ()
  Watcher: Fix put watch action ()
  Add package pre-install check for java binary ()
  Reduce number of raw types warnings ()
  Migrate scripted metric aggregation scripts to ScriptContext design ()
  turn GetFieldMappingsResponse to ToXContentObject ()
  Close xcontent parsers (partial) ()
  Ingest Attachment: Upgrade Tika to 1.18 ()
  TEST: Correct the assertion arguments order ()
2018-06-26 16:25:32 -04:00
Igor Motov
237650e9c0
Add x-opaque-id to search slow logs ()
Add x-opaque-id to search slow logs only. Indexing slow log and audit
logs will be handled as separate PRs.

Relates 
2018-06-25 12:20:27 -07:00
Nhat Nguyen
ec04366d29 Merge branch 'master' into ccr
* master:
  Add get stored script and delete stored script to high level REST API - post backport fix
  Add get stored script and delete stored script to high level REST API ()
  Core: Combine Action and GenericAction ()
  Fix reference to XContentBuilder.string() ()
  Avoid sending duplicate remote failed shard requests ()
  Fix defaults in GeoShapeFieldMapper output ()
  RestAPI: Reject forcemerge requests with a body ()
  Packaging: Remove windows bin files from the tar distribution ()
  Docs: Use the default distribution to test docs ()
  [DOCS] Adds testing for security APIs ()
  Clarify that IP range data can be specified in CIDR notation. ()
  Use system context for cluster state update tasks ()
  Percentile/Ranks should return null instead of NaN when empty ()
  REST high-level client: add validate query API ()
  Move language analyzers from server to analysis-common module. ()
  [Test] Fix :example-plugins:rest-handler on Windows
  Expose lucene's RemoveDuplicatesTokenFilter ()
  Reload secure settings for plugins ()
  Remove some cases in FieldTypeLookupTests that are no longer relevant. ()
  Ensure we don't use a remote profile if cluster name matches ()
  [TEST] Double write alias fault ()
  [DOCS] Fix version in SQL JDBC Maven template
  [DOCS] Improve install and setup section for SQL JDBC
  SQL: Fix rest endpoint names in node stats ()
  Support for remote path in reindex api - post backport fix Closes 
  [ML] Put ML filter API response should contain the filter ()
  Support for remote path in reindex api ()
  Add byte array pooling to nio http transport ()
  Remove trial status info from start trial doc ()
  [DOCS] Adds links to release notes and highlights
  add is-write-index flag to aliases ()
  Add rollover-creation-date setting to rolled over index ()
  [ML] Hold ML filter items in sorted set ()
  [Tests] Fix edge case in ScriptedMetricAggregatorTests ()
2018-06-19 09:46:39 -04:00
Ryan Ernst
e67aa96c81
Core: Combine Action and GenericAction ()
Since , Action no longer has anything but a call to the
GenericAction super constructor. This commit renames GenericAction
into Action, thus eliminating the Action class. Additionally, this
commit removes the Request generic parameter of the class, since
it was unused.
2018-06-18 23:53:04 +02:00
Tal Levy
eda4964f64
Add rollover-creation-date setting to rolled over index ()
This commit introduces a new property to IndexMetaData called
RolloverInfo. This object contains a map containing the aliases
that were used to rollover the related index, which conditions
were met, and at what time the rollover took place.

much like the `index.creation_date`, it captures the approximate time
that the index was rolled over to a new one.
2018-06-15 08:44:29 -07:00
Nhat Nguyen
2cffd85f7f Merge branch 'master' into ccr
* master:
  Remove RestGetAllAliasesAction ()
  Temporary fix for broken build
  Reenable Checkstyle's unused import rule ()
  Remove remaining unused imports before merging 
  Fix non-REST doc snippet
  [DOC] Extend SQL docs
  Immediately flush channel after writing to buffer ()
  [DOCS] Shortens ML API intros
  Use quotes in the call invocation ()
  move security ingest processors to a sub ingest directory ()
  Add 5.6.11 version constant.
  Fix version detection.
  SQL: Whitelist SQL utility class for better scripting ()
  [Docs] All Rollup docs experimental, agg limitations, clarify DeleteJob ()
  CCS: don't proxy requests for already connected node ()
  Mute ScriptedMetricAggregatorTests testSelfReferencingAggStateAfterMap
  [test] opensuse packaging turn up debug logging
  Add unreleased version 6.3.1
  Removes experimental tag from scripted_metric aggregation ()
  [Rollup] Metric config parser must use builder so validation runs ()
  [ML] Check licence when datafeeds use cross cluster search  ()
  Add notion of internal index settings ()
  Test: Remove broken yml test feature ()
  REST hl client: cluster health to default to cluster level ()
  [ML] Update test thresholds to account for changes to memory control ()
  Log warnings when cluster state publication failed to some nodes ()
  Fix AntFixture waiting condition ()
  Ignore numeric shard count if waiting for ALL ()
  [ML] Implement new rules design ()
  index_prefixes back-compat should test 6.3 ()
  Core: Remove plain execute method on TransportAction ()
  Update checkstyle to 8.10.1 ()
  Set analyzer version in PreBuiltAnalyzerProviderFactory ()
  Modify pipelining handlers to require full requests ()
  Revert upgrade to Netty 4.1.25.Final ()
  Use armored input stream for reading public key ()
  Fix Netty 4 Server Transport tests. Again.
  REST hl client: adjust wait_for_active_shards param in cluster health ()
  REST high-level Client: remove deprecated API methods ()
  [DOCS] Mark SQL feature as experimental
  [DOCS] Updates machine learning custom URL screenshots ()
  Fix naming conventions check for XPackTestCase
  Fix security Netty 4 transport tests
  Fix race in clear scroll ()
  [DOCS] Clarify audit index settings when remote indexing ()
  Delete typos in SAML docs ()
  REST high-level client: add Cluster Health API ()
  [ML][TEST] Mute tests using rules ()
  Support RequestedAuthnContext ()
  SyncedFlushResponse to implement ToXContentObject ()
  Add Get Aliases API to the high-level REST client ()
  Remove some line length supressions ()
  Validate xContentType in PutWatchRequest. ()
  [INGEST] Interrupt the current thread if evaluation grok expressions take too long ()
  Suppress extras FS on caching directory tests
  Revert "[DOCS] Added 6.3 info & updated the upgrade table. ()"
  Revert "Fix snippets in upgrade docs"
  Fix snippets in upgrade docs
  [DOCS] Added 6.3 info & updated the upgrade table. ()
  LLClient: Support host selection ()
  Upgrade to Netty 4.1.25.Final ()
  Enable custom credentials for core REST tests ()
  Move ESIndexLevelReplicationTestCase to test framework ()
  Encapsulate Translog in Engine ()
  HLRest: Add get index templates API ()
  Remove all unused imports and fix CRLF ()
  [Tests] Fix self-referencing tests
  [TEST] Fix testRecoveryAfterPrimaryPromotion
  [Docs] Remove mention pattern files in Grok processor ()
  Use stronger write-once semantics for Azure repository ()
  Don't swallow exceptions on replication ()
  Limit the number of concurrent requests per node ()
  Call ensureNoSelfReferences() on _agg state variable after scripted metric agg script executions ()
  Move java version checker back to its own jar ()
  [test] add fix for rare virtualbox error ()
2018-06-14 10:47:36 -04:00
Tanguy Leroux
bf58660482
Remove all unused imports and fix CRLF ()
The X-Pack opening and the recent other refactorings left a lot of 
unused imports in the codebase. This commit removes them all.
2018-06-11 15:12:12 +02:00
Jason Tedor
64b4cdeda6
Merge remote-tracking branch 'elastic/master' into ccr
* elastic/master: (53 commits)
  Painless: Restructure/Clean Up of Spec Documentation ()
  Update ignore_unmapped serialization after backport
  Add back dropped substitution on merge
  high level REST api: cancel task ()
  Enable engine factory to be pluggable ()
  Remove vestiges of animal sniffer ()
  Rename elasticsearch-nio to nio ()
  Rename elasticsearch-core to core ()
  Move cli sub-project out of server to libs ()
  [DOCS] Fixes broken link in auditing settings
  QA: Better seed nodes for rolling restart
  [DOCS] Moves ML content to stack-docs
  [DOCS] Clarifies recommendation for audit index output type ()
  Add nio-transport as option for http smoke tests ()
  QA: Set better node names on rolling restart tests
  Add support for ignore_unmapped to geo sort ()
  Share common parser in some AcknowledgedResponses ()
  Fix random failure on SearchQueryIT#testTermExpansionExceptionOnSpanFailure
  Remove reference to multiple fields with one name ()
  Remove BlobContainer.move() method ()
  ...
2018-06-07 23:33:42 -04:00
Jason Tedor
e481b860a1
Enable engine factory to be pluggable ()
This commit enables the engine factory to be pluggable based on index
settings used when creating the index service for an index.
2018-06-07 17:01:06 -04:00
Nhat Nguyen
3fb2c45fa7 Merge branch 'master' into ccr
* master:
  [DOCS] Fixes typos in security settings
  Fix GeoShapeQueryBuilder serialization after backport
  [DOCS] Splits auditing.asciidoc into smaller files
  Reintroduce mandatory http pipelining support ()
  Painless: Types Section Clean Up ()
  Add support for indexed shape routing in geo_shape query ()
  [test] java tests for archive packaging ()
  Revert "Make http pipelining support mandatory ()" ()
  [DOCS] Fix more edit URLs in Stack Overview ()
  Use correct cluster state version for node fault detection ()
  Change serialization version of doc-value fields.
  [DOCS] Fixes broken link for native realm
  [DOCS] Clarified audit.index.client.hosts ()
  [TEST] Don't expect acks when isolating nodes
  Add a `format` option to `docvalue_fields`. ()
  Fixes UpdateSettingsRequestStreamableTests mutate bug
  Mustes {p0=snapshot.get_repository/10_basic/*} YAML test
  Revert "Mutes MachineLearningTests.testNoAttributes_givenSameAndMlEnabled"
  Only allow x-pack metadata if all nodes are ready ()
  Mutes MachineLearningTests.testNoAttributes_givenSameAndMlEnabled
  Use original settings on full-cluster restart ()
  Only ack cluster state updates successfully applied on all nodes ()
  Expose Lucene's FeatureField. ()
  Fix a grammatical error in the 'search types' documentation.
  Remove http pipelining from integration test case ()
2018-05-23 23:05:14 -04:00
Yannick Welsch
30b004f582
Use original settings on full-cluster restart ()
When doing a node restart using the test framework, the restarted node does not only use the
settings provided to the original node, but also additional settings provided by plugin extensions,
which does not correspond to the settings that a node would have on a true restart.
2018-05-23 09:02:01 +02:00
Nhat Nguyen
db14717098 Merge branch 'master' into ccr
* master:
  Set the new lucene version for 6.4.0
  [ML][TEST] Clean up jobs in ModelPlotIT
  Upgrade to 7.4.0-snapshot-1ed95c097b ()
  Watcher: Ensure trigger service pauses execution ()
  [DOCS] Added coming qualifiers in changelog
  [DOCS] Commented out empty sections in the changelog to fix the doc build. ()
  Security: reduce garbage during index resolution ()
  Make RepositoriesMetaData contents unmodifiable ()
  Change quad tree max levels to 29. Closes  ()
  Test: use trial license in qa tests with security
  [ML] Add integration test for model plots ()
  SQL: Fix bug caused by empty composites ()
  [ML] Account for gaps in data counts after job is reopened ()
  InternalEngineTests.testConcurrentOutOfOrderDocsOnReplica should use two documents ()
  Change signature of Get Repositories Response ()
  Tests: Use different watch ids per test in smoke test ()
  [Docs] Add term query with normalizer example
  Adds Eclipse config for xpack licence headers ()
  Watcher: Make start/stop cycle more predictable and synchronous ()
  [test] add debug logging for packaging test
  [DOCS] Removed X-Pack Breaking Changes
  [DOCS] Fixes link to TLS LDAP info
  Update versions for start_trial after backport ()
  Packaging: Set elasticsearch user to have non-existent homedir ()
  [DOCS] Fixes broken links to bootstrap user ()
  Fix NPE when CumulativeSum agg encounters null/empty bucket ()
  Make licensing FIPS-140 compliant ()
  [DOCS] Reorganizes authentication details in Stack Overview ()
  Network: Remove http.enabled setting ()
  Fix merging logic of Suggester Options ()
  [DOCS] Adds LDAP realm configuration details ()
  [DOCS] Adds native realm configuration details ()
  ReplicationTracker.markAllocationIdAsInSync may hang if allocation is cancelled ()
  [DOCS] Enables edit links for X-Pack pages ()
  Packaging: Unmark systemd service file as a config file ()
  SQL: Reduce number of ranges generated for comparisons ()
  Tests: Simplify VersionUtils released version splitting ()
  Cancelling a peer recovery on the source can leak a primary permit ()
  Added changelog entry for deb prerelease version change ()
  Convert server javadoc to html5 ()
  Create default ES_TMPDIR on Windows ()
  [Docs] Clarify `fuzzy_like_this` redirect ()
  Post backport of .
  Fix docs of the `_ignored` meta field.
  Remove MapperService#types(). ()
  Remove useless version checks in REST tests. ()
  Add a new `_ignored` meta field. ()
  Move repository-azure fixture test to QA project ()

# Conflicts:
#	buildSrc/version.properties
#	server/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java
2018-05-04 09:40:57 -04:00
Ryan Ernst
fb0aa562a5
Network: Remove http.enabled setting ()
This commit removes the http.enabled setting. While all real nodes (started with bin/elasticsearch) will always have an http binding, there are many tests that rely on the quickness of not actually needing to bind to 2 ports. For this case, the MockHttpTransport.TestPlugin provides a dummy http transport implementation which is used by default in ESIntegTestCase.

closes 
2018-05-02 11:42:05 -07:00
Ryan Ernst
916bf9d26d
Convert server javadoc to html5 ()
This commit converts the remaining javadocs in :server using html4 to html5.
This was mostly converting `tt` to `{@code}`.
2018-05-02 08:08:54 -07:00