Commit Graph

3842 Commits

Author SHA1 Message Date
Simon Willnauer 49c74e0885 Rename successulOps to successfulOps in TransportSearchTypeAction 2014-04-07 22:15:09 +02:00
Simon Willnauer befa833385 Make sure successful operations are correct if second phase is fast
In TransportSearchTypeAction we  need to increment successful ops
first before we increment and compare the exit condition otherwise if we
are fast we could concurrently update totalOps but then preempt one
of the threads which can cause the successor to read a wrong value from
successfulOps if second phase is very fast ie. searchType == count etc.
This can cause wrong success stats in the search response.
2014-04-07 22:15:09 +02:00
Simon Willnauer f2181d5cbf [TEST] Be more verbose if ClusterStatsTests fails 2014-04-07 22:14:10 +02:00
Andrew Selden 033e46f8af Rename readPrimitive*Array()/writePrimitive*Array() methods
Make method names shorter and easier to read.

Closes #5711
2014-04-07 11:15:21 -07:00
Matt Weber e3187d5b9a Update LongHash to work like BytesRefHash.
- rename "key" to "get"
- update and add more tests

Closes #5693
2014-04-07 19:59:08 +02:00
Andrew Selden fb338ef753 Make writePrimitive*() and readPrimitive*() methods public.
These utility methods are useful for client code to read/write arrays of
primitive types.
2014-04-07 10:38:57 -07:00
Simon Willnauer f1a8aadb63 [TEST] null out static resources in base test classes 2014-04-07 18:17:25 +02:00
javanna 1ec4f8f04b [TEST] Replaced RestTestSuiteRunner with parametrized test that uses RandomizedRunner directly
ElasticsearchRestTests extends now ElasticsearchIntegrationTest and makes use of our ordinary test infrastructure, in particular all randomized aspects now come for free instead of having to maintain a separate (custom) tests runner

We previously parsed only the tests that needed to be run given the version of the cluster the tests are running against. This doesn't happen anymore as it didn't buy much and it would be harder to support as the tests get now parsed before the test cluster gets started. Thus all the tests are now parsed regardless of their skip sections, afterwards the ones that don't need to be run will be skipped through assume directives.

Fixed REST tests that rely on a specific number of shards as this change introduces also random number of shards and replicas (through randomIndexTemplate)

Closes #5654
2014-04-07 17:08:05 +02:00
Shay Banon 705c7e2469 Recycled bytes in http + rest layer refactoring phase 2
Refactor the rest layer handlers to simplify common code paths (like handling) failures, and introduce optional (enabled for netty) rest channel bytes recycling
2014-04-07 15:29:04 +02:00
uboness c9b0b04f55 Aggregation cleanup
- consolidated value source parsing under a single parser that is reused in all the value source aggs parsers
- consolidated include/exclude parsing under a single parser
- cleaned up value format handling, to have consistent behaviour across all values source aggs
2014-04-07 14:34:17 +02:00
Miltos Allamanis dc15dee323 Renamed ClusterBlocks variable named "block" to "blocks".
"blocks" has been used 9 times for variable names of type
ClusterBlocks but block has been used only this case. It
seems to be a typo.
2014-04-07 12:26:06 +02:00
Miltos Allamanis 40a1ac82ef Renamed XContentParser.Token named "t" to "token".
The name "token" was declared 191 times for XContentParser.Token
objects, while "t" was used only 6 times.
2014-04-07 12:26:06 +02:00
Shay Banon 37c07ef765 disable args tests that cause page/array leak
related to #5703
2014-04-07 11:25:18 +02:00
Shay Banon d64d0d6a97 Remove clear on mock page/array
since we use a shared cluster, calling clear on the mock array / page recycler can cause removing a valid on going reference, and then when its released, the release will fail because it can't be found.
There is no real reason to call clear, checking if pages/arrays have been released takes the snapshot behavior here into account.
This change also makes sure we don't use the mock classes in places where we don't really release.

