Commit Graph

2580 Commits

Author SHA1 Message Date
Jason Tedor ab45d69b16 Remove unused import in o.e.c.l.Releasables 2015-12-02 16:29:04 -05:00
Adrien Grand 7d25623b1f Fix NPE when a segment with an empty cache gets closed.
This is due to the fact that the query cache will still call the
onDocIdSetEviction callback in this case but with a number of entries equal to
zero.

Close #15043
2015-12-02 21:59:20 +01:00
Areek Zillur 3d8c32008e [TEST] geo completions work with geo point fields 2015-12-02 13:01:33 -05:00
Jason Tedor 199a05311e Remove unchecked warnings rendered unnecessary 2015-12-02 10:55:25 -05:00
Jason Tedor 05430a788a Remove and forbid use of the type-unsafe empty Collections fields
This commit removes and now forbids all uses of the type-unsafe empty
Collections fields Collections#EMPTY_LIST, Collections#EMPTY_MAP, and
Collections#EMPTY_SET. The type-safe methods Collections#emptyList,
Collections#emptyMap, and Collections#emptySet should be used instead.
2015-12-02 10:41:59 -05:00
Adrien Grand 79188ed38d Treat mappings at an index-level feature.
Today we try to have type-level granularity when dealing with mappings. This
does not play well with the cross-type validations that we are adding. For
instance we prevent the `_parent` field to point to an existing type. This
validation would be skipped today in the case of dedicated master nodes, since
those master nodes would only create the type that is being updated when
updating a mapping.
2015-12-02 16:32:12 +01:00
Robert Muir b7f497627f Merge pull request #15172 from rmuir/nuke_unused_deps
remove unused core dependencies
2015-12-02 07:20:11 -05:00
Martijn van Groningen ec74586680 metadata: If an alias and index share the same name then a descriptive error should be thrown
In 1.x it is possible via index templates to create an index with an alias with the same name as the index. The index name must match the index template and have an alias with the same name as the index being created.
2015-12-02 12:23:51 +01:00
Ryan Ernst d68c6673a2 Build: Cleanup precommit task gradle code
This change attempts to simplify the gradle tasks for precommit. One
major part of that is using a "less groovy style", as well as being more
consistent about how tasks are created and where they are configured. It
also allows the things creating the tasks to set up inter task
dependencies, instead of assuming them (ie decoupling from tasks
eleswhere in the build).
2015-12-01 22:36:54 -08:00
Robert Muir ef7258413f improve exception and remove complex test, such indexes will not be loaded into a closed state.
we will not load them at all.
2015-12-01 23:03:54 -05:00
Robert Muir 6e5c301739 remove unused dependencies 2015-12-01 22:22:11 -05:00
Jason Tedor e52faa81cc Fix typo in field name in MetaDataMappingService 2015-12-01 13:16:28 -05:00
Adrien Grand 304695e7ee Don't treat _default_ as a regular type.
This adds safety that you can't index into the `_default_` type (it was possible
before), and can't add default mappers to the field type lookups (was not
happening in tests but I think this is still a good check).

Also MapperService.types() now excludes `_default` so that eg. the `ids` query
does not try to search on this type anymore.
2015-12-01 18:03:11 +01:00
Jason Tedor 413688b0ca Apply shard failures in a single batch 2015-12-01 11:19:47 -05:00
Adrien Grand 77095a3e97 Merge pull request #15144 from jpountz/fix/ignored_merge_failure
Mappings: Don't ignore merge failures.
2015-12-01 16:37:32 +01:00
Jason Tedor d7f4dd0767 Use general cluster state batching mechanism for shard failures
This commit modifies the handling of shard failure cluster state updates
to use the general cluster state batching mechanism. An advantage of
this approach is we now get correct per-listener notification on
failures.
2015-12-01 10:19:23 -05:00
Christoph Büscher 6f2c36dcb7 Merge pull request #15113 from cbuescher/highligh-builder-refactoring
Make HighlighterBuilder implement Writable, equals and hashCode
2015-12-01 15:28:33 +01:00
Christoph Büscher 027a9b1844 Refactor HighlighterBuilder
This change pulls out the common fields that HighlighterBuilder shares with
its nested Field class into a new abstract CommonHighlighterOptions superclass
which also gets equals() and hashCode() method and methods to serialize the
common fields to a StreamOutput and read them from a stream.

