Commit Graph

26295 Commits

Author SHA1 Message Date
Lee Hinman 8d83edc4a5 Disallow introducing illegal object mappings (double '..')
This disallows object mappings that would accidentally create something like
`foo..bar`, which is then unparsable for the `bar` field as it does not know
what its parent is.

Resolves #22794
2017-02-01 09:03:20 -07:00
Ali Beyad 5c1410d031 Removes premature addition of v5.4.0 constant 2017-02-01 10:43:53 -05:00
Tanguy Leroux 3cfcd1acb7 [TEST] Fix BytesRestResponseTests.testNoErrorFromXContent 2017-02-01 10:34:42 +01:00
Boaz Leskes 5bf9cb9f70 remove await fix from testCannotAllocateStaleReplicaExplanation 2017-02-01 10:31:26 +01:00
Boaz Leskes 06b8a1ada7 fix testCannotAllocateStaleReplicaExplanation node management
The test tried to create a situation where a stale replica is the only shard available. It did so by stopping the node with the replica, indexing some, stopping the primary node, starting a new node. This is flawed because the newly started node may reuse the data path of the primary node and things go back to green. Instead we should make sure that the replica is on the path that will be selected when the new node is started (i.e., the path with the smaller ordinal)
2017-02-01 10:30:42 +01:00
Tanguy Leroux c74679b6b9 Add parsing method to BytesRestResponse's error (#22873)
This commit adds a BytesRestResponse.errorFromXContent() method to parse the error returned by BytesRestResponse. It returns a ElasticsearchStatusException instance.
2017-02-01 10:11:17 +01:00
Rob Moore 40e1c136de Update search.asciidoc (#22865) 2017-02-01 09:24:19 +01:00
Ali Beyad f436a06971 [TEST] adds AwaitsFix on two failing tests 2017-01-31 22:42:23 -05:00
Ali Beyad 6f2222f8fb [TEST] fix node allocation result check in explain API test 2017-01-31 20:11:01 -05:00
Ali Beyad 547eb5c22f Include stale replica shard info when explaining an unassigned primary (#22826)
Currently, if a previously allocated shard has no in-sync copy in the
cluster, but there is a stale replica copy, the explain API does not
include information about the stale replica copies in its output.  This
commit includes any shard copy information available (even for stale
copies) when explaining an unassigned primary shard that was previously
allocated in the cluster.

This situation can arise as follows: imagine an index with 1 primary and
1 replica and a cluster with 2 nodes.  If the node holding the replica
is shut down, and data continues to be indexed, only the primary will
have the latest data and the replica that has gone offline will be
marked as stale.  Now, suppose the node holding the primary is shut
down.  There are no copies of the shard data in the cluster.  Now, start
the first stopped node (holding the stale replica) back up.  The cluster
is red because there is no in-sync copy available.  Running the explain
API before would inform the user that there is no valid shard copy in
the cluster for that shard, but it would not provide any information
about the existence of the stale replica that exists on the restarted
node.  With this commit, the explain API provides information about all
the stale replica copies when explaining the unassigned primary.
2017-01-31 16:31:55 -06:00
Ali Beyad c223457ba1 Adds v5.2.1 and v5.4.0 constants and bwc index for 5.2.0 2017-01-31 17:12:02 -05:00
Ryan Ernst 8b10afcfba Add 5.2.0 to static versions used by vagrant 2017-01-31 13:40:56 -08:00
Jack Conradson 3d2626c4c6 Change Namespace for Stored Script to Only Use Id (#22206)
Currently, stored scripts use a namespace of (lang, id) to be put, get, deleted, and executed. This is not necessary since the lang is stored with the stored script. A user should only have to specify an id to use a stored script. This change makes that possible while keeping backwards compatibility with the previous namespace of (lang, id). Anywhere the previous namespace is used will log deprecation warnings.

The new behavior is the following:

When a user specifies a stored script, that script will be stored under both the new namespace and old namespace.

Take for example script 'A' with lang 'L0' and data 'D0'. If we add script 'A' to the empty set, the scripts map will be ["A" -- D0, "A#L0" -- D0]. If a script 'A' with lang 'L1' and data 'D1' is then added, the scripts map will be ["A" -- D1, "A#L1" -- D1, "A#L0" -- D0].

When a user deletes a stored script, that script will be deleted from both the new namespace (if it exists) and the old namespace.

Take for example a scripts map with {"A" -- D1, "A#L1" -- D1, "A#L0" -- D0}. If a script is removed specified by an id 'A' and lang null then the scripts map will be {"A#L0" -- D0}. To remove the final script, the deprecated namespace must be used, so an id 'A' and lang 'L0' would need to be specified.

When a user gets/executes a stored script, if the new namespace is used then the script will be retrieved/executed using only 'id', and if the old namespace is used then the script will be retrieved/executed using 'id' and 'lang'
2017-01-31 13:27:02 -08:00
Boaz Leskes eb36b82de4 Seq Number based recovery should validate last lucene commit max seq# (#22851)
The seq# base recovery logic relies on rolling back lucene to remove any operations above the global checkpoint. This part of the plan is not implemented yet but have to have these guarantees. Instead we should make the seq# logic validate that the last commit point (and the only one we have) maintains the invariant and if not, fall back to file based recovery.

 This commit adds a test that creates situation where rollback is needed (primary failover with ops in flight) and fixes another issue that was surfaced by it - if a primary can't serve a seq# based recovery request and does a file copy, it still used the incoming `startSeqNo` as a filter.

 Relates to #22484 & #10708
2017-01-31 20:27:31 +01:00
Ryan Ernst 29f63c78cc Internal: Convert empty and size checks of settings to not use getAsMap() (#22890)
With the new secure settings, methods like getAsMap() no longer work
correctly as a means of checking for empty settings, or the total size.
This change converts the existing uses of that method to use methods
directly on Settings. Note this does not update the implementations to
account for SecureSettings, as that will require a followup which
changes how secure settings work.
2017-01-31 10:44:09 -08:00
Jim Ferenczi f6d38d480a Integrate UnifiedHighlighter (#21621)
* Integrate UnifiedHighlighter

This change integrates the Lucene highlighter called "unified" in the list of supported highlighters for ES.
This highlighter can extract offsets from either postings, term vectors, or via re-analyzing text.
The best strategy is picked automatically at query time and depends on the field and the query to highlight.
2017-01-31 19:06:03 +01:00
Nik Everett f90051e6e0 Docs: Add a note about `<` and `>` in query_string
`<` and `>` can't be escaped at all in `query_string`. If we're not
going to fix that we should at least document it.

Relates to #21703
2017-01-31 12:23:18 -05:00
alamzeeshan a1cc683cff Updated document as per code change. (#22878)
Updated document as per this change : https://github.com/elastic/elasticsearch/pull/15235
2017-01-31 13:36:09 +01:00
Shubham Aggarwal d80e05f4d2 Minor fix in Create Index desc (#22877) 2017-01-31 12:53:15 +01:00
Shubham Aggarwal e07e4cc4dd Fix incorrect heading for Whitespace Tokenizer (#22883) 2017-01-31 12:51:37 +01:00
markharwood 9e8e556b08 Build fix for broken docs build 2017-01-31 10:27:06 +00:00
markharwood c0d525b108 [DOCS] [TEST] enhancement - added CONSOLE scripts for sampler aggs (#22869)
Added missing CONSOLE scripts to documentation for sampler and diversified_sampler aggs.
Includes new StackOverflow index setup in build.gradle

Closes #22746

* Formatting tweaks
2017-01-31 09:45:25 +00:00
David Pilato 858333246d Merge branch 'pr/remove-azure-container-auto-creation'
# Conflicts:
#	docs/reference/migration/migrate_6_0/plugins.asciidoc
2017-01-31 09:05:43 +01:00
Ryan Ernst 003805e875 Docs: Add setup section for the keystore tool and secure settings (#22838) 2017-01-30 14:56:45 -08:00
Ryan Ernst a4f6edec52 Settings: Fix settings reading to account for defaults (#22871)
In #22762, settings preparation during bootstrap was changed slightly to
account for SecureSettings, by starting with a fresh settings builder
after reading the initial configuration. However, this the defaults from
system properties were never re-read. This change fixes that bug (which
was never released).

closes #22861
2017-01-30 14:42:40 -08:00
Ryan Ernst cf7747c338 S3 Repository: Remove region setting (#22853)
This change removes the ability to set region for s3 repositories.
Endpoint should be used instead if a custom s3 location needs to be
used.

closes #22758
2017-01-30 14:34:59 -08:00
Christoph Büscher 4e613139dc Ensure fixed serialization order of InnerHitBuilder (#22820)
Usually the order in which we serialize sets and maps of things doesn't matter,
but since InnerHitBuilder is part of SearchSourceBuilder, which is in turn used
as a cache key in its bytes serialization, we need to ensure the order of all
these fields when writing them to an output stream.

This adds tests and makes sure we iterate over the scriptField set and the
childInnerHits map in a fixed order.

Closes #22808
2017-01-30 19:28:55 +01:00
Lee Hinman b28ef3063e Merge branch 'pr/22693' 2017-01-30 10:32:23 -07:00
David Pilato 4d1e291933 Merge remote-tracking branch 'origin/master' 2017-01-30 17:53:13 +01:00
David Pilato 72e15b1c7c Merge branch 'pr/fix-hdfs-settings' 2017-01-30 17:52:34 +01:00
Jim Ferenczi e7e871acdd Fix link to keyword and numeric type 2017-01-30 13:57:28 +01:00
Mathieu Berube e0b8e45cc5 Fix typo - mergins to margins (#22839) 2017-01-30 13:52:32 +01:00
Clinton Gormley b5a0e59af4 Fixed bad asciidoc 2017-01-30 11:56:40 +01:00
Clinton Gormley 938f5194ef Include field-collapsing docs in request-body search 2017-01-30 11:47:12 +01:00
David Pilato 1898dc2554 Remove auto creation of container for azure repository
Follow up of #22857 where we deprecate automatic creation of azure containers.

BTW I found that the `AzureSnapshotRestoreServiceIntegTests` does not bring any value because it runs basically a Snapshot/Restore operation on local files which we already test in core.

So instead of trying to fix it to make it pass with this PR, I simply removed it.
2017-01-30 11:47:08 +01:00
Adrien Grand dc62255ddd Document upcoming scoring changes. (#22806) 2017-01-30 11:08:49 +01:00
Ryan Ernst fe4043c8ff S3 Repository: Remove bucket auto create (#22846)
closes #22761
2017-01-28 11:13:21 -08:00
Alex Bumbu 41abf6e81d Add used memory amount to CircuitBreakingException message (#22521) 2017-01-28 16:54:13 +00:00
Nik Everett e042c77301 Add tests for reducing top hits (#22837)
Also adds many `equals` and `hashCode` implementations and moves
the failure printing in `MatchAssertion` into a common spot and
exposes it over `assertEqualsWithErrorMessageFromXContent` which
does an object equality test but then uses `toXContent` to print
the differences.

Relates to #22278
2017-01-27 20:54:11 -05:00
Boaz Leskes b1f0d8f4cf await fix testRecoveryWaitsForOps 2017-01-27 23:26:23 +01:00
Boaz Leskes 204df2a199 fix @TestLogging annotation 2017-01-27 23:15:51 +01:00
Ryan Ernst c921bebc4a S3 Repository: Remove env var and sysprop credentials support (#22842)
These are deprecated in 5.x. This commit removes support for them in 6.0.
2017-01-27 13:43:16 -08:00
Simon Willnauer e946ec0c33 Don't convert source to UTF-8 it might not be valid UTF-8 2017-01-27 22:31:44 +01:00
Nik Everett 2e48fb8294 Move delete by query helpers into core (#22810)
This moves the building blocks for delete by query into core. This
should enabled two thigns:
1. Plugins other than reindex to implement "bulk by scroll" style
operations.
2. Plugins to directly call delete by query. Those plugins should
be careful to make sure that task cancellation still works, but
this should be possible.

Notes:
1. I've mostly just moved classes and moved around tests methods.
2. I haven't been super careful about cohesion between these core
classes and reindex. They are quite interconnected because I wanted
to make the change as mechanical as possible.

Closes #22616
2017-01-27 16:09:18 -05:00
Tim Brooks eb4562d7a5 Add doPrivilege blocks for socket connect ops in repository-hdfs (#22793)
This is related to #22116. The repository-hdfs plugin opens socket
connections. As SocketPermission is transitioned out of core, hdfs
will require connect permission. This pull request wraps operations
that require this permission in doPrivileged blocks.
2017-01-27 15:01:44 -06:00
Ryan Ernst aad51d44ab S3 repository: Add named configurations (#22762)
* S3 repository: Add named configurations

This change implements named configurations for s3 repository as
proposed in #22520. The access/secret key secure settings which were
added in #22479 are reverted, and the only secure settings are those
with the new named configs. All other previously used settings for the
connection are deprecated.

closes #22520
2017-01-27 10:42:45 -08:00
Boaz Leskes 0f58f3f34b fix TestLogging instructions for the remove of single doc indexing actions + add some seq# related info 2017-01-27 19:21:11 +01:00
Nik Everett e36e5fc994 Remove annotation
Not allowed.
2017-01-27 12:37:35 -05:00
Ryan Ernst 59c3373cec Build: Remove legacy migration script (#22834)
This migration script existed from moving plugins into the ES repo in
2.0. It is no longer needed (and contains eg maven commands), and if we
did need any part of it, it will still exist in git history.
2017-01-27 09:34:10 -08:00
Nik Everett 8abd4101eb Add tests for reducing top hits
Also adds many `equals` and `hashCode` implementations and moves
the failure printing in `MatchAssertion` into a common spot and
exposes it over `assertEqualsWithErrorMessageFromXContent` which
does an object equality test but then uses `toXContent` to print
the differences.

Relates to #22278
2017-01-27 12:32:17 -05:00