5778 Commits

Author SHA1 Message Date
Nick Knize
b7334f49d5
[Bug] Fix mixed cluster support for OpenSearch 2+ (#1191) (#1195)
The version framework only added support for OpenSearch 1.x bwc with legacy
clusters. This commit adds support for v2.0 which will be the last version with
bwc support for legacy clusters (v7.10)

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2021-09-01 17:04:40 -05:00
Abbas Hussain
9b58ef5350
Reduce iterations to improve test run time (#1168) (#1177)
Signed-off-by: Abbas Hussain <abbas_10690@yahoo.com>
2021-08-31 01:06:29 +05:30
Abbas Hussain
04d56cf676
Tune datanode count and shards count to improve test run time (#1170) (#1176)
Signed-off-by: Abbas Hussain <abbas_10690@yahoo.com>
2021-08-31 00:14:38 +05:30
Nick Knize
079fd77062
Add 1.0.1 revision (#1152) (#1160)
This commit stages the branch to the next 1.0.1 patch release. BWC testing needs
this even if the next revision is never actually released.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2021-08-26 07:10:24 -05:00
Nick Knize
ec05dcdcf0
[Bug] Change 1.0.0 version check in PluginInfo (#1159)
PluginInfo should use .onOrAfter(Version.V_1_1_0) instead of
.after(Version.V_1_0_0) for the new custom folder name for plugin feature.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2021-08-25 23:58:30 -05:00
Vacha
f73e66e5e7
Allowing custom folder name for plugin installation (#848) (#1116)
Signed-off-by: Vacha Shah <vachshah@amazon.com>
2021-08-23 14:39:27 -07:00
Nick Knize
e153629871
Upgrade to Lucene 8.9 (#1080) (#1115)
This commit upgrades to the official lucene 8.9 release

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2021-08-23 10:06:34 -07:00
Nick Knize
c15e687bf9
[DEPRECATE] SimpleFS in favor of NIOFS (#1073) (#1114)
Lucene 9 removes support for SimpleFS File System format. This commit deprecates
the SimpleFS format in favor of NIOFS.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2021-08-20 11:26:22 -05:00
Sorabh
55c1026bb6
Fix failure in SearchCancellationIT.testMSearchChildReqCancellationWithHybridTimeout (#1105)
In some cases as one shared with issue #1099, the maxConcurrentSearchRequests was chosen as 0 which
will compute the final value during execution of the request based on processor counts. When this
computed value is less than number of search request in msearch request, it will execute all the
requests in multiple iterations causing the failure since test will only wait for one such
iteration. Hence setting the maxConcurrentSearchRequests explicitly to number of search requests
being added in the test to ensure correct behavior

Signed-off-by: Sorabh Hamirwasia <sohami.apache@gmail.com>
2021-08-17 16:23:55 -04:00
Sorabh
e44e890d88
Part 1: Support for cancel_after_timeinterval parameter in search and msearch request (#986) (#1085)
* Part 1: Support for cancel_after_timeinterval parameter in search and msearch request

This commit introduces the new request level parameter to configure the timeout interval after which
a search request will be cancelled. For msearch request the parameter is supported both at parent
request and at sub child search requests. If it is provided at parent level and child search request
doesn't have it then the parent level value is set at such child request. The parent level msearch
is not used to cancel the parent request as it may be tricky to come up with correct value in cases
when child search request can have different runtimes

TEST: Added test for ser/de with new parameter

Signed-off-by: Sorabh Hamirwasia <sohami.apache@gmail.com>

* Part 2: Support for cancel_after_timeinterval parameter in search and msearch request

This commit adds the handling of the new request level parameter and schedule cancellation task. It
also adds a cluster setting to set a global cancellation timeout for search request which will be
used in absence of request level timeout.

TEST: Added new tests in SearchCancellationIT
Signed-off-by: Sorabh Hamirwasia <sohami.apache@gmail.com>

* Address Review feedback for Part 1

Signed-off-by: Sorabh Hamirwasia <sohami.apache@gmail.com>

* Address review feedback for Part 2

Signed-off-by: Sorabh Hamirwasia <sohami.apache@gmail.com>

* Update CancellableTask to remove the cancelOnTimeout boolean flag

Signed-off-by: Sorabh Hamirwasia <sohami.apache@gmail.com>

* Replace search.cancellation.timeout cluster setting with search.enforce_server.timeout.cancellation to control if cluster level cancel_after_time_interval should take precedence over request level cancel_after_time_interval value

Signed-off-by: Sorabh Hamirwasia <sohami.apache@gmail.com>

* Removing the search.enforce_server.timeout.cancellation cluster setting and just keeping search.cancel_after_time_interval setting with request level parameter taking the precedence.

Signed-off-by: Sorabh Hamirwasia <sohami.apache@gmail.com>

Co-authored-by: Sorabh Hamirwasia <hsorabh@amazon.com>

Co-authored-by: Sorabh Hamirwasia <hsorabh@amazon.com>
2021-08-12 13:52:28 -04:00
frotsch
987bfcf89c
Avoid crashing on using the index.lifecycle.name in the API body (#1060) (#1070)
* Avoid crashing on using the index.lifecycle.name in the API body

Signed-off-by: frotsch <frotsch@mailbox.org>
2021-08-10 14:16:44 -04:00
Vlad Rozov
a7ad3f7026
Introduce RestHandler.Wrapper to help with delegate implementations (#1004) (#1031)
Signed-off-by: Vlad Rozov <vrozov@users.noreply.github.com>
2021-08-03 09:02:40 -04:00
Chang Liu
96dabb31d3
Introduce replaceRoutes() method and 2 new constructors to RestHandler.java (#947) (#998)
* Add addRoutesPrefix() method to RestHandler.java

Signed-off-by: Azar Fazel <azar.fazel@gmail.com>
Signed-off-by: cliu123 <lc12251109@gmail.com>

Co-authored-by: afazel <afazel@users.noreply.github.com>
2021-07-22 14:26:16 -04:00
Chang Liu
34def5894e
Avoid override of routes() in BaseRestHandler to respect the default behavior defined in RestHandler (#889) (#991)
Signed-off-by: cliu123 <lc12251109@gmail.com>
2021-07-22 10:57:18 -04:00
Daniel Doubrovkine (dB.)
1740517905
Cleanup TESTING and DEVELOPER_GUIDE markdowns (#946) (#954) 2021-07-13 14:13:26 -05:00
Rabi Panda
1f7df7adac
Update favicon for OpenSearch (#933)
Signed-off-by: Rabi Panda <pandarab@amazon.com>
2021-07-02 14:39:32 -07:00
Tianli Feng
b383355f50
Refresh OpenSearch nodes version in cluster state after upgrade (#865) (#926)
Signed-off-by: Shweta Thareja <tharejas@amazon.com>
Co-authored-by: shwetathareja <shwetathareja@live.com>
2021-07-02 09:50:42 -07:00
Marc Handalian
b749b38043
Remove distribution from main response in compatibility mode (#898) (#921)
This Change removes version.distribution when the version.number is
overridden with the cluster setting compatibility.override_main_response_version.

Signed-off-by: Marc Handalian <handalm@amazon.com>
2021-07-01 21:57:36 -05:00
Tianli Feng
230f90b554
Add 'tagline' back to MainResponse in server that was removed in PR #427 (#913) (#914)
* Add "tagline" field back to "MainResponse" in sever side (not in rest-high-level-client side) that removed in PR #427 .
* Replace with a new tagline "The OpenSearch Project: https://opensearch.org/".
* Turn the tagline into a constant in server/src/main/java/org/opensearch/action/main/MainResponse.java.
2021-07-01 19:45:28 -07:00
Vacha
3ed6a2ec2a
Replace metadata keys in OpenSearchException during serialization and deserialization (#905) (#910)
Signed-off-by: Vlad Rozov <vrozov@users.noreply.github.com>

Co-authored-by: Vlad Rozov <vrozov@users.noreply.github.com>
2021-06-30 14:45:23 -07:00
Nick Knize
15e6cb4db5
Version bump for 1.1 release (#772) (#892)
Bumps the minor to 1.1 for the 1.0 release.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2021-06-28 12:57:03 -05:00
Marc Handalian
a5fc4d4262
Add cluster setting to spoof version number returned from MainResponse (#847) (#870)
This change adds a new cluster setting "compatibility.override_main_response_version"
that when enabled spoofs the version.number returned from MainResponse
for REST clients expecting legacy version 7.10.2.

Signed-off-by: Marc Handalian <handalm@amazon.com>
2021-06-22 16:59:25 -05:00
Tianli Feng
b1aa3671b5
Fix resource leak issues suggested by Amazon CodeGuru (#816) (#859)
* Add try-with-resources block to automatically close the resources after using to avoid resource leak, in `SymbolicLinkPreservingTarIT`, `LicenseAnalyzer`, `SymbolicLinkPreservingUntarTransform`, `ConcurrentSeqNoVersioningIT` in `VersionProperties`, `GeoFilterIT`, `XContentHelper`,  `Json` and `IndexShard` class

* Add try-finally block to close the resources after using to avoid resource leak, in `ServerChannelContext` class.

* Add try-catch block to close the resources when exception occurs in `FsBlobContainer` class (when XContentFactory.xContentType throws an exception).

* Close resources when assertion error occurs, in `ServerChannelContext` class.
2021-06-22 10:19:01 -07:00
itiyamas
006d04a60f
Decouple throttling limits for new and old indices. (#778) (#863)
* Decouple throttling limits for new and old indices.

Signed-off-by: Itiyama <itiyamas@amazon.com>

* Precommit fixes.

Signed-off-by: Itiyama <itiyamas@amazon.com>

* Review comments.

Signed-off-by: Itiyama <itiyamas@amazon.com>

* Review comments and test fix.

Signed-off-by: Itiyama <itiyamas@amazon.com>

* Checkstyle fixes.

Signed-off-by: Itiyama <itiyamas@amazon.com>

* Review comments.

Signed-off-by: Itiyama <itiyamas@amazon.com>
2021-06-17 14:39:49 +05:30
itiyamas
fe40f8f360
Decouples primaries_recoveries limit from concurrent recoveries limit. (#546) (#862)
* Decouples initial primaries limit from node concurrent limits.

Signed-off-by: Itiyama <itiyamas@amazon.com>

* Checkstyle fixes.

Signed-off-by: Itiyama <itiyamas@amazon.com>

* Checkstyle test fixes.

Signed-off-by: Itiyama <itiyamas@amazon.com>

* Review comments

Signed-off-by: Itiyama <itiyamas@amazon.com>

* Fixes review comments.

Signed-off-by: Itiyama <itiyamas@amazon.com>
2021-06-17 13:45:37 +05:30
jayesh hathila
f3d5340b33
Add Plugin name for verbose Plugin not found exception (#841)
* Add Plugin name for verbose Plugin not found exception
* Make the plugin loading failure exception more verbose
* Throw Opensearch in place of RuntimeException for plugin load failure

Signed-off-by: Jayesh Hathila <sharma.jayesh52@gmail.com>
2021-06-15 12:09:41 -04:00
Mohit Godwani
733d9c6f4b
Apply fix for health API response to distinguish no master (#819)
Signed-off-by: Mohit Godwani <mgodwan@amazon.com>
2021-06-04 11:28:57 +05:30
ashwinpankaj
b4c697a29d
[1.x] An allocation constraint mechanism, that de-prioritizes nodes from getting picked for allocation if they breach certain constraints (#777)
* An allocation constraint mechanism, that de-prioritizes nodes from getting picked for allocation if they breach certain constraints

Signed-off-by: Ashwin Pankaj <appankaj@amazon.com>

* Precommit fixes

Signed-off-by: Ashwin Pankaj <appankaj@amazon.com>

* Fix license header in test file

Signed-off-by: Ashwin Pankaj <appankaj@amazon.com>

* Review comments

Signed-off-by: Ashwin Pankaj <appankaj@amazon.com>

Co-authored-by: Pankaj <appankaj@88665a1e205d.ant.amazon.com>
2021-06-04 10:47:47 +05:30
Daniel Doubrovkine (dB.)
b45b613472
Version checks are incorrectly returning versions < 1.0.0. (#797) (#807)
* Version checks are incorrectly returning versions < 1.0.0.
* Removed V_7_10_3 which has not been released as of time of the fork.
* Update check for current version to get unreleased versions.

- no unreleased version if the current version is "1.0.0"
- add unit tests for OpenSearch 1.0.0 with legacy ES versions.
- update VersionUtils to include all legacy ES versions as released.

Signed-off-by: Rabi Panda <adnapibar@gmail.com>
Signed-off-by: dblock <dblock@amazon.com>
Co-authored-by: Rabi Panda <adnapibar@gmail.com>
2021-06-03 09:56:33 -04:00
Nick Knize
403c511c17
[BUG] fix MainResponse to spoof version number for legacy clients (#708)
This commit changes MainResponse to spoof OpenSearch 1.x version numbers as
Legacy version number 7.10.2 for legacy clients.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2021-05-28 10:05:33 -05:00
Nick Knize
053ed7b66d
[BWC] fix mixedCluster and rolling upgrades (#775) (#793)
This commit fixes mixedCluster and rolling upgrades by spoofing OpenSearch
version 1.0.0 as Legacy version 7.10.2. With this commit an OpenSearch 1.x node
can join a legacy (<= 7.10.2) cluster and rolling upgrades work as expected.
Mixed clusters will not work beyond the duration of the upgrade since shards
cannot be replicated from upgraded nodes to nodes running older versions.

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

Co-authored-by: Shweta Thareja <tharejas@amazon.com>
2021-05-28 08:02:43 -07:00
Dhwanil Patel
9a654aa667
Add timeout on cat/stats API (#759)
Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
2021-05-24 23:18:04 +05:30
Abbas Hussain
d01197f954
Catch runtime exceptions to make class loader race conditions easier to debug. (#608) (#750)
Signed-off-by: dblock <dblock@amazon.com>

Co-authored-by: Daniel Doubrovkine (dB.) <dblock@dblock.org>
2021-05-21 11:04:14 +05:30
Ketan Verma
25276f1848
Support Data Streams in OpenSearch (#690) (#713)
This commit adds support for data streams by adding a DataStreamFieldMapper, and making timestamp 
field name configurable. Backwards compatibility is supported.

Signed-off-by: Ketan Verma <ketan9495@gmail.com>
2021-05-20 17:14:28 -04:00
arunabh23
5a89131ded
Make default number of shards configurable (#726)
The default number of primary shards for a new index, when the number of shards are not provided in the request, can be configured for the cluster. This is a backport commit of pull #625

Signed-off-by: Arunabh Singh <arunabs@amazon.com>

Co-authored-by: Arunabh Singh <arunabs@amazon.com>
2021-05-20 17:13:46 -04:00
Harmish
adb7b37263
[1.x] Add read_only block argument to opensearch-node unsafe-bootstrap command #599 (#725)
* apply user defined cluster wide read only block after unsafe bootstrap command

Signed-off-by: Harmish Lakhani <harmish.lakhani@gmail.com>

* Fixed gradle precommit failures

Signed-off-by: Harmish Lakhani <harmish.lakhani@gmail.com>

* remove default as false for read only block to avoid overriding user's existing settings

Signed-off-by: Harmish Lakhani <harmish.lakhani@gmail.com>
2021-05-20 17:12:16 -04:00
Abbas Hussain
d330ca6559
Handle inefficiencies while fetching the delayed unassigned shards during cluster health (#588) (#730)
Signed-off-by: Meet Shah <meetshsh@gmail.com>

Co-authored-by: Meet Shah <48720201+meetshah777@users.noreply.github.com>
2021-05-20 17:11:49 -04:00
Daniel Doubrovkine (dB.)
a8c5e71eb9
Create group settings with fallback. (#743) (#745)
* Create group settings with fallback.

Signed-off-by: dblock <dblock@amazon.com>

* Use protected fallbackSetting in Setting.

Signed-off-by: dblock <dblock@amazon.com>
2021-05-20 17:06:58 -04:00
Ankit Jain
edbe5ae7e8
Make allocation decisions at node level first for pending task optimi… (#534) (#739)
* Make allocation decisions at node level first for pending task optimization

Signed-off-by: Ankit Jain <akjain@amazon.com>

* Addressing review comments

Signed-off-by: Ankit Jain <akjain@amazon.com>

* Fixing benchmark and adding debug mode tests

Signed-off-by: Ankit Jain <akjain@amazon.com>

* Fixing typo in previous commit

Signed-off-by: Ankit Jain <akjain@amazon.com>

* Moving test file to correct package

Signed-off-by: Ankit Jain <akjain@amazon.com>

* Addressing review comments

Signed-off-by: Ankit Jain <akjain@amazon.com>
2021-05-20 14:02:18 -07:00
amitai stern
f4f5374592
Fix snapshot deletion task getting stuck in the event of exceptions (#629) (#650)
Changes the behavior of the recursive deletion function `executeOneStaleIndexDelete()` stop
condition to be when the queue of `staleIndicesToDelete` is empty -- also in the error flow.
Otherwise the GroupedActionListener never responds and in the event of a few exceptions the
deletion task gets stuck.
Alters the test case to fail to delete in bulk many snapshots at the first attempt, and then
the next successful deletion also takes care of the previously failed attempt as the test
originally intended.
SNAPSHOT threadpool is at most 5. So in the event we get more than 5 exceptions there are no
more threads to handle the deletion task and there is still one more snapshot to delete in the
queue. Thus, in the test I made the number of extra snapshots be one more than the max in the
SNAPSHOT threadpool.

Signed-off-by: AmiStrn <amitai.stern@logz.io>
2021-05-13 09:02:57 -05:00
Daniel Doubrovkine (dB.)
b1b563dc39
Standardize int, long, double and float Setting constructors. (#665) 2021-05-06 21:17:49 +00:00
Daniel Doubrovkine (dB.)
4d9356e185
Fix #649: Properly escape @ in JavaDoc. (#651)
Signed-off-by: dblock <dblock@amazon.com>
2021-05-06 20:12:22 +00:00
Nick Knize
3bbb87cbbc
Speedup snapshot stale indices delete (#613) (#616)
Instead of snapshot delete of stale indices being a single threaded operation this commit makes 
it a multithreaded operation and delete multiple stale indices in parallel using SNAPSHOT 
threadpool's workers.

Signed-off-by: Piyush Daftary <piyush.besu@gmail.com>
2021-04-28 11:02:21 -05:00
Sarat Vemulapalli
0e9f74e35f
Renaming CPU architecture to have consistent naming (#612)
* Renaming CPU architecture from x86_64, aarch64 to x64, arm64

Signed-off-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>
2021-04-26 09:40:09 -07:00
Nick Knize
c5a3c3cb41
Update lucene version to 8.8.2 (#557)
This commit updates the codebase to the latest released version of Lucene.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2021-04-23 09:48:41 -05:00
Rabi Panda
821c44c440
Fix failing test caused by versioning change. (#598)
The change in 0ba0e7cc, introduced the issue where randomly selecting an incompatible version fails the test. It caused the filtering logic to incorrectly identify all ES 7.*.* versions as bad versions for joining which should not be the case.

Additionally, split the test into two separate tests where earlier only one of them was run at random.

Signed-off-by: Rabi Panda <adnapibar@gmail.com>
2021-04-23 07:31:41 -07:00
Nick Knize
6e04778d0c
[Versioning] Fix Version.fromString logic for legacy version (#604)
This commit fixes the Version.fromString logic to identify legacy versions. It
also adds an optional "distribution" field to the MainRespose for OpenSearch
version 1.0.0+. Any preceeding versions that do not contain the distribution
label will be handeled as legacy versions appropriately.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2021-04-22 23:04:44 -05:00
Abbas Hussain
9d73fecbe7
Remove all elastic.co references from javadocs (#586)
Signed-off-by: Abbas Hussain <abbas_10690@yahoo.com>
2021-04-21 10:41:14 +05:30
Robert Muir
5474e8d094
Speed ups to test suite and precommit tasks. (#580)
Use C1 compiler only for short-lived tasks and unit test execution. Tone
down some of the slowest unit tests.

Signed-off-by: Robert Muir <rmuir@apache.org>
2021-04-20 09:02:45 -05:00
Nick Knize
0ba0e7cc26
[Versioning] Rebase to OpenSearch version 1.0.0 (#555)
This commit rebases the versioning to OpenSearch 1.0.0

Co-authored-by: Rabi Panda <adnapibar@gmail.com>

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2021-04-15 17:06:47 -05:00