Relates to #15044
2015-12-01 15:17:09 +01:00
javanna c67a332486 Query DSL: Enforce distance is greater than 0 in geo distance query
Validation is not done as part of the distance setter method and tested in GeoDistanceQueryBuilderTests. Fixed GeoDistanceTests to adapt to the new validation.

Closes #15135
2015-12-01 14:07:32 +01:00
Jason Tedor 13dbed9c92 Add each mapping at most once on batch mapping updates
When creating an index on master for the purpose of updating mappings, a
mapping being updated could needlessly be merged multiple times. This
commit ensures that each mapping is merged at most once while preparing
to update mappings.
2015-12-01 07:52:32 -05:00
Jason Tedor 09006ace11 Add the default mapping at most once on batch mapping updates
When creating an index on master for the purpose of updating mappings,
the default mapping could needlessly be added multiple times. This
commit ensures that the default mapping is added at most once while
preparing to update mappings.
2015-12-01 07:52:32 -05:00
Jason Tedor eea72a6d86 Preserve existing mappings on batch mapping updates
This commit addresses an issues introduced in #14899 to apply mapping
updates in batches. The issue is that an existing mapping for a type
could be lost if that type came in a batch that already contained a
mapping update for another type on the same index. The underlying issue
was that the existing mapping would not be merged in because the merging
logic was only tripped once per index, rather than for all types seeing
updates for each index. Resolving this issue is simply a matter of
ensuring that all existing types seeing updates are merged in.

Closes #15129
2015-12-01 07:52:32 -05:00
David Pilato fb79d064d7 Merge remote-tracking branch 'origin/master' 2015-12-01 12:46:09 +01:00
Adrien Grand cebd7bdd7f Mappings: Don't ignore merge failures. 2015-12-01 12:22:07 +01:00
javanna d17d629422 [TEST] stabilize SimpleSearchIT.testQueryNumericFieldWithRegex
Provide mappings explicitly instead of relying on dynamic mapping, also add missing ensureGreen.

Closes #15105
2015-12-01 12:13:06 +01:00
David Pilato 854099f1d5 Reject refresh usage in bulk items when using and fix NPE when no source
The REST bulk API rejects use of `refresh` at the item level. But the Java API lets the user setting it.

We need to have the same behavior and don't let think the user he can define `refresh` per bulk item.

Note that the user can still define `refresh` on the bulk itself.

Also a user can create with Java API an IndexRequest without any source which is causing a NPE when evaluating the bulk item size.

