3092 Commits

Author SHA1 Message Date
javanna
0769636ea2 add some nodes with ingest set to false to test redirect 2016-01-12 15:49:15 +01:00
javanna
1dc5a6f3cf move assert that proxy filter should be installed on non ingest nodes only 2016-01-12 15:48:28 +01:00
javanna
da0f934c52 add randomness init for random node generator 2016-01-12 15:17:50 +01:00
javanna
7dac1b31c3 extract IngestNodeMatcher to its own private class 2016-01-12 15:15:56 +01:00
javanna
d67106af4e added specific tests for isIngestEnabled methods 2016-01-12 14:51:05 +01:00
javanna
b111c7bbd5 redirect ingest requests to an ingest node
Rather than failing the request, when a node with node.ingest set to false receives an index or bulk request with a pipeline id, it should try to redirect the request to another node with node.ingest set to true. If there are no node with ingest set to true based on the current cluster state, an exception will be returned and the request will fail. Note that in case there are no ingest nodes and bulk has a pipeline id  specified only for a subset of index requests, the whole bulk will fail.
2016-01-12 12:31:11 +01:00
Martijn van Groningen
7bdd2583aa Merge remote-tracking branch 'es/master' into feature/ingest 2016-01-12 01:01:30 +01:00
Nik Everett
dfe77879b9 Merge pull request #15850 from nik9000/more_deprecation
Handle some deprecation warnings
2016-01-11 14:23:48 -05:00
Tal Levy
cc07e5b9e0 throw exception when invalid locale is provided to the date processor 2016-01-11 10:35:22 -08:00
javanna
b4baa6c7ab remove use of already processed header in favour of resetting the pipeline id to null 2016-01-11 18:11:16 +01:00
javanna
362deb4579 [TEST] move testBulkRequestModifier to existing BulkRequestModifierTests class 2016-01-11 18:11:16 +01:00
javanna
fad2571ba5 add test for bulk without any request holiding a pipeline id 2016-01-11 18:11:16 +01:00
javanna
21c89e6c5b make sure we don't go ahead if no index request holds a pipeline id 2016-01-11 18:11:16 +01:00
javanna
bac1206161 remove use of request headers/context for pipeline id in favour of instance members added to IndexRequest and BulkRequest
Now that the ingest infra is part of es core we can remove some code that was required by the plugin and have a better integration with es core. We allow to specify the pipeline id in bulk and index as a request parameter, we have a REST filter that parses it and adds it to the relevant action request. That is not required anymore, as we can add this logic to RestIndexAction and RestBulkAction directly, no need for a filter. Also, we can allow to specify a pipeline id for each index requests in a bulk request. The small downside of this is that the ingest filter has to go over each item of a bulk request, all the time, to figure out whether they have a pipeline id.
2016-01-11 18:11:15 +01:00
Nik Everett
d8af49eb91 Revert "Fix blended terms for non-strings"
This reverts commit 6bb01984b6cceab38d50dcb92ba8da5c6a5f28ab.

It caused test failures.
2016-01-11 10:05:48 -05: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
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
javanna
3e08c24991 clarify comment in TemplateService, explain why we have this class 2016-01-08 14:31:57 +01: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
Martijn van Groningen
b9dd99636d dynamic option is a string, not a boolean 2016-01-08 11:36:52 +01:00
javanna
8675784e3f adapt error message when node.ingest is set to false and we fail executing a pipeline 2016-01-08 10:39:39 +01:00
javanna
ae69d46f92 move processors that have no deps to core, also move to core rest spec and tests and set node.inget to true by default 2016-01-08 10:39:39 +01:00
Martijn van Groningen
e35e9bd736 Removed index template and instead create .ingest with settings and mapping when we find out that the index is missing during the put pipeline call. 2016-01-08 10:35:52 +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
javanna
79c1377661 [TEST] set node.ingest to true otherwise we may try to modify values for a threadpool that hasn't been started 2016-01-07 16:16:14 +01:00
javanna
03fe38681e renamed qa package o.e.plugin.ingest to o.e.ingest
This way InternalTemplateService constructor can be set back to package private visibility
2016-01-07 15:51:52 +01:00
javanna
694eeffe92 catch the right exception... 2016-01-07 15:36:34 +01:00
Martijn van Groningen
0d70d92aa0 Also ignore rejected execution exception when installing index template 2016-01-07 15:25:35 +01:00
Martijn van Groningen
c44b83dc29 Also ignore rejected execution exception when retying restart 2016-01-07 15:21:21 +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