Note, with this change DoubleTermsTests fails, since it causes failures when creating aggs in the pre process phase, causing obtained arrays not to be released. This needs to be fixed before pulling this change in.
2014-04-07 11:25:18 +02:00
Kevin Wang ecab74fe6c add lucene language model similarities (Dirichlet & JelinekMercer) 2014-04-07 10:48:03 +02:00
Adrien Grand 9df655adb2 Remove AtomicFieldData.isValuesOrdered.
This method is not used anymore.

Close #5688
2014-04-07 10:30:10 +02:00
Kevin Wang 866c520abb Add doc value for binary field.
Close #5669
2014-04-07 10:18:55 +02:00
Martijn van Groningen ade1d0ef57 Added global ordinals (unique incremental numbering for terms) to fielddata.
Added a terms aggregation implementations that work on global ordinals, which is also the default.

Closes #5672
2014-04-07 11:06:41 +07:00
Boaz Leskes 7b9df39800 [Test] Added better control over the number of documents indexed by BackgroundIndexer
Used the new controls to reduce indexing activity in RelocationTests and RecoveryWhileUnderLoadTests

Closes #5696
2014-04-06 20:49:27 +02:00
Shay Banon d26a956231 releasable bytes output + use in transport / translog
create a new releasable bytes output, that can be recycled, and use it in netty and the translog, 2 areas where the recycling will help nicely.
Note, opted for statically typed enforced releasble bytes output, to make sure people take the extra care to control when the bytes reference are released.
 Also, the mock page/array classes were fixed to not take into account potential recycling going during teardown, for example, on a shared cluster ping requests still happen, so recycling happen actively during teardown.
closes #5691
2014-04-06 20:23:21 +02:00
Simon Willnauer a5aafbb04c [TEST] Prevent RelocationTests from going crazy when relocations take time 2014-04-05 22:36:16 +02:00
Simon Willnauer 124d370b5f [TEST] cleanup secondary cluster properly in Tribe tests. 2014-04-05 22:18:38 +02:00
Lee Hinman 211f740100 Add `getAsRatio` to Settings class, allow DiskThresholdDecider to take percentages
Adds new RatioValue class that parses ratios between 0-100% expressed in
either floating-point (0.13) or percentage (51.12%) notation.

Closes #5690
2014-04-04 13:19:35 -06:00
Lee Hinman 3248359660 log full exception in InternalClusterInfoService unless it's a ClusterBlockException 2014-04-04 13:06:01 -06:00
Daniel Winterstein 08be94b455 Adding javadoc to UpdateRequestBuilder for a couple of details it took me a while to find. 2014-04-04 17:56:08 +02:00
Timo Rantalaiho 3ae02b0b60 Show stacktrace of startup exception
Whether or not the stacktrace is displayed is controlled by bootstrap
log level setting, so that bootstrap: DEBUG displays the stack trace on
output, like it does on log

Closes #5102
2014-04-04 17:15:41 +02:00
Simon Willnauer 4d6eb369a3 [TEST] Wait for nodes to join before asserting on cluster stats 2014-04-04 14:06:09 +02:00
Boaz Leskes 940954bfd1 [Test] added trace logging to refresh action to note which cluster version was used
Increase logging level for SearchWithRandomExceptionsTests.testRandomExceptions & MinDocCountTests to use the above and log cluster states on changes.
2014-04-04 13:17:28 +02:00
Kevin Wang f582212c68 `geo_point` doesn't allow null values
After upgrading to 1.1.0, sending null values to geo points produces the following error:

```
MapperParsingException[failed to parse]; nested: ElasticsearchParseException[geo_point expected];
```

Closes #5680.
Closes #5681.
2014-04-04 10:53:10 +02:00
Adrien Grand 8a09ec0e06 [TEST] Harden GeoShapeIntegrationTests. 2014-04-04 09:41:07 +02:00
Simon Willnauer df9346dc67 [TEST] build index up-front to prevent relocations 2014-04-03 19:31:22 +02:00
Simon Willnauer cd552e7413 Take stream position into account when calculating remaining length
Currently `PagedBytesReferenceStreamInput#read(byte[],int,int)` ignores
the current pos and that causes to read past EOF

Closes #5667
2014-04-03 17:44:41 +02:00
Adrien Grand 8f324d50b2 [TEST] Reduce number of documents/terms in aggregations' RandomTests.
This test initially had three purposes:
 - duels between equivalent aggregations on significant amounts of data,
 - make sure that array growth works (when the number of buckets grows larger
   than the initial number o buckets),
 - make sure that page recycling works correctly.