Closes #7361.
Closes #15120.
2015-12-01 12:00:30 +01:00
Yannick Welsch 059a675aa5 [TEST] mark test as awaitsfix: RareClusterStateIT.testDeleteCreateInOneBulk() 2015-12-01 11:41:51 +01:00
Britta Weber e2f87b0c52 multi field names may not contain dots
related to #14957
2015-12-01 11:27:26 +01:00
Boaz Leskes e256c6fdd1 AwaitsFix testDynamicUpdates
pending on https://github.com/elastic/elasticsearch/issues/15129
2015-12-01 09:57:22 +01:00
Robert Muir 44f21b24d7 Fix unit tests to bind to port 0.
I will followup with ITs and other modules. By fixing this, these tests become more reliable (will never sporatically
fail due to other stuff on your machine: ports are assigned by the OS), and it allows us to move forward with
gradle parallel builds, in my tests this is a nice speedup, but we can't do it until tests are cleaned up
2015-11-30 17:22:58 -05:00
Jason Tedor fba74c9615 Add docs for cluster state update task batching 2015-11-30 08:59:24 -05:00
Jason Tedor ffb3e0a845 ClusterStateTaskListener#onNoLongerMaster now throws NotMasterException 2015-11-30 08:59:24 -05:00
Jason Tedor 72e18ec681 Add builder to create cluster state executor results 2015-11-30 08:59:24 -05:00
Jason Tedor 9aa9447016 Simplify loop in InternalClusterService#runTasksForExecutor 2015-11-30 08:59:23 -05:00
Jason Tedor 7caee2fa4d Explicitly correspond cluster state tasks and execution results 2015-11-30 08:59:23 -05:00
Jason Tedor c3f97e7642 Simplify InternalClusterService#submitStateUpdateTask with lambdas 2015-11-30 08:59:23 -05:00
Jason Tedor 1fb6a1f669 Simplify grouping of cluster state update tasks 2015-11-30 08:59:23 -05:00
Jason Tedor eaba3d5cb3 Add test for cluster state batch updates 2015-11-30 08:59:23 -05:00
Boaz Leskes f0f89e708d Split cluster state update tasks into roles
This commit splits cluster state update tasks into roles. Those roles
are:
 - task info
 - task configuration
 - task executor
 - task listener

All tasks that have the same executor will be executed in batches. This
removes the need for local batching as was previously in
MetaDataMappingService.

Additionally, this commit reintroduces batching on mapping update calls.

Relates #13627
2015-11-30 08:59:23 -05:00
Christoph Büscher a0fe93fa67 Tests: Correction in AbstractShapeBuilderTestCase
Removed check that two shapes that are different according
to equals() have different hashCode since that is not required
by the contract of hashCode.
2015-11-30 11:09:41 +01:00
Jim Ferenczi e182072b6f Merge pull request #15017 from jimferenczi/fields_option
Refuse to load fields from _source when using the `fields` option and support wildcards.
2015-11-30 11:01:21 +01:00
Jim Ferenczi 731833cfc6 Fixes #14489
Do not to load fields from _source when using the `fields` option.
  Non stored (non existing) fields are ignored by the fields visitor when using the `fields` option.

Fixes #10783
  Support * wildcard to retrieve stored fields when using the `fields` option.
  Supported pattern styles are "xxx*", "*xxx", "*xxx*" and "xxx*yyy".
2015-11-30 11:00:32 +01:00
Robert Muir b7523bb974 Add workaround for JDK-6427854
See e.g. http://build-us-00.elastic.co/job/es_feature_ingest/2831/consoleFull

The bug can still happen, so we should let netty do this workaround
2015-11-29 16:12:52 -05:00
Michael McCandless 94954ece3a improve javadocs 2015-11-29 06:13:47 -05:00
Michael McCandless 8933947b95 only pull Fields once from the reader 2015-11-29 06:00:11 -05:00
Robert Muir 29853744a3 Merge pull request #15055 from rmuir/fun_with_windows
set ActiveProcessLimit=1 on windows
2015-11-27 16:57:34 -05:00
Christoph Büscher b375084305 Tests: Correction in AbstractQueryTestCase
Removed check that two query builder that are different according
to equals() have different hashCode since that is not required
by the contract of hashCode.
2015-11-27 17:36:57 +01:00
Daniel Mitterdorfer 2f87e0a4d9 Declare NetworkService non-final to support mocking in tests 2015-11-27 15:51:19 +01:00
Robert Muir ee827198ff set ActiveProcessLimit=1 on windows
This blocks process creation, similar to the approach for BSD.
2015-11-27 01:50:09 -05:00
Robert Muir aa56bfa562 Merge pull request #15039 from rmuir/setrlimit
set RLIMIT_NPROC = 0 on bsd/os X systems.
2015-11-26 21:18:57 -05:00
Jason Tedor 5c5e02e0bf Remove outdated comment and cleanup RestVerifyRepositoryAction 2015-11-26 19:11:11 -05:00
Simon Willnauer e363e0c2aa Merge pull request #15012 from s1monw/issues/14866
Prevent writing to closed channel if translog is already closed
2015-11-26 14:47:38 +01:00
Simon Willnauer 59be738e40 Merge pull request #15035 from s1monw/simplify_monitoring_service
Simplify MonitorService construction and detach from guice
2015-11-26 14:05:32 +01:00
Simon Willnauer 9f6598b18d Fix compile errors 2015-11-26 13:41:00 +01:00
Britta Weber 16b84b3999 run bwc test also as integ test and share methods
We had no itegration test before with long terms and several shards only
a bwc test.

