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>
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>
* 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>
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>
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>
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>
* [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>
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>
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>
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>
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>
* 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>
* [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>
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>
* 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>
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>
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>
Removes type support from DocWrite Request and Response, all derived classes,
and all places used.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* [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>
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>
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>
With types deprecation the type support is removed from internal search API
(SearchRequest and QueryShardContext).
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* 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>
* 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>
* [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>
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>
Remove the deprecated sync flush API which was replaced by sequence
number and retention lease mechanisms and no longer used in 2.0.0.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
Soft Deletes have been enabled by default since Legacy version 7.0 and made
mandatory in Version 2.0.0. This commit refactors the InternalEngine to always
use soft-deletes. It is a follow on to making soft deletes mandatory in 2.0.0.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* [BWC] Ensure 2.x compatibility with Legacy 7.10.x
This commit fixes TransportHandshaker to send a spoofed Legacy 7.10.2 mincompat
version to ensure OpenSearch 2.x nodes can join a Legacy 7.10.x cluster for
rolling upgrade support. Without this change 7.10.x and OpenSearch 2.x mixed
cluster bwc tests would fail.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* fix AbstractSimpleTransportTestCase failures
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* change v3 to local static
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* make V_3_0_0 package private and reuse in test
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>