Because of the last point, it needed large numbers of docs/terms since page
recycling only kicks in on arrays of more than 16KB. However, since then, we
added a MockPageCacheRecycler to track allocation/release of BigArrays and make
sure that all arrays get released, so we can now lower these numbers of docs/
terms to just make sure that array growth is triggered.
2014-04-03 16:58:44 +02:00
Simon Willnauer 1fc664cc28 [TEST] Fix [Children|Parent]ConstantScoreQueryTests with nightly=true
Those tests use RandomIW which can flush after each document taking forever
to index the 20k docs it was indexing. This commit makes sure the IW is
sane and the number of docs is not too crazy.
2014-04-03 16:25:15 +02:00
Adrien Grand c78bb4472a [TEST] Make sure refresh is called by `indexRandom`, even if the list of documents to index is empty. 2014-04-03 15:57:54 +02:00
Martijn van Groningen 6f0904c7f1 sizeInBytes can be 0 2014-04-03 20:48:50 +07:00
Simon Willnauer 697432390d [TEST] Make BulkTests#testBulkProcessorFlush more robust 2014-04-03 13:32:41 +02:00
Simon Willnauer 7bc5ab45bc Cleanup IndicesFieldDataCache and IndexFieldDataCache
This commit adds several asserts and removes possible `null` values
from the `FieldDataCache` implementation.

Closes #5664
2014-04-03 12:50:51 +02:00
Martijn van Groningen f389c666c1 Moved the decision to load p/c fielddata eagerly to a better place.
Closes #5569
2014-04-03 14:45:07 +07:00
Alexander Reelsen f0ae43bbea Made template endpoint compatible with search endpoint
Before this the from/size parameters did not work.
Also updated the rest api spec definition file with all the query_string
parameters.

Fixes #5550
2014-04-03 00:01:30 +02:00
Alexander Reelsen e547e113e1 Geo context suggester: Require precision in mapping
The default precision was way too exact and could lead people to
think that geo context suggestions are not working. This patch now
requires you to set the precision in the mapping, as elasticsearch itself
can never tell exactly, what the required precision for the users
suggestions are.

Closes #5621
2014-04-02 23:51:14 +02:00
kul dc19e06e27 Add `flush` method for BulkProcessor class
There is no explicit method `flush/execute` in `BulkProcessor` class. This can be useful in certain scenarios.
Currently it requires to close and create a new BulkProcessor if one wants an immediate flush.

Closes #5575.
Closes #5570.
2014-04-02 19:16:29 +02:00
Britta Weber 0b449d3040 Document es.node.mode and add possible options to error message 2014-04-02 18:32:03 +02:00
Simon Willnauer e189b3e37b [TEST] Use NoMergePolicy rather than NoMergeScheduler in FreqTermsEnumTests 2014-04-02 14:58:45 +02:00
Adrien Grand 4ff3e1926b Remove ScriptDocValues.EMPTY.
Instead the default implementation is used, but on top of empty
(Bytes|Long|Double|GeoPoint)Values. This makes sure there is no
inconsistency between documents depending on whether other documents in the
segment have values or not.

Close #5646
2014-04-02 14:28:42 +02:00
Britta Weber ac5701968b Fix mapping creation on bulk request
When a bulk request triggers an index creation a mapping might not be
created. The reason is that when indexing documents in a bulk,
an indexing operation might fail due to a shard not yet being
started. The mapping service, however, might already
have the mapping but the mapping update is never issued to the master,
even on subsequent indexing of documents.

Instead, the mapping must be propagated to master even if the
indexing fails due to a shard not being started.

