Commit Graph

3151 Commits

Author SHA1 Message Date
Simon Willnauer aaf7e55c5f Remove index.flush_on_close entirely
This undocumented setting was mainly used for testing and a safety net for
a new flushOnClose feature back in 1.x. We can now safely remove this setting.
The test usage now uses a mock plugin setting to achive the same.
2016-01-14 10:34:58 +01:00
Jason Tedor d5e20fb763 Merge pull request #15934 from jasontedor/freebsd-load-average
Add load averages to OS stats on FreeBSD

Closes #15917
2016-01-13 20:11:22 -05:00
Simon Willnauer 1ddfa42c2e Merge pull request #15966 from s1monw/randomize_mock_plugins
Randomize which MockPlugins are used for IT
2016-01-13 23:58:49 +01:00
Simon Willnauer 22834bce55 fix possible race in IndexServiceTests#testBaseAsyncTask and add mock plugin SearchWithRandomIOExceptionsIT 2016-01-13 23:39:25 +01:00
Simon Willnauer e849674f5c add required plugin to PrimaryAllocationIT 2016-01-13 23:11:35 +01:00
Simon Willnauer 8c10616df8 Merge pull request #15964 from s1monw/flush_on_close_final
Remove updatability of `index.flush_on_close`
2016-01-13 22:55:26 +01:00
Jason Tedor 4b47c38922 Fix typo in comment in o/e/c/c/Cache.java 2016-01-13 15:01:59 -05:00
Simon Willnauer 24b0f1f025 Remove updateability of `index.flush_on_close`
`index.flush_on_close` is a test setting and doesn't need to be updateable.

Relates to #15955
2016-01-13 20:39:07 +01:00
Simon Willnauer b333133183 Merge pull request #15955 from s1monw/move_settings_to_index_level
Move all dynamic settings and their config classes to the index level
2016-01-13 20:35:33 +01:00
Adrien Grand aa52ab365a Merge pull request #15958 from jpountz/fix/remove_dead_fielddata_code
Remove dead fielddata code.
2016-01-13 18:33:35 +01:00
Britta Weber 87f0edbf51 Merge pull request #15952 from brwe/fix-cicular-reference-exception
Avoid circular reference in exception
2016-01-13 16:28:04 +01:00
Britta Weber 0c08d796c5 assert before we set the suppressed 2016-01-13 16:27:26 +01:00
Britta Weber e0edb07cc6 disable testCreateAndDeleteIndexConcurrently, it is flaky and we have an issue for it 2016-01-13 16:21:58 +01:00
Adrien Grand 08d05b201e Remove dead fielddata code.
This became dead when we removed in-memory fielddata for numeric fields.
2016-01-13 16:09:50 +01:00
Martijn van Groningen a7a45cd941 test: ensure that no percolate request are executed when stopping a node 2016-01-13 15:45:28 +01:00
Nik Everett b7cb04cbf4 Merge pull request #15809 from nik9000/unraw
Remove some raw from ActionRequest subclasses
2016-01-13 09:43:57 -05:00
Nik Everett df44754605 Renames Self to Request in ActionRequests 2016-01-13 09:40:32 -05:00
Simon Willnauer 437d7c179a Move all dynamic settings and their config classes to the index level
Today we maintain a lot of settings on the shard level which are all index level settings.
In order to cut over to the new settings API where we register update listener we have to move
all of them on to the index level otherwise we need a way to un-register listeners which is error-prone
and requires additional handling when shards are closed. It's simpler and also more accurate to handle all of
them on the index level where we can trash the entire registry for update listener once the index goes out of scope.
2016-01-13 14:25:37 +01:00
Britta Weber 2c2264d8d0 Avoid circular reference in exception
Don't set the suppressed Exception in Translog.closeOnTragicEvent(Exception ex) if it is an
AlreadyClosedException. ACE is thrown by the TranslogWriter and as cause might
contain the Exception that we add the suppressed ACE to. We then end up with a
circular reference where Exception A has a suppressed Exception B that has as cause A.
This would cause a stackoverflow when we try to serialize it.
For a more detailed description see #15941

