Commit Graph

35 Commits

Author SHA1 Message Date
Martijn van Groningen 228fe1f804
Removed unused tsdb code. (#95317)
The TimeSeriesMetricsService and TimeSeriesMetrics.java classes were only used in the integration test that this change removes.
2023-04-18 15:31:51 +02:00
Ryan Ernst c619be4b5e
Move preallocate module to libs (#94884)
The preallocate module needs access to java.io internals. However, in
order to open java.io to a specific module, rather than the unnamed
module as was previously done, the said module must be in the boot
layer.

This commit moves the preallocate module to libs. It adds it to the main
lib dir, though it does not add it as a compile dependency of server.
2023-04-10 13:05:43 -07:00
Francisco Fernández Castaño 1421e2e751
Make some AtomicRegisterCoordinatorTests classes public for reuse (#94936) 2023-03-31 13:27:46 +02:00
Andrei Dan 223385f887
Introduce a _lifecycle/explain API for data stream backing indices (#94621)
This adds an {index}/_lifecycle/explain API to retrieve information
about an index's status within its lifecycle.

The response looks like so:
```
"indices" : {
    ".ds-metrics-foo-2023.03.22-000001" : {
      "index" : ".ds-metrics-foo-2023.03.22-000001",
      "managed_by_dlm" : true,
      "index_creation_date_millis" : 1679475563571,
      "time_since_index_creation" : "843ms",
      "rollover_date_millis" : 1679475564293,
      "time_since_rollover" : "121ms",
      "lifecycle" : { },
      "generation_time" : "121ms"
    },
    ".ds-metrics-foo-2023.03.22-000002" : {
      "index" : ".ds-metrics-foo-2023.03.22-000002",
      "managed_by_dlm" : true,
      "index_creation_date_millis" : 1679475564351,
      "time_since_index_creation" : "63ms",
      "lifecycle" : { }
    }
  }
}
```
2023-03-27 08:44:40 +01:00
Andrei Dan fb033b9e82
Move SchedulerEngine and TimeValueSchedule to server/common/scheduler (#93862)
We built quite a bit of infrastructure to have one polling job
running via the `SchedulerEngine` and `ActiveSchedule`. This moves this
infrastructure outside x-pack to server so elasticsearch/modules can use
it and avoid re-implementing it using `threadPool.schedule`.
2023-02-17 08:55:40 +00:00
Iraklis Psaroudakis e144bef8e9
New TransportBroadcastUnpromotableAction action (#93600)
Introduces:

* New action that can be used to broadcast to unpromotable shards of a given IndexShardRoutingTable.
* New hook in ReplicationOperation for custom logic when the primary operation completes. If there is a failure, this increases the shard failures of the replication operation.
* Refresh action now uses the new hook to broadcast the unpromotable refresh action to all unpromotable shards.

Fixes ES-5454
Fixes ES-5212
2023-02-15 12:46:06 +02:00
Joe Gallo ea17a1945a
Upgrade geoip2 dependency (#93522) 2023-02-07 08:18:25 -05:00
Thomas Dullien 14cca12d9d
Improve the false positive rate of the bloom filter by setting 7 hash functions (#93283)
Co-authored-by: Adrien Grand <jpountz@gmail.com>
2023-02-04 13:42:26 +01:00
Przemyslaw Gomulka 2cdaabe783
[Stable plugin api] Drop api suffix in package names (#92905)
Refactoring that drops the api suffix from package name
This will have to be followed up by a plugins/examples fix in imports
Also set an artifact group name to `org.elasticsearch.plugin` in the plugin-api and plugin-analysis-api
2023-01-14 09:49:37 +01:00
Salvatore Campagna 546e5169ea
TSDB numeric compression (#92045)
This doc values format is meant to be used for TSDB. It provides
compression using delta encoding, gcd encoding and bit-packing
encoding. The expectation is that such encoding works well for
fields whose values are monotonically increasing, like the timestamp
field and counter metric fields. Encoding and decoding fields using
the new format is available behind a feature flag.
2023-01-12 15:42:49 +01:00
David Turner 48c1447dd8
Add o.e.a.a.cluster.coordination to exports from server (#92059)
Fixes the red squigglies in IntelliJ.
2022-12-12 09:23:15 +00:00
Mary Gouseti 8e9a403c65
Collect health API stats (#91559)
This PR introduces the collectors of the health API telemetry. Our
target telemetry has the following shape:

```
{
    "invocations": {
      "total": 22,
      "verbose_true": 12,
      "verbose_false": 10
    },
    "statuses": {
      "green": 10,
      "yellow": 4,
      "red": 8,
      "values": ["green", "yellow", "red"]
    },
    "indicators": {
      "red" : {
        "master_stability": 2,
        "ilm":2,
        "slm": 4,
        "values": ["master_stability", "ilm", "slm"]
      },
      "yellow": {
        "disk": 1,
        "shards_availability": 1,
        "master_stability": 2,
        "values": ["disk", "shards_availability", "master_stability"]
      }
    },
    "diagnoses": {
      "red": {
        "elasticsearch:health:shards_availability:primary_unassigned": 1,
        "elasticsearch:health:disk:add_disk_capacity_master_nodes": 3,
        "values": ["elasticsearch:health:shards_availability:primary_unassigned", "elasticsearch:health:disk:add_disk_capacity_master_nodes"]
      },
      "yellow": {
        "elasticsearch:health:disk:add_disk_capacity_data_nodes": 1,
        "values": [""elasticsearch:health:disk:add_disk_capacity_data_nodes"]
      }
    }
  }
```

This PR introduces the thread safe `Counters` class and the
`HealthApiStats` which keeps keeps of the metrics above based on the
health api responses that it encounters. The `HealthApiStatsAction`
collects the `HealthApiStats` of all nodes.

Part of: #90877
2022-11-18 05:34:33 -05:00
Pooya Salehi 327f50ba46
Prevalidate node removal API (pt. 1) (#88952)
This PR adds the first part of the Prevalidate Node Removal API. This
API allows checking whether attempting to remove some node(s) from the
cluster is likely to succeed or not. This check is useful when a node
needs to be removed from a RED cluster, without risking loosing the last
copy of some RED shards.

In this PR, we only check whether a RED index is a Searchable Snapshot
index or not, in which case the removal of any node is safe as the RED
index is backed by a snapshot.

Relates #87776
2022-11-16 13:44:00 +01:00
Martijn van Groningen 1e186bb820
Move time_series aggregation to aggregations module. (#91356)
This also drops the TimeSeries ceremonial interface.

Note that this change also moves a search cancellation test to
aggregations module. It does so by creating a base search cancallation
base class that both server and this module share.

Relates to #90283 Relates to #82273
2022-11-08 12:27:35 -05:00
Jack Conradson 8b0d0716d1
Add profiling and documentation for dfs phase (#90536)
Adds profiling statistics for the dfs phase, and adds documentation for both the dfs phase profiling 
and kNN profiling.

Closes #89713
2022-10-05 09:54:36 -07:00
Martijn van Groningen 14cf04d74b
Introduce a new aggregation module (#90294)
This commit introduces a new aggregation module
and moves the `adjacency_matrix` to this new module.

The new module name is `aggregations`.
The new module will use the `org.elasticsearch.aggregations.bucket` package for all bucket aggregations. 

Relates to #90283
2022-09-30 16:24:52 +02:00
Przemyslaw Gomulka 35ea2b13b5
[Stable plugin API] Load plugin named components (#89969)
Stable plugins are using @ extensible and @ NamedComponents annotations
to mark components to be loaded.
This commit is loading extensible classNames from extensibles.json and
named components from named_components.json

The scanning mechanism that can generate these files will be done later in a gradle plugin/plugin installer

relates #88980
2022-09-13 09:05:08 +02:00
Nhat Nguyen cfad420cde
Enable BloomFilter for _id of non-datastream indices (#88409)
This PR adds BloomFilter to Elasticsearch and enables it for the _id 
field of non-data stream indices. BloomFilter should speed up the
performance of mget and update requests at a small expense of refresh,
merge, and storage.
2022-08-08 11:14:26 -04:00
Mary Gouseti d828c2a642
Health API - Monitoring local disk health (#88390)
This PR introduces the local health monitoring functionality needed for
#84811 . The monitor uses the `NodeService` to get the disk usage stats
and determines the node's disk health.

When a change in the disk's is detected or when the health node changes,
this class would be responsible to send the node's health to the health
node. Currently this is simulated with a method that just logs the
current health.

The monitor keeps the last reported health, this way, if something fails
on the next check it will try to resend the new health state.
2022-08-03 17:40:26 +09:30
Rory Hunter 5c5981d27d
Introduce tracing interfaces (#87921)
Part of #84369. Split out from #87696. Introduce tracing interfaces in
advance of adding APM support to Elasticsearch. The only implementation
at this point is a no-op class.
2022-07-26 05:31:41 +09:30
Nikola Grcevski d7d9ff2950
Rename immutable cluster state to reserved cluster state (#88481) 2022-07-13 15:05:39 -04:00
Nikola Grcevski fc93f77d3b
Implement ILM/settings operator handlers (#88097)
Relates to #86224
2022-07-04 12:12:49 -04:00
Chris Hegarty 453f12c72d
Upgrade to Log4J 2.18.0 (#88237) 2022-07-04 11:30:38 +01:00
Nikola Grcevski e1d03efd1e
Add immutable 'operator' metadata classes for cluster state (#87763)
This commit only introduces the storage classes, unused for now.
Relates to #86224
2022-06-29 18:30:35 -04:00
Nikola Grcevski c2d1b22626
Add OperatorHandler interface (#87767) 2022-06-27 09:51:13 -04:00
Julie Tibshirani 3a9e511117
Move kNN search and dense vectors to core (#87815)
This PR moves kNN search and dense vector support out of an xpack plugin and
into server.

In #87625 we plan to integrate ANN search into the main `_search` endpoint as a
new top-level component called `knn`. So kNN will be a dedicated part of the
search request, and we'll have kNN logic within the search phases. The classes
and logic will live in server, matching the other search components like
suggesters, field collapsing, etc.
2022-06-22 21:10:20 -07:00
Artem Prigoda 52e2e374e8
Make Desired Nodes API operator-only (#87778)
* Remove Desired Nodes API from NON_OPERATOR_ACTIONS

* Add desired nodes to the operator privileges test

* Add desired nodes privileges integration tests

Resolves #87777.
2022-06-20 15:32:44 +02:00
Mary Gouseti f7ef6609be
Do not wait for the health node task (#87830)
The health node task is a permanent task, for this reason it doesn't make sense to wait for it in a method that waits for pending tasks. This fixes that.
2022-06-20 11:48:59 +02:00
Przemyslaw Gomulka 0ef15b49e9
Stable logging API - the basic use case (#86612)
Introducing a stable logging API under libs/logging.
This change covers the most common use cases for logging: fetching a logger with LogManager, emitting a log messages with Logger and Level.
It is influenced by log4j2-api, but do not include Marker and LogBuilder methods.
Also methods using org.apache.logging.log4j.util.Supplier are replaced with java.util.Supplier

The basic implementation is present in server and injected statically in LogConfigurator

relates #84478
2022-06-13 10:25:54 +02:00
Ryan Ernst f5c0be5c89
Move spatial3d dependency to spatial (#87397)
Server depends on spatial3d, but it is only ever used by the spatial
xpack component. This commit moves the dependency there.

closes #87026
2022-06-07 12:54:11 -07:00
Ryan Ernst 4b44413783
Move declarative plugin sync to server cli (#87273)
When running in Docker, the elasticsearch-plugins.yml allows configuring
plugins that should be installed in the system. Upon Elasticsearch
starting up, plugins are installed/removed to match the configured
plugins. However, this happens late in startup, and it would be nice to
keep the main Elasticsearch process from ever writing outside the
configured data directories. Now that the server cli has been moved to
Java, this is possible.

This commit moves invocation of the plugins sync command into the server
cli. Note that the sync plugins action should probably be reworked as it
can be implement Command directly now. However, this commit tries to be
the minimal change possible to remove plugin cli knowledge from server.
2022-06-01 15:52:02 -04:00
Chris Hegarty 633ece0f8a
Temporarily provide SystemPropertiesPropertySource (#87149)
Temporarily provide SystemPropertiesPropertySource to workaround a bug in Log4J where it does not declare the provider implementations in its module-info.
2022-05-26 16:15:29 +01:00
Christos Soulios d539957e60
TSDB: Implement downsampling on time-series indices (#85708)
This PR implements downsampling operation on time series indices.

The PR creates a _rollup endpoint that allows users to downsample an index and can be
accessed by the following call:

POST /<source_index>/_rollup/<rollup_index>
{
    "fixed_interval": "1d"
}

Requirements

An index can be downsampled if all of the following requirements are met:

    Must be a time series index (have the index.mode: time_series index setting)
    Must not be writeable (have the index.blocks.write: true index setting)
    Must have dimension fields marked with mapping parameter time_series_dimension: true
    Must have metric fields marked with mapping parameter time_series_metric

Relates to #74660

Fixes #65769
Fixes #69799
Finally, this PR is based on the code written for #64900
2022-05-25 17:16:40 +03:00
Ignacio Vera e6b4097fc8
new geo_grid query to be used with geogrid aggregations (#86596)
Query that allows users to define a query where the input is the key of the bucket and it will match the 
documents inside that bucket.
2022-05-23 11:38:07 +02:00
Chris Hegarty 3071c6a055
Modularize Elasticsearch (#81066)
This PR represents the initial phase of Modularizing Elasticsearch (with
Java Modules).

This initial phase modularizes the core of the Elasticsearch server
with Java Modules, which is then used to load and configure extension
components atop the server. Only a subset of extension components are
modularized at this stage (other components come in a later phase).
Components are loaded dynamically at runtime with custom class loaders
(same as is currently done). Components with a module-info.class are
defined to a module layer.

This architecture is somewhat akin to the Modular JDK, where
applications run on the classpath. In the analogy, the Elasticsearch
server modules are the platform (thus are always resolved and present),
while components without a module-info.class are non-modular code
running atop the Elasticsearch server modules. The extension components
cannot access types from non-exported packages of the server modules, in
the same way that classpath applications cannot access types from
non-exported packages of modules from the JDK. Broadly, the core
Elasticseach java modules simply "wrap" the existing packages and export
them. There are opportunites to export less, which is best done in more
narrowly focused follow-up PRs.

The Elasticsearch distribution startup scripts are updated to put jars
on the module path (the class path is empty), so the distribution will
run the core of the server as java modules. A number of key components
have been retrofitted with module-info.java's too, and the remaining
components can follow later. Unit and functional tests run as
non-modular (since they commonly require package-private access), while
higher-level integration tests, that run the distribution, run as
modular.

Co-authored-by: Chris Hegarty <christopher.hegarty@elastic.co>
Co-authored-by: Ryan Ernst <ryan@iernst.net>
Co-authored-by: Rene Groeschke <rene@elastic.co>
2022-05-20 13:11:42 +01:00