closes #5623
2014-04-02 13:53:44 +02:00
Shay Banon 63290a910e Freq Terms Enum
A frequency caching terms enum, that also allows to be configured with an optional filter. To be used by both significant terms and phrase suggester.
This change extracts the frequency caching into the same code, and allow in the future to add a filter to control/customize the background frequencies
Closes #5597
2014-04-02 11:16:00 +01:00
Boaz Leskes 285fa16f62 [Tests] Reduce the number of threads used by the BackgroundIndexer by default
It sometimes overloads the nodes.
2014-04-02 11:02:38 +02:00
Martijn van Groningen d57ef1e0d6 Removed incorrect comment 2014-04-02 12:14:35 +07:00
Martijn van Groningen b7451533c8 Added an indices level field data cache listener that always gets invoked and updates indices statistics and services about field data loading and unloading.
Moved the circuit breaker memory reducing logic to the IndicesFieldDataCacheListener, so it always reduces the memory used when field data gets unloaded,
this fixes a issue where the circuit breaker didn't get reduced when segments where no shardId could be resolved get cleared up.

Also made sure that exceptions in the percolator service are bubbled up properly.

Closes #5588
2014-04-02 11:55:45 +07:00
Simon Willnauer 42b20d601f Upgrade to Lucene 4.7.1
* Removed XTermsFilter fixed in LUCENE-5502
 * Switched back to automaton queries that caused failures due to LUCENE-5532
 * Fixed Highlight test that has different results due to LUCENE-5538
2014-04-01 23:50:55 +02:00
Simon Willnauer c88d32150f [TEST] use length-norm as the tie-breaker in BlendedTermQueryTest 2014-04-01 20:36:43 +02:00
Alexander Reelsen 8b8cd26a59 Geo: Allow to parse lat/lon as strings and coerce them
In order to be more failsafe parsing GeoPoints can support
lat/lon as strings and coerce them. Added support and test for this.
2014-04-01 19:09:33 +02:00
javanna f6bbc894cf [TEST] fixed typo in ReproduceInfoPrinter (s/nighly/nightly) 2014-04-01 18:43:14 +02:00
javanna 6ef45a9ae3 [TEST] Print out the `tests.cluster` sys prop if available to be able to reproduce failures when using the external cluster
Relates to #5630
2014-04-01 18:40:43 +02:00
Shay Banon be33c99835 [TEST] Add ability to start nodes in async mode in TestCluster
this will help speed up when starting multiple nodes in a test
closes #5644
2014-04-01 18:01:47 +02:00
javanna 806c4e87fb [TEST] Removed last occurences of cluster_seed, no longer used
Relates to #5233
2014-04-01 17:57:57 +02:00
Simon Willnauer 9c3b6a50a4 [TEST] Add ThreadLeaks protection to ElasticsearchPostingsFormatTest since we keep running clusters around in the JVM 2014-04-01 17:27:58 +02:00
Simon Willnauer 1f4de9cfb5 Enrich exception message if searcher can not be aquired
This commit also moves the log message after the ensureOpen() call
to only log an error if it's really an erro condition.
2014-04-01 17:13:23 +02:00
Simon Willnauer 2a5ffaafcb Throw EngineClosedException if engine is closed
Currently we throw misleading exception in acquireSearcher
if we try to acquire while we are failing the engine. We should
throw an EngineClosedException instead.