closes #15941
2016-01-13 13:56:04 +01:00
Simon Willnauer 4d152b1474 Merge branch 'master' into move_refresh_into_index_service 2016-01-13 11:52:24 +01:00
Simon Willnauer 91289b8560 Merge branch 'master' into move_refresh_into_index_service 2016-01-13 11:41:30 +01:00
Michael McCandless 148557a61c remove the settings_require_units setting (effectively hardwire it to true) 2016-01-13 04:46:18 -05:00
Simon Willnauer 2c978941f5 fix test to wipe lenient index first 2016-01-13 10:03:20 +01:00
Martijn van Groningen a2796b555f mappings: Search filter should wrap the types filters in a separate boolean as should clauses
So that a document must either match with one of the types and the non nested clause.

Closes #15757
2016-01-13 09:44:01 +01:00
Simon Willnauer 050afe9171 add yet another test 2016-01-12 21:17:14 +01:00
Simon Willnauer 5204440471 add more tests and apply feedback from @mikemccand 2016-01-12 21:09:26 +01:00
Michael McCandless ce32b959fd fix possible concurrency bug in IMC when indexing threads are faster in writing bytes than the status checker is in checking all shards 2016-01-12 14:40:47 -05:00
Christoph Büscher d7d3e5d441 Fixing javadoc problem 2016-01-12 20:07:20 +01:00
Christoph Büscher ab456f6174 Merge pull request #15551 from cbuescher/shapes-add-validation
Geo: Add validation of shapes to ShapeBuilders
2016-01-12 19:15:26 +01:00
Christoph Büscher b9af22ccdc Merge pull request #15379 from cbuescher/fix-geoDistanceQueryBuilderTest
Geo: Fix small error in distance normalization in test
2016-01-12 19:02:04 +01:00
Jason Tedor 2839e351af Add load averages to OS stats on FreeBSD
This commit adds load averages to the OS stats on FreeBSD. For these
stats to be available, linprocfs must be available and mounted at
/compat/linux/proc.
2016-01-12 12:08:29 -05:00
Simon Willnauer 59211927b6 Move RefreshTask into IndexService and use since task per index
`refresh_interval` is a per index setting but we interpret and maintain it per shard. This
change moves the refresh task outside of IndexShard to the IndexService where it logically belongs
and reuses scheduling infrastructure used for translog fsync (async commit).

This change will use the same task for all shards of an index while previously we used on thread/task
per shard to refresh. This will also prevent too many concurrent refreshes if there are many indices and
shards allocated on a single node.
2016-01-12 17:46:40 +01:00
Ali Beyad 7846e5ae99 Merge pull request #15904 from abeyad/fix_15822
Throw exception if content type could not be determined in Update API
2016-01-12 11:13:54 -05:00
Nik Everett da63c87c7f Merge pull request #15793 from nik9000/highlight_typename
Don't override originalQuery with request filters
2016-01-12 11:08:31 -05:00
Nik Everett d3a4a9f871 Don't override originalQuery with request filters
These filters leak into highlighting and probably other places and cause
things like the type name to be highlighted when using
requireFieldMatch=false. We could have special hacks to keep them out of
highlighting but it feals better to keep them out of any variable named
"originalQuery".

Closes #15689
2016-01-12 11:03:15 -05:00
Nik Everett 78dc1c32de Merge pull request #15899 from nik9000/xlint_serial
Ban Serializable
2016-01-12 10:04:50 -05:00
Nik Everett a8ceb37d07 Merge pull request #15913 from nik9000/deprecate_collect_payloads
Deprecate span_near's collect_payloads
2016-01-12 09:56:19 -05:00
Nik Everett db3447fb03 Properly deprecate the field 2016-01-12 09:55:52 -05:00
Nik Everett 5afcb4305e Merge pull request #15911 from nik9000/dismax_constructor
Stop using deprecated constructors for queries
2016-01-12 09:47:33 -05:00
Jason Tedor ed723fbe5a Merge pull request #15929 from jasontedor/capturing-transport-clear
Add convenience method for capturing and clearing requests

