Commit Graph

54940 Commits

Author SHA1 Message Date
Marc Handalian 36401d9edb
Fix Snapshot pattern in DistributionDownloader. (#916) (#920)
Snapshots are published with a -latest flag into s3, this updates
the pattern to correctly point to -latest.

Signed-off-by: Marc Handalian <handalm@amazon.com>
2021-07-01 21:59:41 -05: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
Marc Handalian af4ad4fe8d
Update DistributionDownloader to fetch snapshots and staging bundles. (#904) (#907)
This change updates DistributionDownloader by registering a second
repository containing release-candidate bundles.  This repository will
only be checked if the release repository does not contain the requested
version.

This change also updates the snapshot repository to point to a new
snapshot repository.

Signed-off-by: Marc Handalian <handalm@amazon.com>
2021-06-30 11:32:55 -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 f5199ee026
Add URL for lucene snapshots (#888)
Signed-off-by: Marc Handalian <handalm@amazon.com>
2021-06-28 09:58:54 -05:00
Tianli Feng 6e5e1aeeec
update external library 'pdfbox' version to 2.0.24 to reduce vulnerability (#883) (#886) 2021-06-25 16:04:28 -07:00
Nick Knize 1a4c2915a3
[BUG] Fix versioning issues discovered through version bump (#884) (#887)
This commit fixes up the version framework to ensure a smooth version bump
across releases.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
2021-06-25 17:08:37 -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
Rabi Panda 4f5b48f722
Enable BWC checks (#796) (#811)
Signed-off-by: Rabi Panda <adnapibar@gmail.com>
2021-06-03 15:09:12 -04:00
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
Rabi Panda 235cf29f90 Revert "Initial boilerplate for implementing the upgrade cli."
This reverts commit 3692d67c

Signed-off-by: Rabi Panda <adnapibar@gmail.com>
2021-05-26 11:54:59 -07:00
Rabi Panda 3692d67c1e Initial boilerplate for implementing the upgrade cli.
Signed-off-by: Rabi Panda <adnapibar@gmail.com>
2021-05-26 11:45:16 -07:00
Rabi Panda 96e16c68d6
Support running elasticsearch-oss distribution in test cluster for BWC (#764) (#774)
We need to install elasticsearch in the test cluster nodes to be able to run the BWC tests. This commit makes the following changes to enable that,
- updates DistributionDownloadPlugin to download elasticsearch-oss distributions.
- updates OpenSearchNode to be able to run both OpenSearch and Elasticsearch distributions.

Signed-off-by: Rabi Panda <adnapibar@gmail.com>
2021-05-26 07:22:33 -07:00
Abbas Hussain 3cc8ab0d30
[CVE] Upgrade dependencies for Azure related plugins to mitigate CVEs (#688) (#771)
* Update commons-io-2.4.jar to 2.7 for plugins/discovery-azure-classic module
* Remove unused jackson dependency and respective LICENSE and NOTICE
* Update guava dependency to mitigate CVE for repository-azure plugin

Signed-off-by: Abbas Hussain <abbas_10690@yahoo.com>
2021-05-26 04:52:26 +05:30
Tianli Feng 69403283bd
distribution/packages: Fix RPM architecture name for 64-bit x86 (#620) (#770)
RPM uses the "x86_64" name for 64-bit x86, which is in-line with GCC
and other compilers.

Signed-off-by: Neal Gompa <ngompa13@gmail.com>

Co-authored-by: Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
2021-05-26 04:12:38 +05:30
Rabi Panda b6ca8e6db4
[Bug] Fix gradle build on Windows failing from a recent change (#765)
A recent change as part of the commit c2e816ec introduced a bug where the build is failing on Windows. The change was made to include the NOTICE.txt file as read-only in the distributions. The code fails on Windows as it's not a POSIX-compliant. This commit adds a check on the current operating system.

Signed-off-by: Rabi Panda <adnapibar@gmail.com>
2021-05-25 10:51:53 -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 ea574d13d7
Remove URL content from Reindex error response (#630) (#748)
Signed-off-by: Sooraj Sinha <soosinha@amazon.com>

Co-authored-by: Sooraj Sinha <81695996+soosinha@users.noreply.github.com>
2021-05-21 17:20:34 -07:00
Abbas Hussain b65c70dee7
Add Remote Reindex SPI extension (#547) (#756)
This change extends the remote reindex SPI to allow adding a custom interceptor.
This interceptor can be plugged in to perform any processing on the request or response.

Signed-off-by: Sooraj Sinha <soosinha@amazon.com>

Co-authored-by: Sooraj Sinha <81695996+soosinha@users.noreply.github.com>
2021-05-22 04:50:00 +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
Abbas Hussain 935001e16a
distribution/packages: Fix filename format for deb archives (#621) (#753)
Debian packages are formatted with the following filename structure:

name_[epoch:]version-release_arch.deb

Make generated Debian packages follow this convention.

Signed-off-by: Neal Gompa <ngompa13@gmail.com>

Co-authored-by: Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
2021-05-21 11:03:36 +05:30
Abbas Hussain ad3ece85aa
Update/maintainers.md (#723) (#752)
Adding Gopala, Vengad, Shweta, db and Itiyama to maintainers list

Signed-off-by: CEHENKLE <henkle@amazon.com>
2021-05-21 04:45:28 +05:30
Abbas Hussain 659c199b93
Updating README and CONTRIBUTING guide to get ready for beta1 release. (#672) (#751)
* Updating README and CONTRIBUTING guide to get ready for beta1 release.

Signed-off-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>

* Addressing comments.

Signed-off-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>

Co-authored-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>
2021-05-20 15:57:07 -07:00
Abbas Hussain 83ee60660f
Update issue template with multiple labels (#668) (#749)
Signed-off-by: Vacha Shah <vachshah@amazon.com>

Co-authored-by: Vacha Shah <vachshah@amazon.com>

Co-authored-by: Vacha <VachaShah@users.noreply.github.com>
Co-authored-by: Vacha Shah <vachshah@amazon.com>
2021-05-20 15:55:56 -07:00
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
Rabi Panda 79c0444058
[CVE-2020-7692] Upgrade google-oauth clients for goolge cloud plugins (#662) (#734)
For discovery-gce and repository-gcs plugins update the google-oauth-client library to version 1.31.0. See CVE details at https://nvd.nist.gov/vuln/detail/CVE-2020-7692

Signed-off-by: Rabi Panda <adnapibar@gmail.com>
2021-05-20 17:13:15 -04:00
Rabi Panda 2217c11cb2
Update dependencies for ingest-attachment plugin. (#666) (#735)
This PR resolves the CVEs for dependencies in the ingest-attachment plugin.

tika : '1.24' -> '1.24.1' (https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-9489)
pdfbox : '2.0.19' -> '2.0.23' (https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-27807)
commons-io:commons-io : '2.6' -> '2.7' (https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-29425)

Signed-off-by: Rabi Panda <adnapibar@gmail.com>
2021-05-20 17:13:02 -04:00
Rabi Panda 3183998b2b
[CVE-2018-11765] Upgrade hadoop dependencies for hdfs plugin (#654) (#736)
Hadoop 2.8.5 has been reported to have CVEs (https://bugzilla.redhat.com/show_bug.cgi?id=1883549). We need to upgrade this to 2.10.1. This also updates the hadoop-minicluster version to 2.10.1 as well. This upgrade also brings in two additional dependencies, woodstox-core and stax2-api that are added along with the sha1s, licenses and notices.

Also upgrade guava to the latest as per the CVE https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-8908

Signed-off-by: Rabi Panda <adnapibar@gmail.com>
2021-05-20 17:12:33 -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
Rabi Panda 3290932fe4
[TEST] Fix failing distro tests for linux packages (#569) (#733)
Changes to fix the failing OpenSearch distribution tests for packages (linux-archive, linux-archive-aarch64, debian, rpm, docker) on supported linux distros. 

Signed-off-by: Rabi Panda <adnapibar@gmail.com>
2021-05-20 17:11:03 -04:00
Rabi Panda 864466cbdb
Update instructions on debugging OpenSearch. (#689) (#738)
Add clear instructions on how to run OpenSearch with debugging mode in IntelliJ. 
Fixed a few minor typos and grammars.

Signed-off-by: Rabi Panda <adnapibar@gmail.com>
2021-05-20 17:09:59 -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
Rabi Panda e90bde5a05
[CVE] Upgrade dependencies to mitigate CVEs (#657) (#737)
This PR upgrade the following dependencies to fix CVEs.

- commons-codec:1.12 (->1.13) apache/commons-codec@48b6157
- ant:1.10.8 (->1.10.9) https://ant.apache.org/security.html
- jackson-databind:2.10.4 (->2.11.0) FasterXML/jackson-databind#2589
- jackson-dataformat-cbor:2.10.4 (->2.11.0) https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-28491
- apache-httpclient:4.5.10 (->4.5.13) https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2020-13956
- checkstyle:8.20 (->8.29) https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-10782
- junit:4.12 (->4.13.1) https://github.com/junit-team/junit4/security/advisories/GHSA-269g-pwp5-87pp
- netty:4.1.49.Final (->4.1.59) https://github.com/netty/netty/security/advisories/GHSA-5mcr-gq6c-3hq2

Signed-off-by: Rabi Panda <adnapibar@gmail.com>
2021-05-19 21:20:53 -07:00
Abbas Hussain b574acf6b9
Added a link to the maintainer file in contribution guides (#589) (#731)
Co-authored-by: Dawn Foster <fosterd@vmware.com>
2021-05-19 13:41:32 -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.) b948315633
Converted all .asciidoc to .md. (#658)
Signed-off-by: dblock <dblock@amazon.com>
2021-05-06 20:12:49 +00:00