Relates to #5633
2014-04-01 17:00:42 +02:00
Simon Willnauer 257eddd8f0 [TEST] Expect all shards to fail if full refresh failed 2014-04-01 17:00:35 +02:00
Simon Willnauer 4da66c4f95 ignore index if it's not in the cluster state and it's in the drop indices set
Closes #5643
2014-04-01 16:02:43 +02:00
Simon Willnauer 98aecee531 [TEST] use assertAcked when creating indices 2014-04-01 16:02:30 +02:00
Robert Muir 24005b4011 add test for ElasticSearchPostingsFormat 2014-04-01 08:50:22 -04:00
Simon Willnauer 268f2c3b12 [TEST] Fix BulkTests#testThatInvalidIndexNamesShouldNotBreakCompleteBulkRequest - randomBoolean() doesn't always return true 2014-04-01 14:38:35 +02:00
Shay Banon c83c72b165 Fail the engine/shard when refresh failed
When refresh failed, it would fail due to a serious issue in the shard (mainly corrupted index). Fail the engine in that cause, which will cause the shard to fail. The reason why its not only on CorruptedIndex failed is that any type of failure seems to be relevant here to fail the shard
closes #5633
2014-04-01 14:32:20 +02:00
Simon Willnauer 71de2bc414 [BUILD] Allow to set tests memory via the commandline 2014-04-01 14:12:52 +02:00
Boaz Leskes 83a013320c Moved BackgroundIndexer to a top level class. Moved waitNumDocs to ElasticsearchIntegrationTestBase.
Update RelocationTests to use the above and unified testPrimaryRelocationWhileIndexing & testReplicaRelocationWhileIndexingRandom into a single randomized test.
2014-04-01 14:12:52 +02:00
Adrien Grand a6a12f97a2 [Test] allow tests to reuse a singel index across tests
This commit speeds up aggregations tests dramatically since they all
rely on the same index structure. Here we can safe a large amout of time
to not recreate the index for each small test.
2014-04-01 14:12:45 +02:00
Boaz Leskes 5bf8b79587 Add a BackgroundIndexer class to RecoveryWhileUnderLoadTests and use it.
Also change the document distribution a bit between the tests
2014-04-01 12:03:57 +02:00
Simon Willnauer e621458a39 [Test] Speedup UpdateTests#testConcurrentUpdateWithRetryOnConflict 2014-04-01 12:03:57 +02:00
Simon Willnauer 6898984307 [Test] Speeup FieldData tests and remove unnecessary @Repeat annotations 2014-04-01 12:03:57 +02:00
Simon Willnauer 6c3ec9e719 [Test] Run intensive suggest tests only if nightly=true 2014-04-01 12:03:57 +02:00
Simon Willnauer e3317f2c6b [Test] Speedup RecoveryWhileUnderLoadTests to run with less documents unless tests.nightly=true 2014-04-01 12:03:57 +02:00
Simon Willnauer e60ca8d8d7 [Test] Speed up RandomAllocationDeciderTests 2014-04-01 12:03:57 +02:00
Shay Banon 6e12584018 [TEST] delegate to the original transport 2014-04-01 11:52:18 +02:00
javanna 38dd501ab5 [TEST] added ExternalTestCluster that allows to run tests against an external cluster
All the ordinary test operations happen based on the ImmutableTestCluster base class and are executed via transport client. Will be used especially for the REST tests once migrated to the standard randomized runner.

Added new httpAddresses method to ImmutableTestCluster to be able to retrieve the http addresses to connect to for the REST tests. Both versions will look inside the cluster to figure out which nodes are available for http calls and their addresses.

The external cluster is used as global cluster if the tests.cluster system property is available. The property needs to contain a comma separated list of available elasticsearch nodes that will be used to connect to the cluster (e.g. localhost:9300,localhost:9301).

Only a subset of the integration tests can currently be run successfully against the external cluster, for more precision the ones that don't modify the cluster layout (don't require cluster() functionalities but rely only on immutableCluster()). Also at least two data nodes are required otherwise the ensureGreen calls cannot succeed.

Closes #5630
2014-04-01 11:45:35 +02:00
Chris Earle 70c089de0a Replaces usage of `StringBuffer` with `StringBuilder` and fixes stray
single quote in the same `PluginInfo#toString()` method.

Closes #5605
2014-04-01 10:40:07 +02:00
Adrien Grand a34378f852 Do not propagate errors from onResult to onFailure.
The way that SearchServiceTransportAction executes actions on a local node
today would propagate exceptions thrown in onResult to onFailure.