Closes #15897
2016-01-12 09:44:23 -05:00
Jason Tedor c19981c67b Add convenience method for capturing and clearing requests
This commit adds convenience methods to o.e.t.t.CapturingTransport
that enables capturing requests and clearing the captured requests
with a single method. This is to simplify a common pattern in tests of
capturing requests, and then clearing the captured requests.
2016-01-12 09:20:54 -05:00
Christoph Büscher ff2593e74a Rename PointCollectionBuilder to CoordinatesBuilder
Also renaming internal methods to reflect that they are dealing with
jts coordinates. Also renamed the list() to build() method for creating
the coordinates lists and adding constructors to PolygonBuilder that
take CoordinatesBuilders and implicitely call build() on them.
2016-01-12 13:30:35 +01:00
Michael McCandless b4a095d430 Merge pull request #14121 from mikemccand/fair_indexing_buffers
The indexing buffer on a node (default: 10% of the JVM heap) is now a "shared pool" across all shards on that node.  This way, shards doing intense indexing can use much more than other shards doing only light indexing, and only once the sum of all indexing buffers across all shards exceeds the node's indexing buffer will we ask shards to move recently indexed documents to segments on disk.
2016-01-12 04:59:10 -05:00
Jason Tedor d9fd6e2fe3 Merge pull request #15907 from jasontedor/load-average
Reintroduce five-minute and fifteen-minute load averages on Linux

Relates #12049, relates #14741
2016-01-11 23:43:40 -05:00
Jason Tedor 1de2081ed3 Reintroduce five-minute and fifteen-minute load averages on Linux
This commit reintroduces the five-minute and fifteen-minute load stats
on Linux, and changes the format of the load_average field back to an
array.
2016-01-11 23:42:47 -05:00
Nik Everett ae0bf1b32f Deprecate span_near's collect_payloads 2016-01-11 22:11:38 -05:00
Nik Everett 5ded9ac9eb Stop using deprecated constructors for queries
DisjunctionMaxQuery and BooleanQuery
2016-01-11 21:36:16 -05:00
Ali Beyad 42134cca4d Fixes an issue where, if the content type of the request body could not be
determined, the UpdateRequest would still try to parse the content instead
of throwing the standard ElasticsearchParseException.  This manifests when
passing illegal JSON in the request body that does not begin with a '{'.
By trying to parse the content from an unknown request body content type,
the UpdateRequest was throwing a null pointer exception.  This has been
fixed to throw an ElasticsearchParseException, to be consistent with the
behavior of all other requests in the face of undecipherable request
content types.

Closes #15822
2016-01-11 17:43:36 -05:00
Michael McCandless 07e8370322 feedback 2016-01-11 17:16:28 -05:00
Nik Everett 01ce49e94e Ban Serializable
1. Uses forbidden patterns to prevent things from referencing
java.io.Serializable or from mentioning serialVersionUID.
2. Uses -Xlint:-serial so we don't have to hear from javac that we aren't
declaring serialVersionUID on any classes that we make that happen to extend
Serializable.
3. Remove Serializable and serialVersionUID declarations.

I didn't use forbidden apis because it doesn't look like it has a way to ban
explicitly implementing Serializable. If you try to ban Serializable with
forbidden apis you end up banning all Exceptions and all Strings.

Closes #15847
2016-01-11 16:57:31 -05:00
Nik Everett dfe77879b9 Merge pull request #15850 from nik9000/more_deprecation
Handle some deprecation warnings
2016-01-11 14:23:48 -05:00
Christoph Büscher 57c579e7b7 Geo: Add validation of shapes to shape builders
So far the validation of geo shapes was only taking place in the
parse methods in ShapeBuilder. With the recent refactoring we no
longer can rely on shapes being parsed from json, so the same kind
of validation should take place when just using the java api.

A lot of validation concerns the number of points a shape needs to
have in order to be valid. Since this is not possible with current
builders where points can be added one by one, the builder constructors
are changed to require the mandatory parameters and validate those
already at construction time. To help with constructing longer lists
of points, a new utility PointsListBuilder is instroduces which can
produce list of coordinates accepted by most of the other shape builder
constructors.

Also adding tests for invalid shape exceptions to the already existing
shape builder tests.
2016-01-11 19:05:27 +01:00
Nik Everett d8af49eb91 Revert "Fix blended terms for non-strings"
This reverts commit 6bb01984b6.

