Commit Graph

2554 Commits

Author SHA1 Message Date
Jake Landis afc2383b72
Optimize which Rest resources are used by the Rest tests. (#53299)
This should help with Gradle's incremental compile such that projects
only depend upon the resources they use.

related #52114
2020-03-18 09:09:29 -05:00
Ryan Ernst d63cda1bcb
Upgrade jackson to 2.10.3 and GeoIP to 2.13.1 (#53642)
Re-applies the change from #53523 along with test fixes.

closes #53626
closes #53624
closes #53622
closes #53625

Co-authored-by: Nik Everett <nik9000@gmail.com>
Co-authored-by: Lee Hinman <dakrone@users.noreply.github.com>
Co-authored-by: Jake Landis <jake.landis@elastic.co>
2020-03-17 10:26:35 -07:00
Alan Woodward 3e607d9e93
Rename AtomicFieldData to LeafFieldData (#53554)
This conforms with lucene's LeafReader naming convention, and
matches other per-segment structures in elasticsearch.
2020-03-17 12:25:51 +00:00
Mark Vieira 060b4eed59
Revert "Upgrade to Jackson 2.10.3 and GeoIP2 to 2.13.1 (#53523)"
This reverts commit 7bc75f48

Signed-off-by: Mark Vieira <portugee@gmail.com>
2020-03-15 18:10:14 -07:00
Jason Tedor 7bc75f48d8
Upgrade to Jackson 2.10.3 and GeoIP2 to 2.13.1 (#53523)
This commit upgrades our Jackson dependency to 2.10.3 and our GeoIP2
dependency to 2.13.1.
2020-03-14 10:22:29 -04:00
Jason Tedor 99a4fa354d
Update jackson-databind to 2.8.11.6 (#53522)
This commit upgrades the jackson-databind depdendency to
2.8.11.6. Additionally, we revert a previous change that put
ingest-geoip on the version of jackson-databind from the version
properties file. This is because upgrading ingest-geoip to a later
version of jackson-databind also requires an upgrade to the geoip2
dependency which is currently blocked. Therefore, if we can get to a
point where we otherwise upgrade our Jackson dependencies, we do not
want ingest-geoip to automatically come along with it.
2020-03-12 20:14:30 -04:00
Alan Woodward 5d716bc16c
Upgrade to final lucene 8.5.0 snapshot (#53293)
Lucene 8.5.0 release candidates are imminent. This commit upgrades master to use
the latest snapshot to check that there are no last-minute bugs or regressions.
2020-03-10 09:30:37 +00:00
Nhat Nguyen 8f17b21de8 Revert "upgrade to lucene-snapshot-fa75139efea (#53150)"
This reverts commit 59b841751d.
2020-03-05 17:30:06 -05:00
Armin Braun 40bd334b12
Upgrade GCS SDK to 1.104.0 (#52839)
Upgrading the GCS SDK to the most recent version.
Adjusting (i.e. improving) the REST mock accordingly.
This should significantly boost performance by pulling in
https://github.com/googleapis/java-core/issues/86 in some cases.
2020-03-05 09:10:09 +01:00
Ignacio Vera 59b841751d
upgrade to lucene-snapshot-fa75139efea (#53150) 2020-03-05 08:47:10 +01:00
Nhat Nguyen 699b1dccac
Upgrade to Lucene 8.5.0-snapshot-c4475920b08 (#52950)
To give LUCENE-9228 more CI cycles
2020-02-28 21:25:34 -05:00
Lee Hinman f8880b4024
Mute GoogleCloudStorageBlobStoreRepositoryTests (#52926)
These intermittently fail due to an assertion triggered by a JDK bug.

Relates to #52906
2020-02-27 15:16:26 -07:00
Mark Vieira 8bb5a11e76
Fix cacheability of repository-hdfs integ tests (#52858) 2020-02-27 09:53:33 -08:00
Mark Vieira 416dc460ce
Ignore test seed in third party test system property inputs (#52849) 2020-02-26 14:29:16 -08:00
Mark Vieira 5c53cc6a83
Don't try to start hdfs fixtures when kerberos is unavailable (#52661) 2020-02-21 13:46:46 -08:00
Mark Vieira c1a1047e42
Consolidate docker availability build logic (#52548) 2020-02-21 08:11:50 -08:00
Armin Braun 556707277f
Fix GCS Test testReadLargeBlobWithRetries (#52619)
The countdown didn't work well here because it only returns `true` once the countdown reaches `0`
but can on subsequent executions return `false` again if a countdown at `0` is counted down again,
leading to more than the expected number of simulated failures.

Closes #52607
2020-02-21 09:13:30 +01:00
Zachary Tong f05b831e43
Comprehensively test supported/unsupported field type:agg combinations (#52493)
This adds a test to AggregatorTestCase that allows us to programmatically
verify that an aggregator supports or does not support a particular
field type.  It fetches the list of registered field type parsers,
creates a MappedFieldType from the parser and then attempts to run
a basic agg against the field.

A supplied list of supported VSTypes are then compared against the
output (success or exception) and suceeds or fails the test accordingly.

Co-Authored-By: Mark Tozzi <mark.tozzi@gmail.com>
* Skip fields that are not aggregatable
2020-02-20 14:08:25 -05:00
Armin Braun f5ca487fc4
Add Caching for RepositoryData in BlobStoreRepository (#52341)
Cache latest `RepositoryData` on heap when it's absolutely safe to do so (i.e. when the repository is in strictly consistent mode).

`RepositoryData` can safely be assumed to not grow to a size that would cause trouble because we often have at least two copies of it loaded at the same time when doing repository operations. Also, concurrent snapshot API status requests currently load it independently of each other and so on, making it safe to cache on heap and assume as "small" IMO.

The benefits of this move are:
* Much faster repository status API calls 
   * listing all snapshot names becomes instant
   * Other operations are sped up massively too because they mostly operate in two steps: load repository data then load multiple other blobs to get the additional data
* Additional cloud cost savings
* Better resiliency, saving another spot where an IO issue could break the snapshot
* We can simplify a number of spots in the current code that currently pass around the repository data in tricky ways to avoid loading it multiple times in follow ups.
2020-02-20 12:58:29 +01:00
markharwood cbd224d070
Upgrade Lucene 8.5 to latest snapshot (#52520)
Upgrade Lucene 8.5 to latest snapshot
2020-02-20 10:34:41 +00:00
Armin Braun c257b56a96
Add Region and Signer Algorithm Overrides to S3 Repos (#52112)
Exposes S3 SDK signing region and algorithm override settings as requested in #51861.

Closes #51861
2020-02-20 11:12:20 +01:00
Armin Braun c665cf022a
Add Blob Download Retries to GCS Repository (#52479)
* Add Blob Download Retries to GCS Repository

Exactly as #46589 (and kept as close to it as possible code wise so we can dry things up in a follow-up potentially) but for GCS.

Closes #52319
2020-02-19 16:11:51 +01:00
Ioannis Kakavas 652bcd46e9
Update BouncyCastle to 1.64 (#52185)
This commit upgrades the bouncycastle dependency from 1.61 to 1.64.
2020-02-18 12:18:31 +02:00
Armin Braun 616fc3baf9
Fix Failure to Drain Stream in GCS Repo Tests (#52431)
Same as #51933 but for the custom handler just used in this test.

Closes #52430
2020-02-18 09:59:08 +01:00
Armin Braun f06f9fa5e4
Refactor Inflexible Snapshot Repository BwC (#52365)
Transport the version to use for  a snapshot instead of whether to use shard generations in the snapshots in progress entry. This allows making upcoming repository metadata changes in a flexible manner in an analogous way to how we handle serialization BwC elsewhere.
Also, exposing the version at the repository API level will make it easier to do BwC relevant changes in derived repositories like source only or encrypted.
2020-02-17 13:07:59 +01:00
Marios Trivyzas e42c4d1b0b
[Tests] Update skip version for YAML tests (#52324)
Update skip versions upper boundary to match the release
or intended release version of the feature/fix.

Relates to #52310
2020-02-13 20:03:48 +01:00
Jay Modi a11ccb83d4
Use List convenience methods in rest actions (#52286)
This commit replaces usages of older collection utility methods with
the JDK 9 convenience method `List.of()`.

Relates #51950
2020-02-12 15:11:22 -07:00
Marios Trivyzas a8b39ed842
Add a cluster setting to disallow expensive queries (#51385)
Add a new cluster setting `search.allow_expensive_queries` which by
default is `true`. If set to `false`, certain queries that have 
usually slow performance cannot be executed and an error message
is returned.

- Queries that need to do linear scans to identify matches:
  - Script queries
- Queries that have a high up-front cost:
  - Fuzzy queries
  - Regexp queries
  - Prefix queries (without index_prefixes enabled
  - Wildcard queries
  - Range queries on text and keyword fields
- Joining queries
  - HasParent queries
  - HasChild queries
  - ParentId queries
  - Nested queries
- Queries on deprecated 6.x geo shapes (using PrefixTree implementation)
- Queries that may have a high per-document cost:
  - Script score queries
  - Percolate queries

Closes: #29050
2020-02-12 18:06:04 +01:00
Armin Braun 96359c3744
Move EC2 Discovery Tests to Mock Rest API (#50605)
Move EC2 discovery tests to using the mock REST API introduced in
https://github.com/elastic/elasticsearch/pull/50550 instead of mocking
the AWS SDK classes manually.
Move the trivial remaining AWS SDK mocks to the single test suit that
was using them.
2020-02-12 17:07:04 +01:00
Ignacio Vera 8b6e6a1639 Upgrade to lucene-8.5.0-snapshot-d62f6307658 (#52039) 2020-02-10 09:08:15 +01:00
Jay Modi 627d853f18 RestHandlers declare handled routes (#51950)
This commit changes how RestHandlers are registered with the
RestController so that a RestHandler no longer needs to register itself
with the RestController. Instead the RestHandler interface has new
methods which when called provide information about the routes
(method and path combinations) that are handled by the handler
including any deprecated and/or replaced combinations.

This change also makes the publication of RestHandlers safe since they
no longer publish a reference to themselves within their constructors.

Closes #51622

Co-authored-by: Jason Tedor <jason@tedor.me>
2020-02-09 21:35:39 -07:00
Ioannis Kakavas 043279a6ff Fix custom policy in plugins in FIPS 140 (#52046)
Our FIPS 140 testing depends on setting the appropriate java policy
in order to configure the JVM in FIPS mode. Some tests (
discovery-ec2 and ccr qa ) also needed to set a custom policy file
to grant a specific permission, which overwrote the FIPS related
policy and tests would fail. This change ensures that when a
custom policy needs to be set in these tests, the permissions that
are necessary for FIPS are also set.

Resolves: #51685, #52034
2020-02-08 11:51:03 +02:00
Julie Tibshirani e0b3ea0416
Rename MapperService#fullName to fieldType. (#52025)
The new name more accurately describes what the method returns.
2020-02-07 10:16:53 -08:00
Armin Braun 26b9cf787d
Add Trace Logging of REST Requests (#51684)
Being able to trace log all REST requests to a node would make debugging
a number of issues a lot easier.
2020-02-06 20:05:03 +01:00
Ioannis Kakavas 12b24bfa57
Test modifications for FIPS 140 mode (#51832)
- Enable SunJGSS provider for Kerberos tests
- Handle the fact that in the decrypt method in KeyStoreWrapper might
not throw immediately when the GCM cipher is from BouncyCastle FIPS
and we end up with a DataInputStream that has reached it's end.
- Disable tests, jarHell, testingConventions for ingest attachment
plugin. We don't support this plugin (and document this) in FIPS
mode.
- Don't attempt to install ingest-attachment in smoke-test-plugins
2020-02-04 19:37:38 +02:00
Maria Ralli 84dd9dc9c0
Add host address to BindTransportException message (#51269)
When bind fails, show the host address in addition to the port. This
helps debugging cases with wrong "network.host" values.

Closes #48001
2020-02-04 08:48:13 +00:00
Ioannis Kakavas ae070f41d9
Adjust jarHell and 3rd party audit exclusions (#51733)
Now that the FIPS 140 security provider is simply a test dependency
we don't need the thirdPartyAudit exceptions, but plugin-cli and
transport-netty4 do need jarHell disabled as they use the non fips
BouncyCastle security provider as a test dependency too.
2020-01-31 19:46:20 +02:00
Tim Brooks ad32c10857
Upgrade netty to 4.1.45.Final (#51689)
Upgrade netty.
2020-01-31 10:33:23 -07:00
Ioannis Kakavas a59095e58a
Mute ec2 test in FIPS 140 mode (#51686)
as it needs an extra permission, until we can figure out how to
grant the permission in FIPS 140 mode too.

See: https://github.com/elastic/elasticsearch/issues/51685
2020-01-30 17:54:43 +02:00
Mayya Sharipova 3d53c48509
Upgrade to lucene-8.5.0-snapshot-3333ce7da6d (#51327)
Remove lucene-spatial module
Keep previous behaviour of FieldHighlighter::highlightOffsetsEnums

LUCENE-9093 modified how FieldHighlighter breaks texts into passages,
which doesn't work well with elasticsearch custome BoundedBreakIteratorScanner.
This commit for now keeps previous behaviour of FieldHighlighter.
2020-01-30 10:08:48 -05:00
Armin Braun 06c5db2220
Optimize GCS Repo Uploads (#51596)
For small uploads (that can still be up to 5MB!) we needlessly
reading the `InputStream` into a BAOS which entailed allocating
the `byte[]` for the stream contents twice (because to `toByteArray` on the BAOS copies).

Also, for resumeable uploads we were needlessly wrapping the output channel and running each individual write in its own privileged context when we could just wrap the whole upload in a single privileged context.

Relates #51593
2020-01-29 15:03:13 +01:00
Armin Braun 0952c2169d
Optimize GCS Mock (#51593)
This test was still very GC heavy in Java 8 runs in particular
which seems to slow down request processing to the point of timeouts
in some runs.
This PR completely removes the large number of O(MB) `byte[]` allocations
that were happening in the mock http handler which cuts the allocation rate
by about a factor of 5 in my local testing for the GC heavy `testSnapshotWithLargeSegmentFiles`
run.

Closes #51446
Closes #50754
2020-01-29 10:04:09 +01:00
Ioannis Kakavas 5de8009093
Revert e34d7fd (#51530)
In e34d7fd we decided to use the default distribution for all tests
when running in a FIPS 140 JVM. This is strictly not necessary in
master, as the problem we originally attempted to fix is that we
set `xpack.security.ssl.diagnose.trust` when running in FIPS 140
JVMs and OSS didn't know of that setting. In master, we do not
need to set `xpack.security.ssl.diagnose.trust` so we don't need
to _always_ run with default distribution.
2020-01-29 08:15:56 +02:00
Armin Braun 89318d46ab
Fix ByteBuf Leak in Nio HTTP Tests (#51444)
It is the job of the http server transport to release the request in the handler
but the mock fails to do so since we never override `incomingRequest`.
2020-01-25 15:05:30 +01:00
Armin Braun 44d5ad9ac6
Stop Copying Bulk HTTP Requests in NIO Networking (#49819)
Same as #44564 but for NIO.
2020-01-24 09:15:44 +01:00
Mark Vieira e34d7fdaf7
Always test against default distribution when in a FIPS JVM (#51273) 2020-01-22 10:55:25 -08:00
Alan Woodward 573c7ddab1
Remove fieldMapper parameter from MetadataFieldMapper.TypeParser#getDefault() (#51219)
This addresses a very old TODO comment in MetadataFieldMapper.TypeParser; passing
in a previously constructed field mapper here was a hack in order to provide access to
prebuilt analyzers for the AllFieldType; this has now been removed, so we can remove
the parameter from this method signature.
2020-01-21 09:18:05 +00:00
Alan Woodward 3d79624843
Revert "Don't use user-supplied type when building DocumentMapper (#50960)" (#51214)
Reverts #50960

This commit has been causing test failures during upgrade tests: specifically, an upgraded
node becomes master and sends a cluster state update to a 7.x node; this node sees that the
mapping version of its .tasks index is the same as the master, so asserts that the serialized
mappings are the same; however, because the master has rewritten the mapping to use
_docinstead oftasks`, we get an assertion failure. The logical fix is for the master to
increment its mapping version when it rewrites the mapping, but there isn't a simple way to
do that currently.

This reverts commit 774bfb5e22.
2020-01-20 11:14:49 +00:00
Armin Braun f4293597fc
Add CoolDown Period to S3 Repository (#51074)
Add cool down period after snapshot finalization and delete to prevent eventually consistent AWS S3 from corrupting shard level metadata as long as the repository is using the old format metadata on the shard level.
2020-01-20 10:32:21 +01:00
Nik Everett 2762375dc4
Move test of custom sig heuristic to plugin (#50891)
This moves the testing of custom significance heuristic plugins from an
`ESIntegTestCase` to an example plugin. This is *much* more "real" and
can be used as an example for anyone that needs to actually build such a
plugin. The old test had testing concerns and the example all jumbled
together.
2020-01-15 15:06:29 -05:00