Close #5629
2014-04-01 10:02:29 +02:00
Boaz Leskes 350fd8e30b Added trace logging in TransportSearchTypeAction and a delayed verification of test failures in MinDocCountTests.testMinDocCountOnTerms 2014-03-31 23:23:46 +02:00
Shay Banon cc4cae3ba0 Mock Transport: Allow to simulate network failures
An infrastructure that allows to simulate different network topologies failures, including 2 basic ones in failure to send requests, and unresponsive nodes
closes #5631
2014-03-31 22:49:10 +02:00
Boaz Leskes 62b850f52d InternalEngine - back to set dirty=false just *before* a refresh is done
reverting: 5553c383bc
2014-03-31 20:57:58 +02:00
Simon Willnauer c7b1f9946f Discard new cluster state if the clustername doesn't match
Closes #5622
2014-03-31 20:23:49 +02:00
Simon Willnauer df7474b9fc Add cluster_name to cluster_state
Today the clusterstate is not asssociated with the cluster_name which is odd
since it's pretty much it's only valid identifier. Any node can send a cluster
state to another node today even if it's not the same cluster. These situations
can happen rarely during tests or even in the wild by accident.
2014-03-31 20:23:49 +02:00
javanna d570d588a8 [TEST] moved dataNodes method to ImmutableTestCluster base class, replaced cluster().dataNodes() calls with immutableCluster().dataNodes() 2014-03-31 19:09:53 +02:00
javanna bae3203e3b [TEST] replaced cluster().size() calls with immutableCluster().size 2014-03-31 19:07:30 +02:00
javanna 8aea3a2f7d [TEST] fixed TestCluster size() javadocs 2014-03-31 18:34:26 +02:00
javanna 015c21c395 [TEST] move SuggestSearchTests to make use of default number of replicas randomization (based on number of data nodes) 2014-03-31 18:34:25 +02:00
javanna aac1374c76 [TEST] replaced cluster().wipeIndices|wipeTemplates calls with immutableCluster().wipeIndices|wipeTemplates 2014-03-31 18:34:25 +02:00
uboness d6636fc50c Aggregations cleanup
- removed an abstraction layer that handles the values source (consolidated values source with field data source)
- better handling of value parser/formatter in range & histogram aggs
- the buckets key will now be shown by default in range agg
2014-03-31 18:06:48 +02:00
Simon Willnauer 2cd6772329 [TEST] Set minimum_master_nodes for new node as well to make sure all ndoes have the same settings 2014-03-31 18:01:03 +02:00
Boaz Leskes 5553c383bc InternalEngine - only set dirty=false after a refresh happened 2014-03-31 17:39:57 +02:00
Boaz Leskes 1aac41e0d1 InternalEngine - added an assert to verify refresh was performed by lucene 2014-03-31 17:28:38 +02:00
Shay Banon f19f729498 Cleanup Rest Response
simplify rest response class hierarchy, by using BytesReference for content, and handling JSONP internally in the respective channel that sends the response.
Also, handle the future case where bytes might be releasable, when we start to potentially recycle bytes output stream.
2014-03-31 17:24:02 +02:00
Alexander Reelsen 0ff30ade69 ContextSuggester: Adding couple of tests to catch more bugs
A bunch of minor fixes have been included here, especially due
to wrongly parsed mappings. Also using assertions resulted in an
NPE because they were disabled in the distribution.

Closes #5525
2014-03-31 16:16:21 +02:00
Shay Banon f424319f9a Fix visibility in buffered translog
- fix visiblity of last written position in translog
- while there, make sure to properly propagate the exception from sync()
2014-03-31 15:23:23 +02:00
javanna 2e26dc328e [TEST] introduced ImmutableTestCluster abstract base class for TestCluster
The new base class contains all the immutable methods for a cluster, which will be extended by the future ExternalCluster impl that relies on an external cluster and won't be adding nodes etc. but only sending requests to an existing cluster whose layout never changes

Closes #5620
2014-03-31 14:41:05 +02:00
Alexander Reelsen 056ad0a8d3 Bulk API: Ensure that specific failures do not affect whole request
Before a bulk request is executed, missing indices are being created by default.
If this fails, the whole request is failed.

This patch changes the behaviour to not fail the whole request, but rather all
requests using the index where the creation has failed.

Closes #4987
2014-03-31 14:11:28 +02:00
Boaz Leskes 3f37a0ff5c TransportMasterNodeOperationAction: tighter postAdded change check
If a node fails to forward a master node operation to the current master, it will schedule a retry using a listener for cluster state changes. Once the listener is in place (and future changes are guaranteed to be observed) it will double check nothing has change during the addition of the listener. This check has previously been change to use cluster state versions (see: #5499). This is however not reliable solution as master elections (which change the master) do not increment the cluster state version and thus could be missed. This commit changes the check to use reference equality making it stricter.

Closes #5548
2014-03-31 13:57:47 +02:00
Simon Willnauer 5007bf7aa0 [Test] remove timeout from deleteWarmer call with many shards that might just take a while 2014-03-31 13:53:38 +02:00