It caused test failures.
2016-01-11 10:05:48 -05:00
Christoph Büscher bd1d935c26 Fix small error in distance normalization in test 2016-01-11 14:35:58 +01:00
Nik Everett c2259a2edd Merge pull request #15869 from nik9000/cross_fields_numeric
Fix blended terms for non-strings
2016-01-11 08:19:14 -05:00
Martijn van Groningen ace1b33c3c test: simplify percolator recovery test by only testing what is needed
Running requests via the percolate or mpercolate api is irrelevant.
What is relevant is that when nodes come back that they report the expected number of matches.
2016-01-11 13:38:50 +01:00
Simon Willnauer d32d16f117 Check lenient_expand_open after aliases have been resolved
We fail today with ClusterBlockExceptions if an alias expands to a closed index
during search since we miss to check the index option down the road after we expanded
aliases.

Closes #13278
2016-01-11 13:31:14 +01:00
Michael McCandless 5e7144f5c5 IMC is now just another IndexingOperationListener 2016-01-11 06:07:19 -05:00
Michael McCandless f3de7783d2 merge master 2016-01-11 05:36:16 -05:00
Michael McCandless db832cce06 improve logging messages a bit 2016-01-11 04:52:26 -05:00
Adrien Grand 77dbfbc988 Merge pull request #15864 from jpountz/fix/initial_sizing_of_BytesStreamOutput
Fix initial sizing of BytesStreamOutput.
2016-01-11 09:15:09 +01:00
Simon Willnauer 2f5e2c09c8 add @Override annotation 2016-01-10 21:09:26 +01:00
Simon Willnauer 91e8d156f5 Make IndexingMemoryController private to IndicesService
This commit detaches the IndexingMemoryController from guice and moves
it's creation and closing into IndicesService where it logically belongs.
2016-01-10 20:51:31 +01:00
Simon Willnauer 37f6b5ced7 Merge pull request #15875 from s1monw/cleanup_indexing_operation_listeners
Cleanup IndexingOperationListeners infrastructure
2016-01-10 20:22:42 +01:00
Simon Willnauer 80ef201514 Remove dead code and add missing @Override annotations 2016-01-10 20:04:25 +01:00
Jason Tedor abaf816d00 Remove and forbid use of IndexWriter#isLocked
This commit removes and now forbids use of
org.apache.lucene.index.IndexWriter#isLocked as this method was
deprecated in LUCENE-6508. The deprecation is due to the fact that
checking if a lock is held before acquiring that lock is subject to a
time-of-check-to-time-of-use race condition. There were three uses of
IndexWriter#isLocked in the code base:
 - a logging statement in o.e.i.e.InternalEngine where we are already in
   an exceptional condition that the lock was held; in this case,
   logging whether or not the directory is locked is superfluous
 - in o.e.c.l.u.VersionsTests where we were verifying that a write lock
   is released upon closing an IndexWriter; in this case, the check is
   not needed as successfully closing an IndexWriter releases its
   write lock
 - in o.e.t.s.MockFSDirectoryService where we were verifying that a
   directory is not write-locked before (implicitly) trying to obtain
   such a write lock in org.apache.lucene.index.CheckIndex#<init> (this
   is the exact type of a situation that is subject to a race
   condition); in this case we can proceed by just (implicitly) trying
   to obtain the write lock and failing if we encounter a
   LockObtainFailedException
2016-01-10 08:28:44 -05:00
Simon Willnauer 54d1e35d84 Cleanup IndexingOperationListeners infrastructure
This commit reduces the former ShardIndexinService to a simple stats/metrics
class, moves IndexingSlowLog to the IndexService level since it can be shared
across shards of an index and is now hidden behind IndexingOperationListener.