related to #14948
2015-11-26 10:57:33 +01:00
Simon Willnauer 3dfa146632 Move ensureOpen calls under lock
We used to check on several places if we are still open but non of these
places did the check under the lock which leaves a small window where we
potentially get closed but still access an already closed channel or another
IO resource.
2015-11-26 10:14:45 +01:00
Simon Willnauer dfdc738a9f Simplify MonitorService construction and detach from guice
This is a pretty trivial change that moves most of the monitor service related
object creation from guice into the monitor service. This is a babystep towards removing
guice on the node level as well. Instead of opening huge PRs I try to do this in baby-steps
that are easier to digest.
2015-11-26 09:50:41 +01:00
Robert Muir 2341330aba set RLIMIT_NPROC = 0 on bsd/os X systems.
This BSD-specific limit prevents child process creation.
2015-11-26 02:58:53 -05:00
Christoph Büscher 609d9db470 Geo: Fix toString() in GeoDistanceRangeQuery and GeoPolygonQuery
Minor typo in the two queries toString() method. They were former
filters the toString() seems to have been forgotten while renaming.
2015-11-25 21:52:20 +01:00
Adrien Grand f8a414c681 Remove Plugin.onIndexService. 2015-11-25 19:34:33 +01:00
Simon Willnauer 9c1f930b8c Prevent writing to closed channel if translog is already closed
We handle AlreadyClosedExceptions gracefully wherever IndexShard / Engine
is used. In some cases, instead of throwing the appropriate exception we
bubble up ChannelClosedException instead which causes shard failures etc.
Today, it seems like that this can only happen if the engine is closed without
acquireing the lock which means that the shard has failed already so the impact is really
just a confusing log message. Yet, this change enforces throwing the right exception
if the translog is already closed.

Closes #14866
2015-11-25 13:54:13 +01:00
Adrien Grand e2447c7ce0 Merge pull request #14981 from jpountz/fix/assert_version_sanity
Check that the declared versions match the backward indices.
2015-11-25 10:49:30 +01:00
Isabel Drost-Fromm 473b19400f Merge pull request #14827 from MaineC/bug-fix/10021-error-listeners
Adds exception objects to log messages.
2015-11-25 10:42:38 +01:00
Christoph Büscher e507ef807a Merge pull request #14933 from cbuescher/shapes-refactor-point
Make PointBuilder, CircleBuilder & EnvelopeBuilder implement Writable
2015-11-25 09:57:20 +01:00
Christoph Büscher 1f94448e92 Making EnvelopeBuilder writable and adding equals/hashCode 2015-11-25 08:43:25 +01:00
Adrien Grand 5fe3ce89e0 Check that the declared versions match the backward indices. 2015-11-24 20:40:02 +01:00
Clinton Gormley c512cc5248 Added bwc indices for 2.0.1 and 2.1.0 and versions 2.0.2-SNAPSHOT and 2.1.1-SNAPSHOT 2015-11-24 19:32:18 +01:00
Yannick Welsch ff9c33b6c8 Use ObjectParser to parse AllocationID 2015-11-24 12:13:54 +01:00
Britta Weber 556d80501c aggs: fix significant terms reduce for long terms
Significant terms were not reduced correctly if they were long terms.
Also, clean up the bwc test a little. Upgrades are not needed.

