Commit Graph

2805 Commits

Author SHA1 Message Date
Marc Handalian a0030dfb47
Add a new Engine implementation for replicas with segment replication enabled. (#3240)
* Change fastForwardProcessedSeqNo method in LocalCheckpointTracker to persisted checkpoint.

This change inverts fastForwardProcessedSeqNo to fastForwardPersistedSeqNo for use in
Segment Replication.  This is so that a Segrep Engine can match the logic of InternalEngine
where the seqNo is incremented with each operation, but only persisted in the tracker on a flush.
With Segment Replication we bump the processed number with each operation received index/delete/noOp, and
invoke this method when we receive a new set of segments to bump the persisted seqNo.

Signed-off-by: Marc Handalian <handalm@amazon.com>

* Extract Translog specific engine methods into an abstract class.

This change extracts translog specific methods to an abstract engine class so that other engine
implementations can reuse translog logic.

Signed-off-by: Marc Handalian <handalm@amazon.com>

* Add a separate Engine implementation for replicas with segment replication enabled.

This change adds a new engine intended to be used on replicas with segment replication enabled.
This engine does not wire up an IndexWriter, but still writes all operations to a translog.
The engine uses a new ReaderManager that refreshes from an externally provided SegmentInfos.

Signed-off-by: Marc Handalian <handalm@amazon.com>

* Fix spotless checks.

Signed-off-by: Marc Handalian <handalm@amazon.com>

* Fix :server:compileInternalClusterTestJava compilation.

Signed-off-by: Marc Handalian <handalm@amazon.com>

* Fix failing test naming convention check.

Signed-off-by: Marc Handalian <handalm@amazon.com>

* PR feedback.

- Removed isReadOnlyReplica from overloaded constructor and added feature flag checks.
- Updated log msg in NRTReplicationReaderManager
- cleaned up store ref counting in NRTReplicationEngine.

Signed-off-by: Marc Handalian <handalm@amazon.com>

* Fix spotless check.

Signed-off-by: Marc Handalian <handalm@amazon.com>

* Remove TranslogAwareEngine and build translog in NRTReplicationEngine.

Signed-off-by: Marc Handalian <handalm@amazon.com>

* Fix formatting

Signed-off-by: Marc Handalian <handalm@amazon.com>

* Add missing translog methods to NRTEngine.

Signed-off-by: Marc Handalian <handalm@amazon.com>

* Remove persistent seqNo check from fastForwardProcessedSeqNo.

Signed-off-by: Marc Handalian <handalm@amazon.com>

* PR feedback.

Signed-off-by: Marc Handalian <handalm@amazon.com>

* Add test specific to translog trimming.

Signed-off-by: Marc Handalian <handalm@amazon.com>

* Javadoc check.

Signed-off-by: Marc Handalian <handalm@amazon.com>

* Add failEngine calls to translog methods in NRTReplicationEngine.
Roll xlog generation on replica when a new commit point is received.

Signed-off-by: Marc Handalian <handalm@amazon.com>
2022-05-24 10:18:18 -07:00
Rishikesh Pasham fd5a38de12
Adding CheckpointRefreshListener to trigger when Segment replication is turned on and Primary shard refreshes (#3108)
* Intial PR adding classes and tests related to checkpoint publishing

Signed-off-by: Rishikesh1159 <rishireddy1159@gmail.com>

* Putting a Draft PR with all changes in classes. Testing is still not included in this commit.

Signed-off-by: Rishikesh1159 <rishireddy1159@gmail.com>

* Wiring up index shard to new engine, spotless apply and removing unnecessary tests and logs

Signed-off-by: Rishikesh1159 <rishireddy1159@gmail.com>

* Adding Unit test for checkpointRefreshListener

Signed-off-by: Rishikesh1159 <rishireddy1159@gmail.com>

* Applying spotless check

Signed-off-by: Rishikesh1159 <rishireddy1159@gmail.com>

* Fixing import statements *

Signed-off-by: Rishikesh1159 <rishireddy1159@gmail.com>

* removing unused constructor in index shard

Signed-off-by: Rishikesh1159 <rishireddy1159@gmail.com>

* Addressing comments from last commit

Signed-off-by: Rishikesh1159 <rishireddy1159@gmail.com>

* Adding package-info.java files for two new packages

Signed-off-by: Rishikesh1159 <rishireddy1159@gmail.com>

* Adding test for null checkpoint publisher and addreesing PR comments

Signed-off-by: Rishikesh1159 <rishireddy1159@gmail.com>

* Add docs for indexshardtests and remove shard.refresh

Signed-off-by: Rishikesh1159 <rishireddy1159@gmail.com>
2022-05-24 07:08:14 -07:00
Poojita Raj a023ad9cba
[segment replication]Introducing common Replication interfaces for segment replication and recovery code paths (#3234)
* RecoveryState inherits from ReplicationState + RecoveryTarget inherits from ReplicationTarget

Signed-off-by: Poojita Raj <poojiraj@amazon.com>

* Refactoring: mixedClusterVersion error fix + move Stage to ReplicationState

Signed-off-by: Poojita Raj <poojiraj@amazon.com>

* pull ReplicationListener into a top level class + add javadocs + address review comments

Signed-off-by: Poojita Raj <poojiraj@amazon.com>

* fix javadoc

Signed-off-by: Poojita Raj <poojiraj@amazon.com>

* review changes

Signed-off-by: Poojita Raj <poojiraj@amazon.com>

* Refactoring the hierarchy relationship between repl and recovery

Signed-off-by: Poojita Raj <poojiraj@amazon.com>

* style fix

Signed-off-by: Poojita Raj <poojiraj@amazon.com>

* move package common under replication

Signed-off-by: Poojita Raj <poojiraj@amazon.com>

* rename to replication

Signed-off-by: Poojita Raj <poojiraj@amazon.com>

* rename and doc changes

Signed-off-by: Poojita Raj <poojiraj@amazon.com>
2022-05-23 12:19:54 -07:00
Nick Knize 5358502107
[Upgrade] Lucene-9.2.0-snapshot-ba8c3a8 (#3416)
Upgrades to latest snapshot of lucene 9.2.0 in preparation for GA release.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-05-20 16:29:51 -05:00
Suraj Singh 6699624dde
[Type removal] _type removal from tests of yaml tests (#3406)
* [Type removal] _type removal from tests of yaml tests

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

* Fix spotless failures

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

* Fix assertion failures

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

* Fix assertion failures in DoSectionTests

Signed-off-by: Suraj Singh <surajrider@gmail.com>
2022-05-20 10:29:55 -04:00
Tianli Feng 507f8ccdbd
Replace internal usages of 'master' term in 'server/src/internalClusterTest' directory (#2521)
Signed-off-by: Tianli Feng <ftianli@amazon.com>
2022-05-19 10:23:59 -07:00
Andriy Redko 38fb1d9275
Add resizable search queue to OpenSearch (picking up #826) (#3207)
* Make search/write queue resizable

Signed-off-by: Ruizhen <ruizhen@amazon.com>

* Address PR comments

Signed-off-by: Ruizhen <ruizhen@amazon.com>

* Refactoring resizable queue implementation

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

* Addressing code review comments

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

* Addressing code review comments

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

* Addressing code review comments

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

Co-authored-by: Ruizhen <ruizhen@amazon.com>
2022-05-16 08:37:41 -04:00
Tianli Feng 10bff0c9f5
Replace internal usages of 'master' term in 'test' directory (#3283)
* Replace internal usages of 'master' terminology in server/src/internalClusterTest directory

Signed-off-by: Tianli Feng <ftianli@amazon.com>

* Replace 'master' terminology with 'cluster manager' in test directory

Signed-off-by: Tianli Feng <ftianli@amazon.com>

* Replace 'master' terminology with 'cluster manager' in server/src/internalClusterTest directory

Signed-off-by: Tianli Feng <ftianli@amazon.com>

* Adjust format by spotlessApply task

Signed-off-by: Tianli Feng <ftianli@amazon.com>

* Replace 'master' terminology with 'cluster manager' in test directory

Signed-off-by: Tianli Feng <ftianli@amazon.com>

* Adjust format by spotlessApply task

Signed-off-by: Tianli Feng <ftianli@amazon.com>
2022-05-11 19:34:57 -04:00
Nick Knize 5f531b366e
[Remove] AliasesExistAction (#3149)
With the removal of Transport Client AliasesExistAction is no longer needed and
is removed.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-05-03 12:05:41 -04:00
Tianli Feng bb870f70c8
Rename ClusterBlock description 'no master' to 'no cluster-manager' (#3133)
* Rename ClusterBlock description 'no master' to 'no cluster-manager'

Signed-off-by: Tianli Feng <ftianli@amazon.com>

* Adjust format by spotlessApply task

Signed-off-by: Tianli Feng <ftianli@amazon.com>
2022-05-03 10:24:37 -04:00
Tianli Feng f58d98d261
Rename reserved node id '_must_join_elected_master_' to '_must_join_elected_cluster_manager_' that used by in DetachClusterCommand (#3116)
Signed-off-by: Tianli Feng <ftianli@amazon.com>
2022-05-02 20:23:11 -07:00
Nick Knize d86c88fe59
[Refactor] XContentType to parse Accept or Content-Type headers (#3077)
Refactors XContentType.fromMediaTypeOrFormat to fromMediaType so Accept headers
and Content-Type headers can be parsed separately. This helps in reusing the
same parse logic in for REST Versioning API support.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-04-28 09:58:26 -05:00
Tianli Feng dd7add2568
Replace internal usages of 'master' term in 'client' directory (#3088)
* Replace internal usages of 'master' term in 'client' directory

Signed-off-by: Tianli Feng <ftianli@amazon.com>

* Add a uni test for NodeSelector to test deprecated master role

Signed-off-by: Tianli Feng <ftianli@amazon.com>
2022-04-27 09:09:08 -04:00
Tianli Feng 79eb3b0492
Replace internal usages of 'master' term in 'server/src/main' directory (#2519)
* Replace internal usages of 'master' terminology in server/src/main directory

Signed-off-by: Tianli Feng <ftianli@amazon.com>

* Restore rename DISCOVERED_MASTER in ClusterHealthResponse

Signed-off-by: Tianli Feng <ftianli@amazon.com>

* Rename two methods in unit tests

Signed-off-by: Tianli Feng <ftianli@amazon.com>

* Replace master word in ClusterState

Signed-off-by: Tianli Feng <ftianli@amazon.com>

* Replace master word in LeaderChecker JoinHelper JoinTaskExecutor

Signed-off-by: Tianli Feng <ftianli@amazon.com>

* Replace master word in more classes

Signed-off-by: Tianli Feng <ftianli@amazon.com>

* Replace master word in more classes

Signed-off-by: Tianli Feng <ftianli@amazon.com>

* Replace master word in more classes

Signed-off-by: Tianli Feng <ftianli@amazon.com>

* Replace master word in more classes

Signed-off-by: Tianli Feng <ftianli@amazon.com>

* Replace master word in more classes

Signed-off-by: Tianli Feng <ftianli@amazon.com>

* Replace master word in more classes

Signed-off-by: Tianli Feng <ftianli@amazon.com>

* Replace master word in DiscoveryNodes classes

Signed-off-by: Tianli Feng <ftianli@amazon.com>

* Replace master word in more classes

Signed-off-by: Tianli Feng <ftianli@amazon.com>

* Correct mistakes

Signed-off-by: Tianli Feng <ftianli@amazon.com>

* Adjust format by spotlessApply task

Signed-off-by: Tianli Feng <ftianli@amazon.com>

* Change MASTER__NODE_BOOTSTRAPPED_MSG in test

Signed-off-by: Tianli Feng <ftianli@amazon.com>

* Fix SnapshotDisruptionIT by renaming to cluster-manager

Signed-off-by: Tianli Feng <ftianli@amazon.com>
2022-04-27 09:07:35 -04:00
Daniel Doubrovkine (dB.) a389d1e221
Revert "Support task resource tracking in OpenSearch (#2639)" (#3046)
This reverts commit 6517eeca50.

Signed-off-by: dblock <dblock@amazon.com>
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-04-25 11:08:38 -05:00
Peng Huo 03fbca3f50
Add new multi_term aggregation (#2687)
Adds a new multi_term aggregation. The current implementation focuses 
on adding new type aggregates. Performance (latency) is suboptimal in this
iteration, mainly because of brute force encoding/decoding a list of values
into bucket keys. A performance improvement change will be made as a 
follow on.

Signed-off-by: Peng Huo <penghuo@gmail.com>
2022-04-21 09:06:33 -05:00
Tushar Kharbanda 6517eeca50
Support task resource tracking in OpenSearch (#2639)
* Add Task id in Thread Context

Signed-off-by: Tushar Kharbanda <tushar.kharbanda72@gmail.com>

* Add resource tracking update support for tasks

Signed-off-by: Tushar Kharbanda <tushar.kharbanda72@gmail.com>

* List tasks action support for task resource refresh

Signed-off-by: Tushar Kharbanda <tushar.kharbanda72@gmail.com>

* Handle task unregistration case on same thread

Signed-off-by: Tushar Kharbanda <tushar.kharbanda72@gmail.com>

* Add lazy initialisation for RunnableTaskExecutionListener

Signed-off-by: Tushar Kharbanda <tushar.kharbanda72@gmail.com>

* Segregate resource tracking logic to a separate service.

Signed-off-by: Tushar Kharbanda <tushar.kharbanda72@gmail.com>

* Check for running threads during task unregister

Signed-off-by: Tushar Kharbanda <tushar.kharbanda72@gmail.com>

* Moved thread context logic to resource tracking service

Signed-off-by: Tushar Kharbanda <tushar.kharbanda72@gmail.com>

* preserve task id in thread context even after stash

Signed-off-by: Tushar Kharbanda <tushar.kharbanda72@gmail.com>

* Add null check for resource tracking service

Signed-off-by: Tushar Kharbanda <tushar.kharbanda72@gmail.com>

* Tracking service tests and minor refactoring

Signed-off-by: Tushar Kharbanda <tushar.kharbanda72@gmail.com>

* Preserve task id fix with test

Signed-off-by: Tushar Kharbanda <tushar.kharbanda72@gmail.com>

* Minor test changes and Task tracking call update

Signed-off-by: Tushar Kharbanda <tushar.kharbanda72@gmail.com>

* Fix Auto Queue executor method's signature

Signed-off-by: Tushar Kharbanda <tushar.kharbanda72@gmail.com>

* Make task runnable task listener factory implement consumer

Signed-off-by: Tushar Kharbanda <tushar.kharbanda72@gmail.com>

* Use reflection for ThreadMXBean

Signed-off-by: Tushar Kharbanda <tushar.kharbanda72@gmail.com>

* Formatting

Signed-off-by: Tushar Kharbanda <tushar.kharbanda72@gmail.com>

* Replace RunnableTaskExecutionListenerFactory with AtomicReference

Signed-off-by: Tushar Kharbanda <tushar.kharbanda72@gmail.com>

* Revert "Use reflection for ThreadMXBean"

This reverts commit cbcf3c525bf516fb7164f0221491a7b25c1f96ec.

Signed-off-by: Tushar Kharbanda <tushar.kharbanda72@gmail.com>

* Suppress Warning related to ThreadMXBean

Signed-off-by: Tushar Kharbanda <tushar.kharbanda72@gmail.com>

* Add separate method for task resource tracking supported check

Signed-off-by: Tushar Kharbanda <tushar.kharbanda72@gmail.com>

* Enabled setting by default

Signed-off-by: Tushar Kharbanda <tushar.kharbanda72@gmail.com>

* Add debug logs for stale context id

Signed-off-by: Tushar Kharbanda <tushar.kharbanda72@gmail.com>

* Remove hardcoded task overhead in tests

Signed-off-by: Tushar Kharbanda <tushar.kharbanda72@gmail.com>

* Bump stale task id in thread context log level to warn

Signed-off-by: Tushar Kharbanda <tushar.kharbanda72@gmail.com>

* Improve assertions and logging

Signed-off-by: Tushar Kharbanda <tushar.kharbanda72@gmail.com>

Co-authored-by: Tushar Kharbanda <tkharban@amazon.com>
2022-04-21 09:51:44 -04:00
Andriy Redko 3b7e654757
Remove JavaVersion, use builtin Runtime.Version to deal with runtime versions (#3006)
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
2022-04-20 17:14:02 -04:00
Tianli Feng b45bfc9afc
Revert "Make High-Level-Rest-Client tests allow deprecation warning temporarily, during deprecation of request parameter 'master_timeout' (#2702)" (#2744)
This reverts commit 6a2a33d187.

During the process of deprecating REST API request parameter master_timeout and adding alternative parameter cluster_manager_timeout, I made High-Level-Rest-Client tests allow deprecation warning temporarily, by changing the argument of `setStrictDeprecationMode()` to false when building `RestClient` for tests, in the above commit / PR https://github.com/opensearch-project/OpenSearch/pull/2702,

This PR sets the High-Level-Rest-Client tests back to treating warning header as a failure.

Signed-off-by: Tianli Feng <ftianli@amazon.com>
2022-04-19 13:39:42 -07:00
Owais Kazi 3c5d997a76
Added a new line linter (#2875)
* Added linter to add new line

Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>

* Fixed new lines

Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>

* Ignore empty files

Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>

* Updated DEVELOPER GUIDE

Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>

* Renamed workflow file

Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>

* Fixed failing tests

Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
2022-04-13 14:14:18 -04:00
Yoann Rodière b5d5616d44
Update commons-logging to 1.2 (#2806)
* Upgrade to Apache Commons Logging 1.2

Signed-off-by: Yoann Rodière <yoann@hibernate.org>

* Clarify that Apache HTTP/commons-* dependencies are not just for tests

Signed-off-by: Yoann Rodière <yoann@hibernate.org>
2022-04-08 16:43:51 -04:00
Tianli Feng 47a22bb08d
Replace remaining 'blacklist' with 'denylist' in internal class and method names (#2784)
* Replace blacklist with denylist in BlacklistedPathPatternMatcher

Signed-off-by: Tianli Feng <ftianli@amazon.com>

* Replace blacklist with denylist in assumption message

Signed-off-by: Tianli Feng <ftianli@amazon.com>

* Replace all Blacklisted with Denylisted

Signed-off-by: Tianli Feng <ftianli@amazon.com>

* Replace all blacklist(key) with denylist(key)

Signed-off-by: Tianli Feng <ftianli@amazon.com>

* Adjust format by spotlessApply task

Signed-off-by: Tianli Feng <ftianli@amazon.com>
2022-04-07 15:45:20 -07:00
Tianli Feng ed040e9f1a
Replace blacklist in Gradle build environment configuration (#2752)
- Replace `blacklist` with `denylist` in all `tests.rest.blacklist` and `REST_TESTS_BLACKLIST`
Signed-off-by: Tianli Feng <ftianli@amazon.com>
2022-04-05 17:48:39 -07:00
Wenjun Ruan 0b1f4a2069
Rename `file` to `dir` in Environment (#2730)
* Rename `file` to `dir` in Environment

Signed-off-by: ruanwenjun <wenjun@apache.org>

* Fix compile error

Signed-off-by: ruanwenjun <wenjun@apache.org>

* fix compile error

Signed-off-by: ruanwenjun <wenjun@apache.org>
2022-04-05 09:23:08 -04:00
Nick Knize cb238aae61
Bump version to 3.0.0 (#2556)
Bump version to 3.0.0

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-04-04 17:40:31 -05:00
Tianli Feng 6a2a33d187
Make Rest-High-Rest-Level tests allow deprecation warning temporarily, during deprecation of request parameter 'master_timeout' (#2702)
Temporarily build rest client with setStrictDeprecationMode(false) to allow 
deprecation warning in HLRC tests while master_timeout parameters is
being refactored.

Signed-off-by: Tianli Feng <ftianli@amazon.com>
2022-04-04 10:22:22 -05:00
Nick Knize 6c195abc59
[Main] Bump Version 2.0 to 2.1 (#2715)
Bumps from version 2.0 to 2.1

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-04-02 14:40:25 -05:00
Vacha Shah 5dd75bb0aa
Removing SLM check in tests for OpenSearch versions (#2604)
Signed-off-by: Vacha Shah <vachshah@amazon.com>
2022-03-28 11:32:18 -05:00
Owais Kazi cc0e66b1dc
Replaced "master" terminology in Log message (#2575)
Changed the log message to cluster-manager from master

Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
2022-03-24 21:50:54 -05:00
Andriy Redko b6ca0d1f78
Concurrent Searching (Experimental) (#1500)
* Concurrent Searching (Experimental)

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

* Addressingf code review comments

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
2022-03-24 14:20:31 -04:00
Andriy Redko 82fb7abb71
Introduce QueryPhaseSearcher extension point (SearchPlugin) (#1931)
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
2022-03-21 23:11:23 -05:00
Tianli Feng ea31483126
Add a new node role 'cluster_manager' as the alternative for 'master' role and deprecate 'master' role (#2424)
Add a new node role `cluster_manager`, as the replacement for `master` role, that used in setting `node.roles: [ master ]`. 
They have got the same functionality, but can NOT be assigned to `node.roles` together.
* Add `CLUSTER_MANAGER_ROLE` in `DiscoveryNodeRole` class, and deprecate `MASTER_ROLE`
* Remove `MASTER_ROLE` from the `DiscoveryNodeRole.BUILT_IN_ROLES`, and temporarily load the role by the existing method `DiscoveryNode.setAdditionalRoles`
* Add a method `validateRole()` in `DiscoveryNodeRole` class, it's used to validate a specific role is compatible with the other roles to be assigned to a node together.
* Add deprecation message when assigning `master` role in setting `node.roles`
* Replace most `MASTER_ROLE` with `CLUSTER_MANAGER_ROLE` in current unit and integration tests
* Add new unit and integration tests to validate `CLUSTER_MANAGER_ROLE` and `MASTER_ROLE` can be treated as the same.

More explanation:
* New node will have "cluster_manager", "data", and "ingest" roles by default. Which means the default value of setting "node.roles" will be `["cluster_manager","data","ingest"]`, instead of `["master","data","ingest"]`
* "cluster_manager" role will be treated as "master" role in the OpenSearch node of previous versions.
* "cluster_manager” role and "master" role have got the same abbreviation name: "m"

Signed-off-by: Tianli Feng <ftianli@amazon.com>
2022-03-18 15:06:06 -07:00
Tianli Feng 1193ec101b
Deprecate setting 'cluster.no_master_block' and introduce the alternative setting 'cluster.no_cluster_manager_block' (#2453)
* Add a new setting `cluster.no_cluster_manager_block`, aims to replace the existing `cluster.no_master_block`
* Set the value of the old setting `cluster.no_master_block` as the fallback to the new setting
* Deprecate the existing `setting cluster.no_master_block`
* Add unit tests

Signed-off-by: Tianli Feng <ftianli@amazon.com>
2022-03-18 14:57:08 -07:00
Tianli Feng 19eadb46ba
Deprecate setting 'cluster.initial_master_nodes' and introduce the alternative setting 'cluster.initial_cluster_manager_nodes' (#2463)
* Deprecate setting cluster.initial_master_nodes, and add setting cluster.initial_cluster_manager_nodes

Signed-off-by: Tianli Feng <ftianli@amazon.com>
2022-03-18 14:55:49 -07:00
Nick Knize b9f04405d6
[Remove] types from CreateIndexRequest and companion Builder's mapping method (#2498)
Removes the type variable as input to CreateIndexRequest.mapping(Object...)
along with the CreateIndexRequestBuilder helper class. This also refactors the
method name to setMapping for consistency with other methods (e.g.,
setSettings).

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-03-17 18:13:27 -05:00
Nick Knize 2e3d3fef13
[Remove] Type from PutIndexTemplateRequest and PITRB (#2497)
Continues removal of types from PutIndexTemplateRequest and
PutIndexTemplateRequestBuilder.mapping. Delegated mapping method in
PutIndexTemplateRequestBuilder is refactored to setMapping for consistency with
similar methods (e.g., setSettings, setAliases).

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-03-17 12:05:24 -05:00
Nick Knize 3675400b92
[Remove] type from CIR.mapping and CIRB.mapping (#2478)
First pass to remove types from CreateIndexRequest and CreateIndexRequestBuilder
mapping method. This method is overloaded several times so the most widely used
methods in the RequestBuilder are refactored from mapping to setMapping to avoid
confusion, conflicts, and to be consistent with other method names (e.g.,
setSettings, setCause, setAlias).

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-03-16 17:35:08 -05:00
Nick Knize 05a5819243
[Upgrade] Lucene 9.1.0-snapshot-ea989fe8f30 (#2487)
* [Upgrade] Lucene 9.1.0-snapshot-ea989fe8f30

Upgrades from Lucene 9.0.0 to 9.1.0-snapshot-ea989fe8f30 in preparation for
9.1.0 GA.

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

* Add spanishplural token filter

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

* fix KNOWN_TOKENIZERS

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-03-16 15:47:25 -04:00
Lukáš Vlček 02ffd4c548
Rename reference to project OpenSearch was forked from (#2483)
Fixing log message and renaming internal variable.
Improving internal JavaDoc.

Signed-off-by: Lukáš Vlček <lukas.vlcek@aiven.io>
2022-03-16 12:03:22 -05:00
Nick Knize 006c832c5f
[Upgrade] Lucene 9.0.0 release (#1109)
This commit upgrades the core codebase from Lucene 8.10.1 to
lucene 9.0.0. It includes all necessary refactoring of features and
API changes when upgrading to a new major Lucene release.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
Co-authored-by: Andriy Redko <drreta@gmail.com>
2022-03-15 15:48:13 -05:00
Nick Knize 757abdb9a0
[Refactor] LuceneChangesSnapshot to use accurate ops history (#2452)
Improves the LuceneChangesSnapshot to get an accurate count of recovery
operations using sort by sequence number optimization.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-03-15 13:13:54 -05:00
Nick Knize bdcaec5caf
[Remove] types from Uid and remaining types/Uid from translog (#2450)
Removes types from UID class along with cleaning up all obsolete MapperService
dependendices. This includes removing UID from the Translog Delete operation
which is no longer needed due to type dependency removal.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-03-13 12:49:51 -05:00
Nick Knize 95d4750249
[Remove] types from translog (#2439)
Removes persisting the type in the translog since types are no longer supported.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2022-03-12 14:03:00 -06:00
Kartik 9cfa395128
Remove the IndexCommitRef class (#2421)
This inner class is no longer required because its functionality has been moved to the generic GatedCloseable class.

Signed-off-by: Kartik Ganesh <gkart@amazon.com>
2022-03-10 10:12:17 -08:00
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
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
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
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