IndexingOperationListener is now a first class citizen in IndexShard and is passed
in from IndexService.
2016-01-09 21:50:17 +01:00
Jason Tedor 37880040a2 Remove unused imports from o/e/i/e/InternalEngine.java 2016-01-09 12:16:09 -05:00
Nik Everett 4772b1fe9d Remove tests for backwards compatibility we don't support any more 2016-01-08 17:25:26 -05:00
Nik Everett d8526f4d00 Handle some deprecation warnings
Suppress lots of them with comments. Fix a few. Removes lots of pre-built
stuff used to support pre-2.0 indexes.
2016-01-08 17:17:33 -05:00
Nik Everett 6bb01984b6 Fix blended terms for non-strings
It had some funky errors, like lenient:true not working and queries with
two integer fields blowing up if there was no analyzer defined on the
query. This throws a bunch more tests at it and rejiggers how non-strings
are handled so they don't wander off into scary QueryBuilder-land unless
they have a nice strong analyzer to protect them.

Closes #15860
2016-01-08 16:53:40 -05:00
Michael McCandless d3d41fc22b Merge pull request #15585 from mikemccand/max_indexing_thread_pool_size
Limit the max size of bulk and index thread pools to bounded number of processors
2016-01-08 14:36:21 -05:00
Adrien Grand 8568480a74 Fix initial sizing of BytesStreamOutput.
It currently tries to align to the page size (16KB) by default. However, this
might waste a significant memory (if many BytesStreamOutputs are allocated)
and is also useless given that BytesStreamOutput does not recycle (on the
contrary to ReleasableBytesStreamOutput). So the initial size has been changed
to 0.

Closes #15789
2016-01-08 20:08:31 +01:00
Jason Tedor 871d1b4885 Remove and forbid use of j.u.c.ThreadLocalRandom
This commit removes and now forbids all uses of
java.util.concurrent.ThreadLocalRandom across the codebase. The
underlying issue with ThreadLocalRandom is that it can not be
seeded. This means that if ThreadLocalRandom is used in production code,
then tests that cover any code path containing ThreadLocalRandom will be
prevented from being reproducible by use of ThreadLocalRandom. Instead,
using org.elasticsearch.common.random.Randomness#get will give
reproducible sources of random when running under tests and otherwise
still give an instance of ThreadLocalRandom when running as production
code.
2016-01-08 12:23:48 -05:00
Jason Tedor 21f5b0ff35 Remove dead o.e.c.m.UnboxedMathUtils
This commit removes the dead UnboxedMathUtils from the codebase.
2016-01-08 11:58:39 -05:00
Simon Willnauer 71796e2319 [TEST] Close failable translog in a controlled way otherwise assertions are off in the test 2016-01-08 13:10:09 +01:00
Adrien Grand 581fd49dac Merge pull request #15836 from jpountz/fix/bitset_cache_duplicates
BitSetFilterCache duplicates its content.
2016-01-08 09:59:28 +01:00
Igor Motov 8fbb3686cd Improve stability of the testBatchingShardUpdateTask test
On slow machines when this test randomly picks a large number of shards it can occasionally take more than 32.5 seconds to snapshot all shards. That is causing the test to miss the second to last assert in awaitsBusy at 32.5 seconds and then timeout in BlockingClusterStateListener at 60 seconds. Due to the timeout, the pending task queue is cleaned before the last awaitsBusy assert at 65 seconds and as a result the last assert runs on a completely empty queue and fails with a very confusing assert error.

This commit makes the timeout in BlockingClusterStateListener to occur after the last assert in assertBusyPendingTasks and therefore allows assertBusyPendingTasks to perform the last assert before cleaning the pending tasks queue takes place.

 This commit also reduces the maximum number of shards used in the test to 10 in order to speed up this test.
2016-01-07 19:33:50 -05:00
Adrien Grand 3ef9ec25f8 BitSetFilterCache duplicates its content.
We have a bug that makes all per-index bitset caches store bitsets for all
indices. In the case that you have many indices, which is fairly common with
time-based data, this could translate to a lot of wasted memory.