related to #13522
2015-11-24 11:04:48 +01:00
Adrien Grand 5f33fbdb75 Register field mappers at the node level.
This moves the registration of field mappers from the index level to the node
level and also ensures that mappers coming from plugins are treated no
differently from core mappers.
2015-11-24 08:59:37 +01:00
Jason Tedor b31f2850c0 Do not be lenient when parsing CIDRs
This commit fixes some leniency in the parsing of CIDRs. The leniency
that existed before includes not validating the octet values nor
validating the network mask; in some cases issues with these values were
silently ignored. Parsing is now done according to the guidelines in RFC
4632, page 6.

Closes #14862
2015-11-23 20:46:23 -05:00
Michael McCandless e13b0d4bde upgrade lucene to 5.4.0-snapshot-1715952 2015-11-23 17:13:49 -05:00
Jason Tedor dcfdc0dbf3 Remove leftover TODOs in o.e.c.r.RoutingTable 2015-11-23 12:57:06 -05:00
Yannick Welsch 3dcd35d1c8 Fix issue where shard state metadata is written while containing no allocation id
Such a write can happen when upgrading shard state metadata using the MultiDataPathUpgrader

Relates to #14831
2015-11-23 18:14:02 +01:00
Daniel Mitterdorfer b804a0c4a6 Improve stability of UpdateIT
With this commit, we reduce the amount of work
that UpdateIT does and add progress logging.

Closes #14877
2015-11-23 17:54:57 +01:00
Yannick Welsch fccad13029 Persist allocation ID with shard state metadata on nodes
Closes #14831
2015-11-23 17:35:33 +01:00
Isabel Drost-Fromm 37d7629146 Merge pull request #14249 from MaineC/enhancement/8964
Switch query parsers to use ParseField
2015-11-23 14:16:40 +01:00
Boaz Leskes c1264b926f Improve trace logging in TransportReplicationAction and error reporting at RecoveryWhileUnderLoadIT
Things that helped me traced down an issue.

