Commit Graph

5942 Commits

Author SHA1 Message Date
Kartik fb9e150076
Refactoring gated and ref-counted interfaces and their implementations (#2396)
* Reducing duplication in plugins around ref-counted releasable classes

Both AmazonEc2Reference and AmazonS3Reference duplicate the same logic - a subclass of AbstractRefCounted that also implements Releasable. This change centralizes this paradigm into a AbstractRefCountedReleasable class and supports both clients via generics. It also updates all fetching implementations to use the get() method instead of client()

Signed-off-by: Kartik Ganesh <gkart@amazon.com>

* Introduce Reference classes for the Closeable and AutoCloseable interfaces

These classes allow you to wrap a reference instance with an onClose runnable that is executed when close() is invoked. Two separate classes are needed because the close() signatures for the two interfaces are different. This change takes the first step to have implementing classes extend from these generic superclasses, before attempting to remove the subclasses entirely. The get() method is also replaced throughout the code base.

Note that there is also a separate Releasable interface that has a similar access pattern, but is implemented separately. This is used in AbstractRefCountedReleasable introduced in a prior commit

Signed-off-by: Kartik Ganesh <gkart@amazon.com>

* More improvements and refactoring

* Functionality around one-way gating is now moved to a dedicated class - OneWayGate. This replaces duplicate functionality throughout the code.
* The two *Reference classes have been renamed to Gated* since that better represents their functionality
* The AbstractRefCountedReleasable has been improved to no longer be abstract by accepting the shutdown hook. This removes the need for the inner class in ReleasableBytesReference, and further simplifies the plugin subclasses (these could probably be removed entirely).
* Finally, unit tests have been added for some classes

Signed-off-by: Kartik Ganesh <gkart@amazon.com>

* Added tests for GatedCloseable

Also updated the license information in GatedAutoCloseableTests

Signed-off-by: Kartik Ganesh <gkart@amazon.com>

* Fixing license information in new files

Signed-off-by: Kartik Ganesh <gkart@amazon.com>

* Added unit tests for RefCountedReleasable

Signed-off-by: Kartik Ganesh <gkart@amazon.com>
2022-03-09 12:21:09 -08:00
Nick Knize 5a9a11416d
[Remove] TrimUnsafeCommit logic for legacy 6.x indexes (#2225)
* [Remove] TrimUnsafeCommit logic for legacy 6.x indexes

Multiple txlog commits was introduced in legacy 7.x. Legacy 6.x indexes could
therefore not have a safe commit. Since OpenSearch 2.0 is no longer compatible
with legacy 6.x indexes, the logic to trim these unsafe commits is safely
removed.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>

* fix assertion typo

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>

* rebase and incorporate pr feedback

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-03-09 10:50:05 -08:00
Andriy Redko 9c679cbbfc
MapperService has to be passed in as null for EnginePlugins CodecService constructor (#2177)
* MapperService has to be passed in as null for EnginePlugins CodecService constructor

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

* Addressing code review comments

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

* Delayed CodecService instantiation up to the shard initialization

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

* Added logger (associated with shard) to CodecServiceConfig

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

* Refactored the EngineConfigFactory / IndexShard instantiation of the CodecService

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
2022-03-08 18:42:32 -05:00
Suraj Singh a6a47e7321
Remove inclue_type_name parameter from rest api spec (#2410)
Signed-off-by: Suraj Singh <surajrider@gmail.com>
2022-03-08 14:43:04 -08:00
Daniel Doubrovkine (dB.) 044f53630a
Set target and source compatibility to 11, required by Lucene 9. (#2407)
* Set target and source compatibility to 11, required by Lucene 9.

Signed-off-by: dblock <dblock@dblock.org>

* Uncomment commented code in #2321 for killing child processes that uses JDK9+ ProcessInfo.

Signed-off-by: dblock <dblock@dblock.org>

* Set distribution checker target JDK compatibility to 11.

Signed-off-by: dblock <dblock@dblock.org>

* Supress processing warnings.

Signed-off-by: dblock <dblock@dblock.org>
2022-03-08 14:48:51 -05:00
Nick Knize c3712a51b3
[Remove] include_type_name from HLRC (#2397)
Removes include_type_name from the high level reset client along with relevant
deprecated methods in IndicesClient. All tests are updated to remove the
parameter from the rest requests along with various toXContent methods that are
no longer required.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-03-08 11:30:27 -06:00
Andriy Redko 65debde436
Update the BWC versions (post 1.x backport) (#2390)
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
2022-03-08 08:30:48 -08:00
Suraj Singh 919d18036e
Remove type end-points from count action (#2379)
Signed-off-by: Suraj Singh <surajrider@gmail.com>
2022-03-07 12:43:05 -08:00
Subhobrata Dey e1fd4b75b4
Add valuesField in PercentilesAggregationBuilder streamInput constructor (#2308)
Signed-off-by: Subhobrata Dey <sbcd90@gmail.com>
2022-03-07 11:51:49 -05:00
Suraj Singh d5e58a2f3d
[Remove] Type mappings from GeoShapeQueryBuilder (#2322)
* Remove type end-points from GeoShapeBuilder

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Fix integration test failures

Signed-off-by: Suraj Singh <surajrider@gmail.com>
2022-03-04 16:40:47 -08:00
aponb be64af2f90
Replace exclusionary words whitelist and blacklist in the places that won't impact backwards compatibility (#2178)
* Replace the exclusionary word whitelist with allowlist, and blacklist with denylist, in code commet and internal variable/method/class/package name.

Signed-off-by: Andreas <apre@gmx.at>
2022-03-04 16:34:09 -08:00
Nick Knize 0cc2c9be6a
[Remove] types from PutMappingRequest (#2335)
Remove type support from putMappingRequest, dependencies, and all tests.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-03-04 13:30:43 -06:00
Andriy Redko 5f90227a05
Add '_name' field support to score functions and provide it back in explanation response (#2244)
* Add '_name' field support to score functions and provide it back in explanation response

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

* Address code review comments

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
2022-03-04 11:12:27 -05:00
Suraj Singh 3d5aff4b91
Remove type end-points from search and related APIs (#2263)
Signed-off-by: Suraj Singh <surajrider@gmail.com>
2022-03-02 13:21:00 -08:00
Nick Knize 897f4e7295
[Remove] deprecated getMapping API from IndicesClient (#2262)
Removes the deprecated types based get, getMapping, getAsync, and
getMappingAsync methods from IndicesClient. It also removes extra nesting of
mappings belong the deprecated type named object and removes the types based
methods from the affected request classes.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-03-02 13:44:04 -06:00
Breno Faria 4b89410055
Reintroduce negative epoch_millis #1991 (#2232)
* Reintroduce negative epoch_millis #1991

Fixes a regression introduced with Elasticsearch 7 regarding the date
field type that removed support for negative timestamps with sub-second
granularity.

Thanks to Ryan Kophs (https://github.com/rkophs) for allowing me to use
his previous work.

Signed-off-by: Breno Faria <breno.faria@intrafind.de>

* applying spotless fix

Signed-off-by: Breno Faria <breno.faria@intrafind.de>

* more conservative implementation of isSupportedBy

Signed-off-by: Breno Faria <breno.faria@intrafind.de>

* adding braces to control flow statement

Signed-off-by: Breno Faria <breno.faria@intrafind.de>

* spotless fix...

Signed-off-by: Breno Faria <breno.faria@intrafind.de>

Co-authored-by: Breno Faria <breno.faria@intrafind.de>
2022-03-02 12:52:38 -06:00
Nick Knize 0bd7850bed
[Remove] remaining type usage in Client and AbstractClient (#2258)
Removes type parameter from remaining prepareIndex in Client and AbstractClient.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-02-25 13:35:48 -06:00
Suraj Singh 5b0da85df8
Remove type from validate query API (#2255)
* Remove type mapping from RestValidateAction

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Spotless check apply

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Include suggested review comment

Signed-off-by: Suraj Singh <surajrider@gmail.com>
2022-02-25 10:18:41 -08:00
Nick Knize 8b48207540
[Remove] Type from Client.prepare(Index,Delete,Update) (#2253)
Removes the type parameter from Client.prepare(Index,Delete,Update) and
everywhere it's used throughout the codebase except for prepareIndex(index,
type, id) which is removed in a follow up.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-02-24 21:20:03 -06:00
Matt Weber 9f6e2e56e0
Update bwc verions for (#2237) (#2248)
Update the bwc versions for #2237 since it was backported to 1.3.

Signed-off-by: Matt Weber <matt@mattweber.org>
2022-02-24 16:14:49 -08:00
Nick Knize d892c51d66
[Remove] Types from DocWrite Request and Response (#2239)
Removes type support from DocWrite Request and Response, all derived classes,
and all places used.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-02-24 15:57:44 -06:00
Matt Weber 37235fafd9
Case Insensitive Support in Regexp Interval (#2237)
Add a `case_insensitive` flag to regexp interval source.

Signed-off-by: Matt Weber <matt@mattweber.org>
2022-02-24 14:54:13 -06:00
dependabot[bot] 788ba99915
Bump forbiddenapis from 2.7 to 3.2 in /buildSrc/src/testKit/thirdPartyAudit (#2185)
* Bump forbiddenapis in /buildSrc/src/testKit/thirdPartyAudit

Bumps [forbiddenapis](https://github.com/policeman-tools/forbidden-apis) from 2.7 to 3.2.
- [Release notes](https://github.com/policeman-tools/forbidden-apis/releases)
- [Commits](https://github.com/policeman-tools/forbidden-apis/compare/2.7...3.2)

---
updated-dependencies:
- dependency-name: de.thetaphi:forbiddenapis
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fixing failing check

Signed-off-by: Vacha Shah <vachshah@amazon.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Vacha Shah <vachshah@amazon.com>
2022-02-24 11:27:44 -08:00
Suraj Singh cbfcad9054
Removes type mappings from mapping APIs (#2238)
Removes type mappings from GetMapping, GetFieldMapping and PutMapping APIs

Signed-off-by: Suraj Singh <surajrider@gmail.com>
2022-02-24 11:23:36 -08:00
Nick Knize 3445befd36
[Remove] types from SearchHit and Explain API (#2205)
* [Remove] types from SearchHit and Explain API

Removes type support from SearchHit and Explain API.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>

* fix failing tests

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>

* move TYPES_DEPRECATION_MESSAGE from RestExplainAction to FullClusterRestartIT

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>

* fix FullClusterRestartIT

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>

* fix failing tests

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>

* fix testSoftDelete

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-02-23 11:40:30 -08:00
Nick Knize 1b571ece28
[Remove] type support from Bulk API (#2215)
Removes all support for type parameter from the Bulk API.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-02-23 11:53:27 -06:00
Nick Knize 44441d8fc5
Always use Lucene index in peer recovery (#2077)
With soft deletes no longer optional, peer recovery is switched to always use the
lucene index instead of replaying operations from the translog.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-02-23 11:05:40 -06:00
Suraj Singh 52eaf96a88
[Remove] Type mapping parameter from document update API (#2204)
* Remove type param from yml and integ test files

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Remove type mapping specific update API

Signed-off-by: Suraj Singh <surajrider@gmail.com>
2022-02-22 11:54:03 -08:00
Nick Knize c9f7c37367
[Remove] Type Specific Index Stats (#2198)
Removes type specific index stats since only one type is allowed.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-02-21 16:06:43 -06:00
Nick Knize 2e3f410957
[Remove] Types from GET/MGET (#2168)
Removes type support from the get and mget transport and rest actions along
with removal from ShardGetService.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-02-21 11:37:27 -06:00
Matt Weber fc22350208
Update #2103 BWC Versions (#2173)
Change BWC checks to 1.3 since #2103 was backported.

Signed-off-by: Matt Weber <matt@mattweber.org>
2022-02-18 12:15:11 -06:00
Ankit Jain 8ae0db5285
Adding shards per node constraint for predictability to testClusterGr… (#2110)
* Adding shards per node constraint for predictability to testClusterGreenAfterPartialRelocation

Signed-off-by: Ankit Jain <jain.ankitk@gmail.com>

* Fixing precommit violation

Signed-off-by: Ankit Jain <jain.ankitk@gmail.com>

* Adding assertion to ensure invariant

Signed-off-by: Ankit Jain <jain.ankitk@gmail.com>
2022-02-18 10:52:27 -06:00
Nick Knize b75d3f1123
[Remove] Default Mapping (#2151)
Default mappings were deprecated in Legacy version 6x and cannot be added to
indexes created in legacy 7+ or any version of OpenSearch. All support for
default mappings are removed for OpenSearch 2+.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-02-17 22:21:20 -06:00
Nick Knize 7fe642fda5
[Remove] Type from Search Internals (#2109)
With types deprecation the type support is removed from internal search API
(SearchRequest and QueryShardContext).

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-02-17 16:17:31 -06:00
Matt Weber cfd96e3e4b
Support unordered non-overlapping intervals (#2103)
* Support unordered non-overlapping intervals

This commit exposes Intervals.unorderedNoOverlaps (LUCENE-8828).

Signed-off-by: Matt Weber <matt@mattweber.org>

* Replace ordered and overlap flags with enum.

- add IntervalMode enum
- deprecate ordered
- bwc between IntervalMode and ordered flag
- update tests
- update rest tests

Signed-off-by: Matt Weber <matt@mattweber.org>

* fix annotated text plugin test

Signed-off-by: Matt Weber <matt@mattweber.org>

* bwc to 2x only

Signed-off-by: Matt Weber <matt@mattweber.org>

* BWC rest tests for ordered flag

Signed-off-by: Matt Weber <matt@mattweber.org>
2022-02-17 17:10:22 -05:00
Peng Huo 9ea25c4f2e
Adjust main version after backport to 1.x (#2147)
Signed-off-by: Peng Huo <penghuo@gmail.com>
2022-02-17 12:17:10 -06:00
dependabot[bot] 9689a27b63
Bump com.diffplug.spotless from 5.6.1 to 6.2.0 (#1919)
* Bump com.diffplug.spotless from 5.6.1 to 6.2.0

Bumps com.diffplug.spotless from 5.6.1 to 6.2.0.

---
updated-dependencies:
- dependency-name: com.diffplug.spotless
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* spotlessApply

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nicholas Walter Knize <nknize@apache.org>
2022-02-16 22:08:40 -08:00
Nick Knize c0c7d7aedb
[Remove] Type parameter from TermVectors API (#2104)
Remove document type support from the TermVectors API.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-02-15 14:49:08 -06:00
Andriy Redko 6b6f03368f
Mapping update for “date_range” field type is not idempotent (#2094)
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
2022-02-14 16:56:02 -06:00
Andriy Redko a942b275ef
Fixing org.opensearch.monitor.os.OsProbeTests::testLogWarnCpuMessageOnlyOnes when CGroups are not available (#2101)
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
2022-02-14 12:10:16 -05:00
Andrey Pleskach 27ed6fc82c
Fix integration tests failure (#2067)
Fixed integration tests failure on Linux with Kernel 5.16.x

Signed-off-by: Andrey Pleskach <ples@aiven.io>
2022-02-11 09:40:04 -05:00
Suraj Singh 892801a074
Remove type mapping from document index API (#2026)
* Remove doc type specific indexing APIs and relevant changes

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Remove type param from yml and integ test files

Signed-off-by: Suraj Singh <surajrider@gmail.com>
2022-02-09 13:34:10 -06:00
Ankit Jain f0984eb409
Added timeout to ensureGreen() for testClusterGreenAfterPartialRelocation (#2074)
Signed-off-by: Ankit Jain <jain.ankitk@gmail.com>
2022-02-09 00:55:30 -08:00
Nick Knize 6428d1a2a6
[Refactor] MapperService to QueryShardContext in valueFetcher (#2027)
* [Refactor] MapperService to QueryShardContext in valueFetcher

QueryShardContext encapsulates MapperService along with other mechanisms useful
for analyzers, highlighters, and readers. This commit refactors the valueFetcher
to use the QueryShardContext as a parameter instead of direct access to the
MapperService. This is an API change. Behavior of the method is unaffected.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>

* change unnecessary Optional usage

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>

* spotlessApply

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-02-08 08:38:20 -05:00
Ankit Jain 343b82fe24
Stabilizing org.opensearch.cluster.routing.MovePrimaryFirstTests.test… (#2048)
* Stabilizing org.opensearch.cluster.routing.MovePrimaryFirstTests.testClusterGreenAfterPartialRelocation

Signed-off-by: Ankit Jain <jain.ankitk@gmail.com>

* Removing unused import

Signed-off-by: Ankit Jain <jain.ankitk@gmail.com>

* Making code more readable

Signed-off-by: Ankit Jain <jain.ankitk@gmail.com>
2022-02-07 19:10:07 -08:00
Matt Weber b9420d8f70
Add regexp interval source (#1917)
* Add regexp interval source

Add a regexp interval source provider so people can use regular
expressions inside of intervals queries.

Signed-off-by: Matt Weber <matt@mattweber.org>

* Fixes

- register regexp interval in SearchModule
- use fully-qualified name for lucene RegExp
- get rid of unnecessary variable

Signed-off-by: Matt Weber <matt@mattweber.org>
2022-02-07 17:18:43 -06:00
Nick Knize 8288c9010c
[Remove] CircuitBreaker Accounting (#2056)
RAM Accounting of segments is removed so remove the associated Accounting
circuit breaker.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-02-04 19:46:27 -06:00
Nicholas Walter Knize ee9e5ba579
Add Version.V_1_2_5 constant
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-02-04 18:21:51 -06:00
Nick Knize 25955782b9
[Refactor] Lucene DataInput and DataOutput to StreamInput and StreamOutput (#2035)
Lucene 9 changes from BigEndian to LittleEndian in DataInput and DataOutput.
The use of Lucene's Data IO classes are refactored in this commit to use
StreamInput which maintains the same method calls while preserving the byte
order of the data.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-02-04 14:23:18 -06:00
Nick Knize fc0d3a368d
[Remove] Segment memory estimation and tracking (#2029)
Lucene 9 removed CodecReader#ramBytesUsed and all file formats that no longer
consume large amounts of memory. As a result RAM estimation for segments is no
longer possible and is removed by this commit. backwards compatibility is retained 
for the tranport layer.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-02-04 13:47:48 -06:00