Closes #15820
2016-01-07 18:50:14 +01:00
Britta Weber f93b4cb215 sync translog to disk after recovery from primary
Otherwise if that node is shutdown and restarted it might will have lost all operations
that were in the translog.
2016-01-07 16:27:40 +01:00
Adrien Grand 8bd54dbf5a Merge pull request #15828 from jpountz/enhancement/stricter_metadata_parsing
Make MetaData parsing less lenient.
2016-01-07 15:20:51 +01:00
Adrien Grand 6ce7a972bc Make MetaData parsing less lenient.
Today this simply ignores everything that is not recognized.
2016-01-07 15:20:16 +01:00
Nik Everett 52f28888d5 Merge pull request #15813 from nik9000/xlint1
Remove Xlint:-override,-fallthrough,-static
2016-01-07 08:34:40 -05:00
Boaz Leskes d5e6eb58a8 Log uncaught exceptions from scheduled once tasks
`ScheduledThreadPoolExecutor` allows you to schedule tasks to run once or periodically at the future. If such a task throws an exception, that exception is caught and reported in the future that `ScheduledThreadPoolExecutor#schedule` returns. However, we typically do not capture the future / do not test it for errors. This results in exception being swallowed and not reported. To mitigate this we now wrap any command in a LoggingRunnable  (already used for periodic tasks).  Also, RunnableCommand is changed not to swallow exception but percolate them further for reporting by the future.

Closes #15824
2016-01-07 14:04:35 +01:00
Simon Willnauer e7f9d685f1 [TEST] Test that translog can recover after random IOException
This commit adds a new test that can throw an IOException at any point in time
and ensures that all previously synced documents can be successfully recovered after hitting
an excepiton.

Relates to #15788
2016-01-07 10:17:31 +01:00
Adrien Grand 67d233cecd Remove warmers and the warmer API.
Warmers are now barely useful and will be removed in 3.0. Note that this only
removes the warmer API and query-based warmers. We still have warmers internally
for eg. global ordinals.

Close #15607
2016-01-07 09:57:07 +01:00
Martijn van Groningen 604d59a95e muted test 2016-01-07 09:54:59 +01:00
Nik Everett 20e7fa97db Remove Xlint:-override,-fallthrough,-static
Adds `@SuppressWarnings("fallthrough")` in two places where the fallthrough
is used to implement well known hashing algorithms.
2016-01-06 22:27:14 -05:00
Nik Everett 74c132afc6 Standardize some methods on varargs
Right now we define the same sort of methods as taking String arrays and
string varargs. We should standardize on one and varargs is easier to
call so lets use varargs!
2016-01-06 21:01:58 -05:00
Jason Tedor a583edb2df Merge pull request #15801 from jasontedor/cyclic-barriers-for-boaz
Use CyclicBarriers for sychronizing driver and test threads
2016-01-06 20:09:28 -05:00
Jason Tedor c147fe5691 Do not lose CacheTest failure stack traces 2016-01-06 20:00:11 -05:00
Nik Everett 91464c7687 Remove some raw from ActionRequest subclasses
Renames "T" used in many subclasses of ActionRequest to "Self" and tightens
the type bounds.
2016-01-06 19:01:58 -05:00
Nik Everett d54f1a8f20 Merge pull request #15796 from nik9000/boundary_chars
Add test for boundary chars
2016-01-06 18:26:38 -05:00
Nik Everett 9935ae921e Version.LATEST instead of Lucene.VERSION
There was a TODO for it.
2016-01-06 17:36:10 -05:00
Jason Tedor 4c0f5bda47 Use CyclicBarriers for sychronizing driver and test threads
This commit modifies some tests to use CyclicBarriers to correctly and
simply sychronize driver and test threads.
2016-01-06 15:07:05 -05:00
Jason Tedor 22abf14812 Visible failures in cluster state update task execution ordering test 2016-01-06 14:43:24 -05:00
Jason Tedor 557b11cc2b Sychronize threads in cluster state update task execution ordering test
This commit uses a CyclicBarrier to correctly and simply sychronize the
driver and test threads in
ClusterServiceIT#testClusterStateUpdateTasksAreExecutedInOrder.
2016-01-06 14:41:43 -05:00
Jason Tedor d1b4cf6778 Further simplify cluster state update task execution ordering test 2016-01-06 14:41:42 -05:00
Jason Tedor 18b42ce798 Simplify cluster state task execution ordering test 2016-01-06 14:41:42 -05:00
Jason Tedor 270b08b302 Add test that cluster state update tasks are executed in order
This commit adds a test that ensures that cluster state update tasks
are executed in order from the perspective of a single thread.
2016-01-06 14:41:38 -05:00