Closes #14931
2015-11-23 13:52:32 +01:00
Boaz Leskes 4a6f3c7840 Make sure the remaining delay of unassigned shard is updated with every reroute
For example: if a node left the cluster and an async store fetch was triggered. In that time no shard is marked as delayed (and strictly speaking it's not yet delayed). This caused test for shard delays post node left to fail. see : http://build-us-00.elastic.co/job/es_core_master_windows-2012-r2/2074/testReport/

 To fix this, the delay update is now done by the Allocation Service, based of a fixed time stamp that is determined at the beginning of the reroute.

 Also, this commit fixes a bug where unassigned info instances were reused across shard routings, causing calculated delays to be leaked.

Closes #14890
2015-11-23 13:16:15 +01:00
Isabel Drost-Fromm 38e1ad5596 Switches from manual field parsing to ParseField
This switches query parsing from manual field parsing to using ParseField.

Also adds unit tests for each query that check original json can be parsed
into query builders.

Relates to #8964
2015-11-23 11:37:46 +01:00
Christoph Büscher e25f7042b9 Making CircleBuilder writable and adding equals/hashcode 2015-11-23 11:35:44 +01:00
Christoph Büscher 5ca9f3ff8f Geo: Make ShapeBuilders implement Writable
We recently refactored the queries to make them parsable on the
coordinating note and adding serialization and equals/hashCode
capability to them. So far ShapeBuilders nested inside queries
were still transported as a byte array that needs to be parsed
later on the shard receiving the query. To be able to also
serialize geo shapes this way, we also need to make all the
implementations of ShapeBuilder implement Writable.

This PR adds this to PointBuilder and also adds tests for
serialization, equality and hashCode.
2015-11-23 11:24:43 +01:00
Boaz Leskes 6e2e91cf2a Set an newly created IndexShard's ShardRouting before exposing it to operations
The work for #10708 requires tighter integration with the current shard routing of a shard. As such, we need to make sure it is set before the IndexService exposes the shard to external operations.

Closes #14918
2015-11-23 11:22:40 +01:00
Dominik Stadler 72cab4e9b6 Map log-level 'trace' to JDK-Level 'FINEST' to make it possible to actually enable the trace-log via JdkESLogger.setLevel() 2015-11-23 09:49:29 +01:00
Martijn van Groningen 48771f1a76 field stats: Added `min_value_as_string` and `max_value_as_string` response elements for all number based fields. The existing `min_value` and `max_value` will return the values as numbers instead.
Closes #14404
2015-11-23 08:48:28 +01:00
Martijn van Groningen 4b94b50eb1 field stats: Index constraints should remove indices in the response if the field to evaluate s empty
Index constraints should remove indices in the response if the field to evaluate if empty. Index constraints can't work with that and it is the same as if the field doesn't match.
2015-11-23 08:35:15 +01:00
Jason Tedor 5e2eb7d0de Clarify three possible outcomes in CacheTests#testCachePollution 2015-11-22 19:58:04 -05:00
Jason Tedor 14a635fe4b Use correct equality in CacheTests#testReplaceRecomputesSize.Value 2015-11-22 19:56:27 -05:00
Ryan Ernst b8e462b934 Build: Change project attachment into special extra-plugins dir
Currently we use the "gradle project attachment plugin" to support
building elasticsearch as part of another project. However, this plugin
has a number of issues, a large part of which is requiring consistent
use of the projectsPrefix.

This change removes projectsPrefix, and adds support for a special
extra-plugins directory in the root of elasticsearch. Any projects
checked out within this directory will be automatically added to
elasticsearch.
2015-11-22 08:44:33 -08:00
Robert Muir 5337686d8d Merge pull request #14914 from rmuir/lock_down_system_property_writes
Ban write access to system properties
2015-11-22 11:28:55 -05:00
Robert Muir 9e41d5a738 fix typo in comment 2015-11-21 23:13:05 -05:00
Robert Muir 30529c008d Ban write access to system properties
* Forbid System.setProperties & co in forbidden APIs.
* Ban property write access at runtime with security manager.

Plugins that need to modify system properties will need to request permission in their plugin-security.policy
2015-11-21 22:33:06 -05:00
Jason Tedor 5f5ffb7871 Remove unused imports from o.a.c.s.AbstractClient 2015-11-21 22:08:18 -05:00
Christoph Büscher be9dd035e2 Merge pull request #14887 from cbuescher/merge-base-shapebuilders
Merging BaseLineString and BasePolygonBuilder with subclass
2015-11-21 12:52:31 +01:00
Camilo Díaz Repka d683e10172 Return a better exception message when regexp query is used on a numeric field 2015-11-21 00:21:24 -03:00
Jason Tedor 22187113b6 Merge pull request #14909 from jasontedor/release-after-successful-acquire
Do not release unacquired semaphore
2015-11-20 18:20:22 -05:00
Jason Tedor d541be462b Do not release unacquired semaphore
This commit adds an acquired flag to BulkProcessor#execute that is set
only after successful acquisition of a permit on the semaphore
there. This flag is used to ensure that we do not release a permit on
the semaphore when we did not obtain a permit on the semaphore.

Closes #14908
2015-11-20 18:03:48 -05:00
Ryan Ernst 88ee2e23a6 Merge branch 'master' into javadocs 2015-11-20 12:20:59 -08:00
markharwood c3a50d7ca2 Search: shift SearchTimeoutTests into core tests minus the Groovy dependency and renamed with IT test suffix 2015-11-20 18:50:17 +00:00
markharwood 5a5f05a0e9 Aggregations: Shift significant terms score test back into core without the Groovy dependency 2015-11-20 18:32:04 +00:00