Commit Graph

4053 Commits

Author SHA1 Message Date
Alex Ksikes d339ee4005 Term Vectors: terms filtering
This adds a new feature to the Term Vectors API which allows for filtering of
terms based on their tf-idf scores. With `dfs` option on, this could be useful
for finding out a good characteric vector of a document or a set of documents.
The parameters are similar to the ones used in the MLT Query.

Closes #9561
2015-04-14 19:11:09 +02:00
Adrien Grand 22720a1abd Merge pull request #10562 from jpountz/upgrade/lucene-5.2.0-snapshot-1673124
Upgrade to lucene-5.2.0-snapshot-1673124.
2015-04-14 16:57:09 +02:00
Christoph Büscher c169e792b5 Remove unused normsField from MatchAllQuery 2015-04-14 12:39:05 +02:00
Michael McCandless 68f93e53a8 Include spins and file system type in "fs" nodes stats
Also log a one-line summary at default INFO level logging of the
spins, type for all paths in the node's path.data.

Closes #10527
2015-04-14 04:58:35 -04:00
Simon Willnauer 0fcd31b6dc [CORE] Move back to single EngineConfig
We need to preserve settings (yet transient) even though the engine is not yet
started. This commit moves back to a single EngineConfig to simplify IndexShard
and settings state.

Closes #10584
2015-04-14 10:43:23 +02:00
Simon Willnauer b756477fb4 [CORE] Rename START phase into VERIFY_INDEX
we really only optionally run checkindex in this phase and moving
the engine start into translog is move cleaner code wise.

Closes #10570
2015-04-14 09:53:02 +02:00
Simon Willnauer fe411a9295 [BUILD] Restrict read permission to project.basedir/target if security manager is used 2015-04-14 09:35:40 +02:00
Boaz Leskes 773d64c4f2 Test: mute testIndexBufferSizeUpdateAfterCreationRemoval
see #10584
2015-04-14 08:36:29 +02:00
Jun Ohtani deeea217e1 Analysis: fix ignoring tokenizer settings in SynonymTokenFilterFactory
add test for synonym with tokenizer settings
2015-04-14 08:37:04 +09:00
Shay Banon 41343eca95 Improve exception handling in transport local execution
Local execution of transport messages failures can create a more detailed remote transport exceptions. Also, when failing to handle an exception, the error should be logged, and not call the handler again with another exception
closes #10554
2015-04-13 15:45:55 -07:00
Shay Banon e2a05bb43f Cleanup JVM info and stats
Remove reflection since its not needed with Java 7, remove lastGcInfo since its not used, and move to only provide getters
closes #10553
2015-04-13 15:24:14 -07:00
Alex Ksikes c347dfe91c Validate API: support for verbose explanation of succesfully validated queries
This commit adds a `rewrite` parameter to the validate API in order to shown
how the given query is re-written into primitive queries. For example, an MLT
query is re-written into a disjunction of the selected terms. Other use cases
include `fuzzy`, `common_terms`, or `match` query especially with a
`cutoff_frequency` parameter. Note that the explanation is only given for a
single randomly chosen shard only, so the output may vary from one shard to
another.

Relates #1412
Closes #10147
2015-04-13 19:17:58 +02:00
Simon Willnauer c13e604697 [BUILD] Restrict read permission to project.basedir
This prevents reads from anywhere outside of the elasticsearch
clone when running tests with security manager enabled.
2015-04-13 16:44:31 +02:00
Simon Willnauer b1c9dfc2e8 [RECOVERY] Integrate translog recovery into Engine / InternalEngine
Today the engine writes the transaction log itself as well as manages
all the commit / translog mapping internally. Yet, if an engine is closed
and reopend it doesn't replay it's translog or does anything to be consistent
with it's latest state again.
This change moves the transaction log replay code into the Engine / InternalEngine
and adds unittests for replaying and consistency.

Closes #10452
2015-04-13 16:42:45 +02:00
Colin Goodheart-Smithe 306d94adb9 Revert "Added normalisation to Derivative Reducer"
This reverts commit 48a94a41df.
2015-04-13 14:24:23 +01:00
Boaz Leskes 8e302f1172 Recovery: allow to recover into a folder containing a corrupted shard
At the moment, we are very strict when handling data folders containing corrupted shards and will fail any recovery attempt into it. Typically this wouldn't be a problem as the shard will be assigned to another node (which we try first anyway when a shard fails). However, it has been proven to be too strict for smaller clusters which may not have an extra node available (either because of allocation filtering, disk space issues etc.). This commit changes the behavior to force a full recovery. Once all the new files are verified we remove the old corrupted data and start the shard.

This also fixes a small issue where the shard state file wasn't deleted on an engine failure (we had a protection against deleting the state file on an active shard, but in this case the shard is still active but will be removed). The state deletion is also moved to before the failure handlers are called, to avoid race conditions when calling the master (it will potentially try to read it when allocating the shard)

Closes #10558
2015-04-13 15:07:14 +02:00
Colin Goodheart-Smithe 48a94a41df Added normalisation to Derivative Reducer
This changes adds the ability to specify the units for the x-axis for derivative values and calculate the derivative based on those units rather than the original histograms x-axis units
2015-04-13 11:44:29 +01:00
Colin Goodheart-Smithe 7d38989cdb Merge branch 'master' into feature/aggs_2_0 2015-04-13 09:53:49 +01:00
Adrien Grand 45afa47a6f Upgrade to lucene-5.2.0-snapshot-1673124. 2015-04-13 10:43:58 +02:00
Britta Weber 4934def035 [TEST] better test start and end messages
print when cleaning up also for SingleNodeTests
distinguish between after suite and after test cleanup
2015-04-11 15:02:40 +02:00
Nicholas Knize 90e1775a2b [GEO] Correct ShapeBuilder coordinate parser to ignore values in 3rd+ dimension
ShapeBuilder's coordinate parser expected 2 double values for every coordinate array. If > 2 doubles were provided the parser terminated parsing of the coordinate array. This resulted in an invalid Shape state leaving LineStrings, LinearRings, and Polygons with a single coordinate. An incorrect parse exception was thrown. This corrects the parser to ignore those values in the 3rd+ dimension, correctly parsing the rest of the coordinate array.

Unit tests have been updated to verify the fix.

closes #10510
2015-04-10 15:33:21 -05:00
Nicholas Knize 754856289e [GEO] Add merge conflicts to GeoShapeFieldMapper
Prevents the user from changing strategies, tree, tree_level or precision. distance_error_pct changes are allowed as they do not compromise the integrity of the index. A separate issue is open for allowing users to change tree_level or precision.
2015-04-10 14:33:17 -05:00
Nicholas Knize a8a35d7c29 [GEO] Fix hole intersection at tangential coordinate
OGC SFA 2.1.10 assertion 3 allows interior boundaries to touch exterior boundaries provided they intersect at a single point. Issue #9511 provides an example where a valid shape is incorrectly interpreted as invalid (a false violation of assertion 3).  When the intersecting point appears as the first and last coordinate of the interior boundary in a polygon, the ShapeBuilder incorrectly counted this as multiple intersecting vertices. The fix required a little more than just a logic check. Passing the duplicate vertices resulted in a connected component in the edge graph causing an invalid self crossing polygon. This required additional logic to the edge assignment in order to correctly segment the connected components. Finally, an additional hole validation has been added along with proper unit tests for testing valid and invalid conditions (including dateline crossing polys).

closes #9511
2015-04-10 11:44:40 -05:00
Adrien Grand 5b3cc2f07c Search: deprecate the limit filter.
This is really a Collector instead of a filter. This commit deprecates the
`limit` filter, makes it a no-op and recommends to use the `terminate_after`
parameter instead that we introduced in the meantime.
2015-04-10 17:18:50 +02:00
Adrien Grand 919589b908 Queries: Remove fuzzy-like-this support.
The fuzzy-like-this query builds very expensive queries and only serves esoteric
use-cases.
2015-04-10 17:16:02 +02:00
Ryan Ernst 224c43564b Tests: Add multi data path testing to static bwc tests
This randomly chooses to run bwc indexes on single or multi data paths.

closes #10519
2015-04-09 14:31:31 -07:00
Ryan Ernst 9d0764e5df Tests: increasing timeout for replicas in static bwc tests, to account
for reallySlowJenkinsWhenIndexHasLotsOfSegments
2015-04-09 13:31:08 -07:00
Michael McCandless 54b702db07 Tests: don't fsync so often
Most tests don't "really" need to fsync, and this is costly (makes
tests slower, wears out our SSDs).

This change makes it uncommon to actually fsync when Lucene asks for
it.  It's just a workaround (in MockDirectoryHelper) until we can
cutover Elasticseach to use MockFileSystem like Lucene.

Closes #10516
2015-04-09 14:31:42 -04:00
Simon Willnauer d470bdbff6 Only flush for checkindex if we have uncommitted changes
Today we force a flush before check index to ensure we have an index
to check on. Yet if the index is large and the FS is slow this can have
significant impact on the index deletion performance. This commit introduces
a check if there are any uncommitted changes in order to skip the additional commit.

Closes #10505
2015-04-09 18:25:57 +02:00
javanna 5367e04fbc [TEST] add 1.5.1 index for bw comp tests 2015-04-09 17:03:35 +02:00
Colin Goodheart-Smithe 56a37620ed Merge branch 'master' into feature/aggs_2_0
Conflicts:
	src/main/java/org/elasticsearch/percolator/PercolatorService.java
	src/main/java/org/elasticsearch/search/aggregations/AggregationPhase.java
	src/main/java/org/elasticsearch/search/aggregations/InternalAggregation.java
	src/main/java/org/elasticsearch/search/aggregations/InternalAggregations.java
	src/main/java/org/elasticsearch/search/aggregations/bucket/InternalSingleBucketAggregation.java
	src/main/java/org/elasticsearch/search/aggregations/bucket/filters/InternalFilters.java
	src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/InternalGeoHashGrid.java
	src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/InternalHistogram.java
	src/main/java/org/elasticsearch/search/aggregations/bucket/range/InternalRange.java
	src/main/java/org/elasticsearch/search/aggregations/bucket/significant/GlobalOrdinalsSignificantTermsAggregator.java
	src/main/java/org/elasticsearch/search/aggregations/bucket/significant/InternalSignificantTerms.java
	src/main/java/org/elasticsearch/search/aggregations/bucket/significant/SignificantStringTermsAggregator.java
	src/main/java/org/elasticsearch/search/aggregations/bucket/significant/SignificantTermsAggregatorFactory.java
	src/main/java/org/elasticsearch/search/aggregations/bucket/significant/UnmappedSignificantTerms.java
	src/main/java/org/elasticsearch/search/aggregations/bucket/terms/GlobalOrdinalsStringTermsAggregator.java
	src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalTerms.java
	src/main/java/org/elasticsearch/search/aggregations/bucket/terms/StringTermsAggregator.java
	src/main/java/org/elasticsearch/search/aggregations/bucket/terms/TermsAggregatorFactory.java
	src/main/java/org/elasticsearch/search/aggregations/bucket/terms/UnmappedTerms.java
	src/main/java/org/elasticsearch/search/aggregations/metrics/avg/InternalAvg.java
	src/main/java/org/elasticsearch/search/aggregations/metrics/cardinality/InternalCardinality.java
	src/main/java/org/elasticsearch/search/aggregations/metrics/geobounds/InternalGeoBounds.java
	src/main/java/org/elasticsearch/search/aggregations/metrics/max/InternalMax.java
	src/main/java/org/elasticsearch/search/aggregations/metrics/min/InternalMin.java
	src/main/java/org/elasticsearch/search/aggregations/metrics/percentiles/AbstractInternalPercentiles.java
	src/main/java/org/elasticsearch/search/aggregations/metrics/scripted/InternalScriptedMetric.java
	src/main/java/org/elasticsearch/search/aggregations/metrics/stats/InternalStats.java
	src/main/java/org/elasticsearch/search/aggregations/metrics/stats/extended/InternalExtendedStats.java
	src/main/java/org/elasticsearch/search/aggregations/metrics/sum/InternalSum.java
	src/main/java/org/elasticsearch/search/aggregations/metrics/tophits/InternalTopHits.java
	src/main/java/org/elasticsearch/search/aggregations/metrics/valuecount/InternalValueCount.java
2015-04-09 15:33:34 +01:00
Simon Willnauer 3b41299273 Add missing hashCode method to RecoveryState#File 2015-04-09 15:07:28 +02:00
Colin Goodheart-Smithe e19d20b407 max bucket reducer and sibling reducer framework 2015-04-09 12:16:35 +01:00
Adrien Grand fae124103a Merge pull request #10420 from jpountz/feature/numeric_resolution
Mappings: Bring back numeric_resolution.

Close #10420
2015-04-09 12:28:33 +02:00
Adrien Grand aecd9ac515 Aggregations: Speed up include/exclude in terms aggregations with regexps.
Today we check every regular expression eagerly against every possible term.
This can be very slow if you have lots of unique terms, and even the bottleneck
if your query is selective.

This commit switches to Lucene regular expressions instead of Java (not exactly
the same syntax yet most existing regular expressions should keep working) and
uses the same logic as RegExpQuery to intersect the regular expression with the
terms dictionary. I wrote a quick benchmark (in the PR) to make sure it made
things faster and the same request that took 750ms on master now takes 74ms with
this change.

Close #7526
2015-04-09 12:12:56 +02:00
Adrien Grand 6b16b32174 Aggregations: Fix multi-level breadth-first aggregations.
The refactoring in #9544 introduced a regression that broke multi-level
aggregations using breadth-first. This was due to sub-aggregators creating
deferred collectors before their parent aggregator and then the parent
aggregator trying to collect sub aggregators directly instead of going through
the deferred wrapper.

This commit fixes the issue but we should try to simplify all the pre/post
collection logic that we have.

Also `breadth_first` is now automatically ignored if the sub aggregators need
scores (just like we ignore `execution_mode` when the value does not make sense
like using ordinals on a script).

Close #9823
2015-04-09 12:06:08 +02:00
Simon Willnauer 17c06f06ba [TEST] issue additional flush 2015-04-09 11:56:36 +02:00
Simon Willnauer 953ae63d2b [TEST] beast slow index to fail with trace logging 2015-04-09 10:47:00 +02:00
Ryan Ernst c821b8d3b4 Tests: remove static bwc delete index timeout, so that the slow delete
failure can repro with additional logging
2015-04-08 23:29:37 -07:00
Simon Willnauer b52d24a031 [TEST] increase logging for pulling snapshot from InternalEngine 2015-04-09 06:41:11 +02:00
Ryan Ernst b343d688c5 Tests: Increase delete timeout for static bwc tests to 1 minute 2015-04-08 21:24:36 -07:00
Ryan Ernst ab395c1267 Tests: allow up to 30s to delete indexes in old static tests
When deleting an index, the tests run checkindex, which requires a
flush.  This can be very slow on virtualized hardware..
2015-04-08 13:57:22 -07:00
Ryan Ernst 178f650552 Tests: Fix static bwc replicas at 1 2015-04-08 09:02:44 -07:00
Ryan Ernst 6df978e76e Test: increasing replicas timeout to avoid slowness on virtualized
hardware (aka jenkins)
2015-04-08 08:44:39 -07:00
Zachary Tong a824184bf2 Aggregations: Add MovAvg Reducer
Allows the user to calculate a Moving Average over a histogram  of buckets.  Provides four different
moving averages:
 - Simple
 - Linear weighted
 - Single Exponentially weighted (aka EWMA)
 - Double Exponentially weighted (aka Holt-winters)

Closes #10024
2015-04-08 10:20:46 -04:00
Boaz Leskes 174d141512 Test: increase recovery concurrency in OldIndexBackwardsCompatibilityTests.testOldIndices
Also added some logging to help pin point slowness
2015-04-08 15:44:45 +02:00
Colin Goodheart-Smithe caeb85ef19 Merge branch 'master' into feature/aggs_2_0 2015-04-08 14:15:50 +01:00
javanna 7bd7ea8f13 Scripting: allow plugins to define custom operations that they use scripts for
Plugins can now define multiple operations/contexts that they use scripts for. Fine-grained settings can then be used to enable/disable scripts based on each single registered context.

Also added a new generic category called `plugin`, which will be used as a default when the context is not specified. This allows us to restore backwards compatibility for plugins on `ScriptService` by restoring the old methods that don't require the script context and making them internally use the `plugin` context, as they can only be called from plugins.

Closes #10347
Closes #10419
2015-04-08 11:57:00 +02:00
Adrien Grand 85e4c21b0a Tests: Disable the query cache for parent/child unit tests. 2015-04-08 09:58:59 +02:00
Adrien Grand 717dbb0599 Tests: Fix bug in SimpleSortTests.
This tests adds a mappings with {"fielddata": {"format": "doc_values"}} but the
default mapping has {"doc_values": false} so when the document mapper parsing
logic merges both we have {"doc_values": false,"fielddata": {"format": "doc_values"}}
and {"doc_values": false} wins, so the test is not using doc values while it
thought it would.
2015-04-08 09:45:50 +02:00
Boaz Leskes 80e86e5719 Transport: shortcut local execution
In several places in the code we need to notify a node it needs to do something (typically the master). When that node is the local node, we have an optimization in serveral places that runs the execution code immediately instead of sending the request through the wire to itself. This is a shame as we need to implement the same pattern again and again. On top of that we may forget (see note bellow) to do so and we might have to write some craft if the code need to run under another thread pool.

This commit folds the optimization in the TrasnportService, shortcutting wire serliazition if the target node is local.

Note: this was discovered by #10247 which tries to import a dangling index quickly after the cluster forms. When sending an import dangling request to master, the code didn't take into account that fact that the local node may master. If this happens quickly enough, one would get a NodeNotConnected exception causing the dangling indices not to be imported. This will succeed after 10s where InternalClusterService.ReconnectToNodes runs and actively connects the local node to itself (which is not needed), potentially after another cluster state update.

Closes #10350
2015-04-08 09:10:47 +02:00
Adrien Grand 89b97c1c8d Upgrade to lucene-5.1.0-snapshot-1671894.
This includes a fix for LUCENE-6406.
2015-04-07 20:04:54 +02:00
Adrien Grand 967a4e2a86 Internal: Make APIs work per-segment like Lucene's Collector.
We still have a lot of APIs that use setNextReader in order to change the
current segment that should be considered. This commit moves such APIs to
getLeafXXX() instead to be more in-line with Lucene 5's collector API.

I also renamed setDocId to setDocument to be more in-line with the doc values
APIs.

Close #10389
2015-04-07 17:56:01 +02:00
Shay Banon af19ec3006 Remove content thread safe from REST layer
there is no need for this anymore, for some time, since in netty now we rely on copying over the buffer and reusing it
closes #10429
2015-04-07 18:11:48 +03:00
Adrien Grand ca6f6d4283 Tests: work-around for LUCENE-6406. 2015-04-07 16:57:20 +02:00
Simon Willnauer c2f9987a15 [TEST] expect simpletext CFS format in test 2015-04-07 15:36:45 +02:00
Adrien Grand 37f3351b58 Tests: Speed up CopyOnWriteHash(Map|Set)Tests
These tests create artificial hash collisions in order to make sure that they
can be resolved correctly. But this also makes the tests very slow if there
are too many collisions because insertions/deletions become linear in such
cases. The tests have been modified to not do too many iterations when
collisions are likely.

Close #10442
2015-04-07 13:34:08 +02:00
Robert Muir 1d56502e52 Upgrade to Lucene 5.1 r1671277.
Closes #10435.

Squashed commit of the following:

commit aa1935c790b2731fc2bbc7de6142b09e3fe8bd4a
Author: Ryan Ernst <ryan@iernst.net>
Date:   Mon Apr 6 13:44:40 2015 -0700

    fix index lookup

commit bb6373595ff62ffc56fdf0cba3ac9c0ebe679946
Merge: 916962b eb3a170
Author: Robert Muir <rmuir@apache.org>
Date:   Mon Apr 6 14:24:38 2015 -0400

    Merge branch 'lucene_r1671277' of github.com:elasticsearch/elasticsearch into lucene_r1671277

commit 916962b82d192a53add471b4cc4a1396bc30eb0e
Merge: 197b3a2 21f72fe
Author: Robert Muir <rmuir@apache.org>
Date:   Mon Apr 6 07:09:41 2015 -0400

    Merge branch 'master' into lucene_r1671277

commit eb3a1703f7932ddd0cf3e83bec0e86131d255407
Author: Ryan Ernst <ryan@iernst.net>
Date:   Sat Apr 4 11:06:03 2015 -0700

    re-enable index lookup tests

commit 80d65d5eab39062dd8364687da74ddbb87ebcb76
Author: Ryan Ernst <ryan@iernst.net>
Date:   Sat Apr 4 10:39:52 2015 -0700

    update pom to point to new snapshot repo

commit 197b3a21ac2c2d70c9f740fe53e58632a22d1aad
Author: Robert Muir <rmuir@apache.org>
Date:   Sat Apr 4 12:51:22 2015 -0400

    fix postingsenum usage

commit 0e2b7a00cd07d068f755c51185ac521aa1eb0326
Author: Robert Muir <rmuir@apache.org>
Date:   Sat Apr 4 12:21:23 2015 -0400

    upgrade to lucene r1671277 (have not yet run tests or looked at postings changes)
2015-04-07 06:09:35 -04:00
Tanguy Leroux a598123838 AbstractBlobContainer.deleteByPrefix() should not list all blobs
The current implementation of AbstractBlobContainer.deleteByPrefix() calls AbstractBlobContainer.deleteBlobsByFilter() which calls BlobContainer.listBlobs() for deleting files, resulting in loading all files in order to delete few of them. This can be improved by calling BlobContainer.listBlobsByPrefix() directly.

This problem happened in #10344 when the repository verification process tries to delete a blob prefixed by "tests-" to ensure that the repository is accessible for the node. When doing so we have the following calling graph: BlobStoreRepository.endVerification() -> BlobContainer.deleteByPrefix() -> AbstractBlobContainer.deleteByPrefix() -> AbstractBlobContainer.deleteBlobsByFilter() -> BlobContainer.listBlobs()... and boom.

Also, AbstractBlobContainer.listBlobsByPrefix() and BlobContainer.deleteBlobsByFilter() can be removed because it has the same drawbacks as AbstractBlobContainer.deleteByPrefix() and also lists all blobs. Listing blobs by prefix can be done at the FsBlobContainer level.

Related to #10344
2015-04-07 11:04:41 +02:00
Boaz Leskes 9e18746ea0 Test: increase timeout in UnicastZenPingTests#testSimplePings 2015-04-07 10:07:58 +02:00
Boaz Leskes 59d6bd8881 Test: mute testOldIndexes
Ensure greens times out often. See https://github.com/elastic/elasticsearch/issues/10434
2015-04-07 09:19:01 +02:00
Ryan Ernst 9c209e46be Test: make httpClient() helper not rely on internalCluster (which may be read only) 2015-04-06 23:25:53 -07:00
Masaru Hasegawa 21f72fed0a Queries: Avoid NPE during query parsing
Workaround until Jackson is upgraded to 2.6.x.
Fixes #8629.
2015-04-06 12:26:14 +09:00
Ryan Ernst 9191da9d9f Test: temporarily avoiding replica problems with 0.90.13, see #10434 2015-04-04 09:27:12 -07:00
Ryan Ernst c3011cead4 Tests: Revamp static bwc test framework to use dangling indexes
The static old index tests currently take a long time to run because
each index version essentially recreates the cluster, and spins up
new nodes.  This PR instead loads each old version into the existing
cluster as a dangling index. It also removes the intermediate
"StaticIndexBackwardCompatibilityTest" which was an extra layer
with no purpose, and moves a shared version of a commonly found
function to get an http client.

The test now takes between 40 and 60 seconds for me. I also ran it
"under stress" by running all ES tests in one shell, while
simultaneously running 10 iterations of the old index tests. Each
iteration took on average about 90 seconds, which is much better
than the 20+ minutes we see in master on jenkins.

closes #10247
2015-04-03 23:21:55 -07:00
Ryan Ernst d379b3618e Mappings: Fix doc values representation to always serliaze if explicitly set
When doc values are explicitly set to the default value serialization
is skipped. This means the alternate way of specifying doc values,
through `fielddata.format: doc_values`, will take precedense if
present.

This change fixes doc values to always be serialized when an explicit value
was passed, so that it continues to take precedence over
`fielddata.format`.

closes #10297
closes #10302
2015-04-03 19:35:52 -07:00
Ryan Ernst 96fa466414 Tests: Skip Version.CURRENT for static bwc indexes
The current version is normally a snapshot while in development.
However, when the release process changes the snapshot flag to false,
this causes the static bwc tests to fail because they cannot
find an index for the current version.  Instead, this change
skips the current version, because there is no need to test
a verion's bwc against itself.

closes #10292
closes #10293
2015-04-03 19:25:43 -07:00
Adrien Grand c7115f8364 Mappings: Bring back numeric_resolution.
We had an undocumented parameter called `numeric_resolution` which allows to
configure how to deal with dates when provided as a number. The default is to
handle them as milliseconds, but you can also opt-on for eg. seconds.

Close #10072
2015-04-03 19:54:14 +02:00
Martijn van Groningen 3f8908acfb Test: Not all shards maybe in a started state after the initial scroll search, but are after we do the stats call, so add ensureGreen to ensure we don't up with this discrepancy 2015-04-03 18:30:59 +02:00
Adrien Grand 24ca482918 Tests: Make OldIndexBackwardsCompatibilityTests copy to fewer replicas.
We recently increased the size of bw indexes and backward compatibility tests
are now taking more time so it makes sense to ask them to do a bit less. This
commit changes the number of replicas we try to copy primaries to from (2 or 3)
to (1 or 2).
2015-04-03 16:46:30 +02:00
Adrien Grand d3b1567f79 Tests: Add more assertions to SearchStatsTests. 2015-04-03 16:09:57 +02:00
Adrien Grand 523033bce6 Test: Disable TRACE logging on aggregations tests. 2015-04-03 11:33:30 +02:00
Martijn van Groningen ef1f834cf9 inner hits: Make sure inner hits also work for nested fields defined in object field
Closes #10334
2015-04-03 08:57:10 +02:00
Igor Motov 5379fa04de Snapshot/Restore: separate repository registration
Separate repository registration to make sure that failure in registering one repository doesn't cause failures to register other repositories.

Closes #10351
2015-04-02 22:23:43 -04:00
Lee Hinman 8f13c5ad4d [TEST] Turn on more logging for testDataPathCanBeChanged 2015-04-02 20:11:33 -06:00
Eike Dehling 2fc2c8284a Mapping: add consistent serialization order for field data settings
Closes #10370
Closes #10318
2015-04-02 21:41:52 +02:00
Adrien Grand 1401075070 Tests: Speed up backward-compatibility tests for 1.1.0
1.1.0 is affected by #5817 which prevents merges from keeping up with the
indexing rate. As a consequence it generates lots of segments and makes bw
compat tests slow. So I added a special case for this version to index fewer
documents.
2015-04-02 19:11:12 +02:00
Adrien Grand 08f93cf33f Add doc values support to boolean fields.
This pull request makes boolean handled like dates and ipv4 addresses: things
are stored as as numerics under the hood and aggregations add some special
formatting logic in order to return true/false in addition to 1/0.

For example, here is an output of a terms aggregation on a boolean field:
```
   "aggregations": {
      "top_f": {
         "doc_count_error_upper_bound": 0,
         "buckets": [
            {
               "key": 0,
               "key_as_string": "false",
               "doc_count": 2
            },
            {
               "key": 1,
               "key_as_string": "true",
               "doc_count": 1
            }
         ]
      }
   }
```

Sorted numeric doc values are used under the hood.

Close #4678
Close #7851
2015-04-02 15:40:46 +02:00
Martijn van Groningen e390ef5bc1 inner hits: Make sure `size` of `0` works on the `inner_hits` level.
Closes #10358
2015-04-02 15:08:39 +02:00
Britta Weber 3772bd6738 [TEST] more restrictive logging 2015-04-02 13:36:07 +02:00
Britta Weber 82071659de recovery state: fix concurrent access to file list
A shard recovery response might serialize a shard state at the same time that it is
modified by the recovery process. The test
RelocationTests.testMoveShardsWhileRelocation
failed because of this with a ConcurrentModificationException.

closes #10381
2015-04-02 12:37:12 +02:00
Christoph Büscher 2beda3953d Remove expansion of empty index arguments in RoutingTable
RoutingTables activePrimaryShardsGrouped(), allActiveShardsGrouped() and
allAssignedShardsGrouped() methods treated empty index array input
parameters as meaning "all" indices and expanded to the routing maps
keyset. However, the expansion of index names is now already done in
MetaData#concreteIndices(). Returning an empty index name list here
when a wildcard pattern didn't match any index name could lead to
problems like #9081 because the RoutingTable still expanded this
list of names to "_all". In case of e.g. the recovery endpoint this
could lead to problems.

Closes #9081
Closes #10148
2015-04-02 12:29:47 +02:00
Simon Willnauer d30d3b967e Merge pull request #10376 from dakrone/misc-addl-logging
Miscellaneous additional logging and cleanups
2015-04-02 12:19:52 +02:00
Britta Weber 4259ab78f3 [TEST] set mmn to avoid split brain 2015-04-02 10:51:14 +02:00
Britta Weber 4d95f6dc39 [TEST] increase logging for SharedClusterSnapshotRestoreTests.basicWorkFlowTest 2015-04-02 10:51:14 +02:00
Lee Hinman 9ff217d89b Clean up logging and add additional logging regarding shadow engines
This fixes an issue where this was logged:

```
[node_t1] [test][0] flush with org.elasticsearch.action.admin.indices.flush.FlushRequest@65f6f1e
```

by adding a .toString() method to FlushRequest.

It also changes:

```
creating Index [test], shards [1]/[2]
```

to:

```
creating Index [test], shards [1]/[2s]
```

If shadow replicas are being used.
2015-04-01 11:49:26 -06:00
Simon Willnauer 1047e8bce5 [TEST] don't restrict index to nodes 2015-04-01 18:33:02 +02:00
Simon Willnauer efb82910a1 Merge pull request #9242 from reuben-sutton/remove_jsonp
Remove jsonp support and associated tests, closes #9108
2015-04-01 18:18:52 +02:00
Reuben Sutton 85c221e9b1 Remove jsonp support and associated tests, closes #9108 2015-04-01 16:06:09 +01:00
Simon Willnauer dc38df2b20 [RESTORE] Don't reuse source index UUID on restore
Today we reuse the UUID of the source index on restore. This can create conflicts
with existing shard state on disk. This also causes multiple indices with the same
UUID. This commit preserves the UUID of an existing index or creates a new UUID for
a newly created index.
2015-04-01 15:56:26 +02:00
Shay Banon c8f996320c Remove unsafe options
For quite some time now, our networking layer makes sure to create safe messages as in not using the shared buffers. This is great, and we should remove the old support for "unsafe" notion in our codebase.
closes #10360
2015-04-01 15:11:20 +03:00
Christoph Büscher 285941f0d3 Removed unused import 2015-04-01 12:02:21 +02:00
Christoph Büscher fc04967eda Core: Remove potential NPE while resolving concrete indices from MetaData
Prevents a current edge case resolving concrete aliases or index names in cluster MetaData
that could potentialy lead to NullPointerException when the IndicesOptions don't allow
wildcard expansion and the method is called with aliasesOrIndices argument null or emtpy list.
This change adds a check for that and introduces randomized test that catches this.

Closes #10342
Closes #10339
2015-04-01 10:59:09 +02:00
Martijn van Groningen 1c162ed34a inner hits: Fix bug where parse error is thrown if a inner filter is used in a nested filter/query.
Closes #10308
2015-03-31 22:44:39 +02:00
Britta Weber 567a50c29b [function_score] apply min_score to sub query score if no function provided
For optimization pruposes a function score query with an empty function
will just result in the original sub query. However, sometimes one might
want to use function_score query to actually filter out docs within for example
bool clauses by using the min_score functionallity.
Therefore the sub query should only be used without wrapping inside
a function_score query if min_score was also not set.

closes #10253
closes #10326
2015-03-31 16:16:53 +02:00
Britta Weber 17dffe222b [store] make sure shard active request works even if shard is still in post recovery
When deleting a shard th node that deletes th shard first checks if all shard copies are
started on other nodes. A message is sent to each node tand each node checks locally for
STARTED or RELOCATED.
However, it might happen that the shard is still in state POST_RECOVERY, like this:

shard is relocating from node1 to node2
1. relocated shard on node2 goes in POST_RECOVERY and node2 sends shard started to master
2. master updates routing table and sends new cluster state to node1 and node2
3. node1 processes the cluster state and asks node2 if it has the active shard
  before node2 processes the new cluster state (which would cause it to set the shard to started)
4. node2 sends back it does not have the shard started and so node1 does not delete it

This can be avoided by waiting until cluster state that sets the shard to started is actually processed.

closes #10018
2015-03-31 15:42:07 +02:00
Adrien Grand 8d204846df Remove leftover println. 2015-03-31 15:00:18 +02:00
Simon Willnauer 78d86bcf41 [STATE] Refactor state format to use incremental state IDs
Today there is a chance that the state version for shard, index or cluster
state goes backwards or is reset on a full restart etc. depending on
several factors not related to the state. To prevent any collisions
with already existing state files and to maintain write-once properties
this change introductes an incremental state ID instead of using the plain
state version. This also fixes a bug when the previous legacy state had a
greater version than the current state which causes an exception on node
startup or if left-over files are present.

Closes #10316
2015-03-31 14:17:07 +02:00
javanna ff6b605778 [TEST] fix SearchScrollTests, scroll doesn't support searchType count 2015-03-31 14:05:33 +02:00
javanna 83fb0a10e5 Scripting: remove support for script.disable_dynamic setting
Now that fine-grained script settings are supported (#10116) we can remove support for the script.disable_dynamic setting.

Same result as `script.disable_dynamic: false` can be obtained as follows:

```
script.inline: on
script.indexed: on
```
An exception is thrown at startup when the old setting is set, so we make sure we tell users they have to change it rather than ignoring the setting.

Closes #10286
2015-03-31 13:24:52 +02:00
Adrien Grand 7a595d7911 IndicesQueryCacheTests: Fix test bug.
The query cache is disabled on dfs_query_then_fetch so we need to enforce
query_then_fetch instead of relying on the randomized search type set by the
test framework.
2015-03-31 12:28:02 +02:00
Adrien Grand 0a6be2c111 Merge pull request #9296 from jpountz/enhancement/remove_count_search_type
Search: Merge `search_type=count` and `size=0`.

Close #9226
2015-03-31 11:36:38 +02:00
Adrien Grand a608db122d Search: Remove the `count` search type.
This commit brings the benefits of the `count` search type to search requests
that have a `size` of 0:
 - a single round-trip to shards (no fetch phase)
 - ability to use the query cache

Since `count` now provides no benefits over `query_then_fetch`, it has been
deprecated.

Close #7630
2015-03-31 11:31:49 +02:00
Adrien Grand 171e415a47 Tests: Assert that we do not leak SearchContexts.
Even if there is a background thread that periodically closes search contexts
that seem unused (every minute by default), it is important to close search
contexts as soon as possible in order to not keep unnecessary open files or
to prevent segments from being deleted.

This check would help ensure that refactorings of the SearchContext management
like #9296 are correct.
2015-03-31 11:31:49 +02:00
Igor Motov 96f4c06f46 Automatically add "index." prefix to the settings are changed on restore if the prefix is missing
Closes #10133
2015-03-30 17:39:11 -04:00
Michael McCandless b00b2b9baa fix test concurrency bug 2015-03-30 17:39:41 -04:00
jaymode 77418ecdbd [TEST] move FakeRestRequest to org.elasticsearch.test.rest
FakeRestRequest is used by a few tests and can also be leveraged by
tests outside of elasticsearch. Moving the package will mean the class
gets exported as part of the test jar.
2015-03-30 12:01:44 -04:00
Michael McCandless 87aa39a0d2 Core: deletions (alone) should also force a refresh when version map is using too much RAM
We already force a refresh in index/create ops, to clear version map
when it's using too much RAM, but we were failing to do this for
deletes, so an app that does tons of deletes with no indexing, and has
set refresh_interval to -1, would have version map using unbounded
RAM.

Closes #10312
2015-03-30 10:25:55 -04:00
Boaz Leskes 1200d8e647 Recovery: RecoveryState.File.toXContent reports file length as recovered bytes
Closes #10310
2015-03-30 16:12:37 +02:00
Adrien Grand a1505e7164 Tests: Assert that we do not leak SearchContexts.
Even if there is a background thread that periodically closes search contexts
that seem unused (every minute by default), it is important to close search
contexts as soon as possible in order to not keep unnecessary open files or
to prevent segments from being deleted.

This check would help ensure that refactorings of the SearchContext management
like #9296 are correct.
2015-03-30 10:39:08 +02:00
javanna 38ec5084a5 [TEST] resolved compiler warnings in ShapeBuilderTests and GeoPointParsingTests 2015-03-29 11:49:36 +02:00
Sebastian Monte 9a29705c49 Fix errors reported by error-prone
I compiled elasticsearch with error-prone
(https://github.com/google/error-prone). This commit fixes the 13
errors reported by the tool.
2015-03-29 11:43:56 +02:00
Martijn van Groningen 75713f4190 Reverted commit: 20f7be3 2015-03-28 08:53:11 +01:00
Martijn van Groningen 16d8f3ce81 aggs: Fix 2 bug in `children` agg
1) multiple nested children aggs result in a NPE
2) fixed a counting bug where the same readers where post collected twice

Closes #10158
2015-03-28 08:43:40 +01:00
Martijn van Groningen 3df3259a74 inner_hits: Fix nested stored field support.
This also fixes a NPE when the nested part has been filtered out of the _source, because of _source filtering.

Closes #9766
2015-03-28 08:02:30 +01:00
Britta Weber ccf5482956 [TEST] muste test and add issue number 2015-03-27 17:35:38 +01:00
Shay Banon 6181d8ecde Fail shard when index service/mappings fails to instantiate
When the index service (which holds shards) fails to be created as a result of a shard being allocated on a node, we should fail the relevant shard, otherwise, it will remain stuck.
Same goes when there is a failure to process updated mappings form the master.

Note, both failures typically happen when the node is misconfigured (i.e. missing plugins, ...), since they get created and processed on the master node before being published.
closes #10283
2015-03-27 16:58:24 +01:00
javanna 71bd40517d [TEST] remove GlobalScopeClusterTests
We removed the global ClusterScope a while ago, its related test can be removed too.
2015-03-27 15:04:42 +01:00
Tanguy Leroux c19b7a2f61 Fix thread leak in Hunspell service
An unchecked exception might be thrown when instantiating the HunspellService, leading to thread leaks in tests.

Closes #9849
2015-03-27 09:50:11 +01:00
Ryan Ernst e0334dcb9e Core: Enable doc values by default, when appropriate
Doc values significantly reduced heap usage, which results in faster
GCs. This change makes the default for doc values dynamic: any
field that is indexed but not analyzed now has doc values. This only
affects fields on indexes created with 2.0+.

closes #8312
closes #10209
2015-03-26 22:42:35 -07:00
Britta Weber 3f459f69a7 [TEST] wait for mapping, cluster state might not be up to date yet 2015-03-27 00:51:19 +01:00
Britta Weber edb6319cea [mappings] update dynamic fields in mapping on master even if parsing fails for the rest of doc
The local DocumentMapper is updated while parsing and dynamic fields are added before
parsing has finished. If parsing fails after a dynamic field has been added already
then the field was not added to the cluster state but was present in the local mapper of this
node. New documents with the same field would not necessarily cause an update either and
after restarting the node the mapping for these fields were lost. Instead the new fields
should always be updated.

closes #9851
closes #9874
2015-03-26 21:06:00 +01:00
javanna 18b02d58a4 [TEST] enable inline scripts on demand in bw comp tests
We currently have a single bw comp test (FunctionScoreBackwardCompatibilityTests) that requires inline scripts on.
After introducing fine-grained script settings, we moved the internal cluster to use the newer settings, but they are not supported by older nodes started as part of the bw comp tests. Moved script settings out of the default settings, so they won't be part of the ordinary settings when running bw comp tests.
Added logic in FunctionScoreBackwardCompatibilityTests to enable dynamic scripts using the proper setting, depending on the version of the node.
2015-03-26 19:56:55 +01:00
javanna d9d1e6a67a Scripting: add support for fine-grained settings
Allow to on/off scripting based on their source (where they get loaded from), the  operation that executes them and their language.

The settings cover the following combinations:

- mode: on, off, sandbox
- source: indexed, dynamic, file
- engine: groovy, expressions, mustache, etc
- operation: update, search, aggs, mapping

The following settings are supported for every engine:

script.engine.groovy.indexed.update:    sandbox/on/off
script.engine.groovy.indexed.search:    sandbox/on/off
script.engine.groovy.indexed.aggs:      sandbox/on/off
script.engine.groovy.indexed.mapping:   sandbox/on/off
script.engine.groovy.dynamic.update:    sandbox/on/off
script.engine.groovy.dynamic.search:    sandbox/on/off
script.engine.groovy.dynamic.aggs:      sandbox/on/off
script.engine.groovy.dynamic.mapping:   sandbox/on/off
script.engine.groovy.file.update:       sandbox/on/off
script.engine.groovy.file.search:       sandbox/on/off
script.engine.groovy.file.aggs:         sandbox/on/off
script.engine.groovy.file.mapping:      sandbox/on/off

For ease of use, the following more generic settings are supported too:

script.indexed: sandbox/on/off
script.dynamic: sandbox/on/off
script.file:    sandbox/on/off

script.update:  sandbox/on/off
script.search:  sandbox/on/off
script.aggs:    sandbox/on/off
script.mapping: sandbox/on/off

These will be used to calculate the more specific settings, using the stricter setting of each combination. Operation based settings have precedence over conflicting source based ones.

Note that the `mustache` engine is affected by generic settings applied to any language, while native scripts aren't as they are static by definition.

Also, the previous `script.disable_dynamic` setting can now be deprecated.

Closes #6418
Closes #10116
Closes #10274
2015-03-26 19:56:55 +01:00
Michael McCandless 442f539802 Tests: improve back compat tests by adding delete-by-query in the transaction log on upgrade
Closes #10266
2015-03-26 10:12:22 -04:00
Ryan Ernst ae41d1e03d Mappings: Fix _field_names to be disabled on pre 1.3.0 indexes
In #9893, an enabled flag was added for _field_names.  However,
backcompat for indexes created before 1.3.0 (when _field_names
was added) was lost. This change corrects the mapper
to always be disabled when used with older indexes that
cannot have _field_names.

closes #10268
2015-03-25 14:27:24 -07:00
Ryan Ernst 693d91e41c Mappings: Remove delete mapping API
Deleting a type from an index is inherently dangerous because
the type can be recreated with new mappings which may conflict
with existing segments still using the old mappings. This
removes the ability to delete a type (similar to how deleting
fields within a type is not allowed, for the same reason).

closes #8877
closes #10231
2015-03-24 09:46:02 -07:00
Britta Weber 3add12a970 function_score: undo "Remove explanation of query score from functions"
This adds the Explanation to the explain score again. It is needed
because the explanation of script functions will otherwise not contain
an explanation of _score if boost mode is set to replace.

closes #9826
2015-03-24 15:48:48 +01:00
Nicholas Knize e43f3a941b [GEO] Fix validate_* merge policy for GeoPointFieldMapper
Fail merge if validate_lat or validate_lon values are not equal. This will prevent inconsistencies between geo_points in a merged index, and parse exceptions for bounding_box and distance filters.

Also merged separate GeoPoint test classes into a single GeoPointFieldMapperTest to be consistent with GeoShapeFieldMapperTests.

closes #10164
2015-03-24 08:15:15 -05:00
Boaz Leskes c6ce64a5e5 Remove backward compatibility layer introduced in #6149
Closes #6229
2015-03-24 13:04:59 +01:00
Colin Goodheart-Smithe 2bf42dc9a0 [TEST] explicitly map fields in SignificantTermsBWCTests 2015-03-24 11:21:06 +00:00
Robert Muir 10e6fa1963 fix build with java 9
* add compiler workarounds for JDK bug JI-9019884
* remove permgen specification during tests (this results in an error on java 9)
* fix threadpool grow/shrink to call methods in the right order (this results in IAE with java 9)
2015-03-24 00:29:24 -04:00
Boaz Leskes f5923403a1 Test: RecoveryFromGatewayTests.testReusePeerRecovery - increase concurrent recoveries
To speed up the test and prevent ensureGreen() from timing out.
2015-03-23 22:02:46 +01:00
Ryan Ernst 66669c337b Tests: Add static bwc index for 1.5.0 2015-03-23 08:04:05 -07:00
Boaz Leskes cde7d9af1c Transport: fix racing condition in timeout handling
If a request comes in at the same moment the timeout handler for it runs, we may leak a timeoutInfoHolder and erroneously log "Transport response handler not found of id" . The same issue could cause the request tracer to fire a traceUnresolvedResponse call instead of traceReceivedResponse , causing a failure of testTracerLog ( see #10187 ) .

This commit makes sure timeoutInfoHolder is visible before removing the corresponding RequestHolder. It also unifies the TransportService.Adapter#remove(requestId) with TransportService.Adapter#onResponseReceived(requestId), as they are always called together to indicate a response was received.

Closes #10187
Closes #10220
2015-03-23 14:40:08 +01:00
Boaz Leskes f5f9739117 Recovery: only cancel when primary completed relocation
When a primary moves to another node, we cancel ongoing recoveries and retry from the primary's new home. At the moment this happens when the primary relocation *starts*. It's a shame as we cancel recoveries that may be close to completion and will finish before the primary has been fully relocated. This commit only triggers the cancelation once the primary relocation is completed.

Next to this, it fixes a race condition between recovery cancellation and the recovery completion. At the moment we may trigger remove a recovered shard just after it was completed. Instead, we should use the recovery cancellation logic to make sure only one code path is followed.

All of the above caused the recoverWhileUnderLoadWithNodeShutdown test to fail (see http://build-us-00.elastic.co/job/es_core_15_debian/32/ ). The test creates an index and then increasingly disallows nodes for it, until only 1 node is left in the allocation filtering rules. Normally, this means we stay in green, but the premature recovery cancellation plus the race condition mentioned above caused a shard to be failed and stay unassigned and the test asserts to fail. This happens due to the following sequence:

- The shard has finished recovering and sent the master a shard started command.
- The recovery is cancelled locally, removing the index shard.
- Master starts shard (deleting it's other copy).
- Local node gets a cluster state with the shard started in it, which cause it to send a shard failed (to make the master aware).
- Shard is failed and can't be re-assigned due to the allocation filter.

The recoverWhileUnderLoadWithNodeShutdown is also adapted a bit to fit the current behavior of allocation filtering (in the past it used to really shut down nodes). Last, all tests in that class are given better names to fit the current terminology.

Clsoes #10218
2015-03-23 14:24:37 +01:00
Boaz Leskes 4970e3e225 Revert "Rest: Add json in request body to scroll, clear scroll, and analyze API"
This reverts commit 16083d454c.
2015-03-23 12:57:19 +01:00
Colin Goodheart-Smithe b751f0e11b added validation of reducers 2015-03-23 09:12:28 +00:00
Shay Banon 9f9ada4b7b Upgrade to Jackson 2.5.1
Note, Jackson 2.5 is less lenient when it comes to not starting an object before starting to add fields on a fresh builder, fixed where applicable.
closes #10210
2015-03-23 09:03:27 +01:00
Jun Ohtani 16083d454c Rest: Add json in request body to scroll, clear scroll, and analyze API
Add json support to scroll, clear scroll, and analyze

Closes #5866
2015-03-23 15:35:38 +09:00
Shay Banon 34c5b934f1 TEST: use the random variable
we have to use the variable instead of the static methods to reproduce failing tests
2015-03-21 19:08:33 +01:00
Shay Banon 0cc13b9d5b Schedule transport ping interval
Sometimes, when using transport client for example, through a load balancer, there is a need to send a scheduled ping message to keep each channel alive.

Add support for `transport.ping_schedule`, which controls the schedule (-1 for disabled) at which a ping message will be sent. For transport client case, it gets enabled automatically since almost always this is the desired behavior.

We use the same 6 bytes header format for the ping message, with ES header and -1 for data length for ping message, and simply continue to process the next messages once this is encountered.

closes #10189
2015-03-21 18:55:10 +01:00
javanna 65b9a94baa Benchmark api: removed leftovers
Closes #10182
Closes #10184
2015-03-21 10:36:05 +01:00
Simon Willnauer 7257345db9 Revert Benchmark API
The benchmark api is being worked on feature/bench branch and will be merged from there when ready.
2015-03-21 10:36:04 +01:00
Shay Banon 31b63b1a84 Better detection of CBOR
CBOR has a special header that is optional, if exists, allows for exact detection. Also, since we know which formats we support in ES, we can support the object major type case.
closes #7640
2015-03-20 22:06:03 +01:00
Simon Willnauer 1d357cb48a Merge pull request #10157 from spinscale/1503-cleanup-remove-bytesarray-unsafe
Cleanup: Remove unsafe field in BytesStreamInput
2015-03-20 13:14:02 -07:00
Simon Willnauer 93fedcbb88 [RECOVERY] Wipe shard state before switching recovered files live
Today we leave the shard state behind even if a recovery is half finished
this causes in rare conditions shards to be recovered and promoted as
primaries that have never been fully recovered.

Closes #10053
2015-03-20 08:42:03 -07:00
Boaz Leskes 0f2d2d0495 Test: testCancelRecoveryAndResume - add network hook before bumping replicas 2015-03-20 16:24:36 +01:00
Boaz Leskes 8c69535580 Recovery: add throttle stats
This commit adds throttling statistics to the index stats API and to the recovery state.

Closes #10097
2015-03-20 10:13:40 +01:00
javanna 4348959f9d Delete api: remove broadcast delete if routing is missing when required
This commit changes the behaviour of the delete api when processing a delete request that refers to a type that has routing set to required in the mapping, and the routing is missing in the request. Up until now the delete api sent a broadcast delete request to all of the shards that belong to the index, making sure that the document could be found although the routing value wasn't specified. This was probably not the best choice: if the routing is set to required, an error should be thrown instead.

A `RoutingMissingException` gets now thrown instead, like it happens in the same situation with every other api (index, update, get etc.). Last but not least, this change allows to get rid of a couple of `TransportAction`s, `Request`s and `Response`s and simplify the codebase.

Closes #9123
Closes #10136
2015-03-20 09:19:43 +01:00
Simon Willnauer 780fe57a2c [TEST] Add more logging to TruncatedRecoveryTests 2015-03-19 23:17:48 -07:00
Lee Hinman f14e226e82 [TEST] Add additional logging to testCorruptTranslogFiles 2015-03-19 22:58:49 -06:00
Lee Hinman 25b09ede16 [TEST] Use less shards in testShadowReplicaNaturalRelocation
This makes the assertion a bit more flexible and removes the
`ensureGreen` in favor of `ensureYellow`, which is really all that is
needed to perform a search. On slow machines the relocations can take a
while and time out the `ensureGreen`.
2015-03-19 18:12:21 -06:00
Simon Willnauer d9be606c5e [LIFECYCLE] Add before/afterIndexShardDelete callback
This commit allows code to be executed before or after a shards content
is deleted from disk. This is only executed if the shard owns the
content ie. on a shard file system only a primary shard will execute
these operations.
2015-03-19 15:47:51 -07:00
Simon Willnauer a6897aa073 [GATEWAY] Move GatewayShardsState logic into IndexShard
The index shard should take care of shard state persistence since it has
all the information and the gateway concept has been removed in master.
2015-03-19 14:48:02 -07:00
Simon Willnauer 1168347b9d [REPLICATION] Remove `async` replication
Closes #10114
2015-03-19 14:44:21 -07:00
Boaz Leskes 955ff05a5e Transport: fix potential NPE in new tracer log if request timeout
Closes #9994
2015-03-19 21:29:34 +01:00
Alexander Reelsen 16efc50139 Cleanup: Remove unsafe field in BytesStreamInput
It is only used once (otherwise it is set to `false` anyway), so copying the array in that case makes more sense.
2015-03-19 13:05:59 +01:00
Simon Willnauer 5d39bea91b [TEST] Add tests that triggers truncated files on recovery
Several issues where reported showing truncated files where footers
didn't match and checksums read past EOF. This test reproduces the issue
on the latest 1.4 branch but passes on all versions above.

Closes #10155
2015-03-19 01:03:47 -07:00
Nicholas Knize 9bd0c019f2 [TEST] Fix geo orientation integration test
Pass node name to getInstance method of internalCluster to ensure we return the indexService from a node containing the index.
2015-03-18 21:30:20 -05:00
Nicholas Knize 1a79e1c8cc [GEO] Fix orientation persistence
Fixing geo_shape field mapper to persist the orientation parameter. Also adding parsing and integration tests to ensure persistence across cluster restarts.
2015-03-18 18:55:49 -05:00
Christoph Büscher 5788289a6d [TEST] Remove 'gtelte' feature from yaml tests
Some yaml tests still used the 'gtelte' feature in their skip section.
Since all language clients support this, the feature skip can be
removed.
2015-03-18 15:31:17 -07:00
jaymode 105bdd486a [HTTP] add option to only return simple exception messages
Adds a setting to disable detailed error messages and full exception stack traces
in HTTP responses. When set to false, the error_trace request parameter will result
in a HTTP 400 response. When the error_trace parameter is not present, the message
of the first ElasticsearchException will be output and no nested exception messages
will be output.
2015-03-18 17:49:05 -04:00
Colin Goodheart-Smithe cb4ab06021 missed file in merge 2015-03-18 14:14:00 -07:00
Colin Goodheart-Smithe 2ac93098b2 Merge branch 'master' into feature/aggs_2_0
Conflicts:
	src/main/java/org/elasticsearch/search/aggregations/metrics/scripted/ScriptedMetricAggregator.java
	src/test/java/org/elasticsearch/search/aggregations/bucket/significant/SignificanceHeuristicTests.java
2015-03-18 14:13:44 -07:00
Robert Muir 5f1ed47df6 Merge pull request #10143 from rmuir/bwcompat1
use bigger back compat indexes
2015-03-18 14:49:32 -04:00
Robert Muir 3a0700862a regenerate 0.90.x indexes without completion suggester 2015-03-18 14:29:41 -04:00
Robert Muir 087b107dd2 Create bigger back compat indexes. 2015-03-18 14:16:16 -04:00
Britta Weber dca0104061 [TEST] muste test, we have an issue for it and know what is going on 2015-03-18 10:17:38 -07:00
javanna fdfdf594f9 [TEST] RepeatOnExceptionRule to rethrow unexpected exception
In case an exception was caught by the repeat rule, the retry mechanism would kick in only if the exception was the expected one. If not an NPE got thrown, while we should rather just bubble it up to the caller. This makes `NettyTransportMultiPortTests` run from a plane. An assumption would kick in to make sure that the test gets ignored but the `AssumptionViolationException` was caught and not properly re-thrown.
2015-03-18 14:08:46 +01:00
Simon Willnauer 9ad1434a3b [TEST] Add test for restoring into a shadowreplica enabled index 2015-03-17 18:26:41 -07:00
Christoph Büscher 3063f06fc7 Add randomiziation to test for derivative aggregation 2015-03-17 13:53:34 -07:00
Alexander Reelsen b8334513d7 Transport: Return useful error message on potential HTTP connect
In case a HTTP client connects to the transport protocol and issues a
HTTP method followed by a space, we can just try to be smart and return
a string back to the client to point the user to the fact that the wrong
port has been used.

Closes #2139
Closes #10108
2015-03-17 09:47:24 -07:00
Boaz Leskes b605184471 Recovery: add total operations to the `_recovery` API
This commit adds the current total number of translog operations to the recovery reporting API. We also expose the recovered / total percentage:

```
"translog": {
   "recovered": 536,
   "total": 986,
   "percent": "54.3%",
   "total_time": "2ms",
   "total_time_in_millis": 2
},
```

Closes #9368
Closes #10042
2015-03-17 07:31:29 -07:00
Martijn van Groningen ef3cb2d436 percolator: Take filters from index aliases into account when selecting queries to run on a document.
The filter from an indexed alias is as if you would filter on the metadata of a percolator query, but then the filter is defined in the index alias instead of the percolate request.

Closes #6241
2015-03-16 17:25:55 -07:00
Martijn van Groningen 4393939f5e inner_hits: Nested parent field should be resolved based on the parent inner hit definition, instead of the nested parent field in the mapping.
The behaviour is better in the case someone has multiple levels of nested object fields defined in the mapping and like to define a single inner_hits definition that is two or more levels deep.

If someone wants inner hits on a nested field that is 2 levels deep the following would need to be defined:

```
{
  ...
  "inner_hits" : {
     "path" : {
        "level1" : {
            "inner_hits" : {
               "path" : {
                  "level2" : {
                     "query" : { .... }
                  }
               }
            }
        }
     }
  }
}
```

With this change the above can be defined as:

```
{
  ...
  "inner_hits" : {
     "path" : {
        "level1.level2" : {
            "query" : { .... }
        }
     }
  }
}
```

Closes #9251
2015-03-16 16:31:03 -07:00
Colin Goodheart-Smithe 68c043f730 Fixes ignore_malformed behaviour for ip fields 2015-03-16 13:43:53 -07:00
Boaz Leskes dc4c8c2693 Tests: improve logging of external node version and build
The BWC tests also run against a snapshot build of previous release branches. Upon a failure it's important to know what commit exactly was used.

Closes #10111
2015-03-16 12:37:08 -07:00
Boaz Leskes a1f5c342af Translog: stats fail to serialize size
Closes #10105
2015-03-16 10:55:28 -07:00
Simon Willnauer 7b344f8305 Merge pull request #10102 from s1monw/remove_wait_for_merge
[ENGINE] Remove reflection call to waitForMerges
2015-03-15 22:59:44 -07:00
Simon Willnauer e2d82504cc [ENGINE] Remove reflection call to waitForMerges
Since the index writer is now final we can remove the readlock around
the forceMerge calls and use the official API to wait for merges.
2015-03-15 22:56:51 -07:00
Christoph Büscher ab5e020114 Aggregations: Be lenient when converting local to utc time in time zone roundings
This solves a problem in the time zone rounding classes where time dates that
fall into a DST gap will cause joda time library to throw an exception.
Changing the conversion methods 'strict' option to false prevents this.

Closes #10025
2015-03-15 19:57:21 -07:00
Boaz Leskes 97559c0614 Engine: update index buffer size during recovery and allow configuring version map size.
To support real time gets, the engine keeps an in-memory map of recently index docs and their location in the translog. This is needed until documents become visible in Lucene. With 1.3.0, we have improved this map and made tightly integrated with refresh cycles in Lucene in order to keep the memory signature to a bare minimum. On top of that, if the version map grows above a 25% of the index buffer size, we proactively refresh in order to be able to trim the version map back to 0 (see #6363) . In the same release, we have fixed an issue where an update to the indexing buffer could result in an unwanted exception during recovery (#6667) . We solved this by waiting with updating the size of the index buffer until the shard was fully recovered. Sadly this two together can have a negative impact on the speed of translog recovery.

During the second phase of recovery we replay all operations that happened on the shard during the first phase of copying files. In parallel we start indexing new documents into the new created shard. At some point (phase 3 in the recovery), the translog replay starts to send operation which have already been indexed into the shard. The version map is crucial in being able to quickly detect this and skip the replayed operations, without hitting lucene. Sadly #6667 (only updating the index memory buffer once shard is started) means that a shard is using the default 64MB for it's index buffer, and thus only 16MB (25%) for the version map. This much less then the default index buffer size 10% of machine memory (shared between shards).

Since we don't flush anymore when updating the memory buffer, we can remove #6667 and update recovering shards as well. Also, we make the version map max size configurable, with the same default of 25% of the current index buffer.

Closes #10046
2015-03-15 14:45:41 -07:00
Boaz Leskes a596459ed6 Test: testClusterFormingWithASlowNode - make delays less aggressive 2015-03-15 13:57:49 -07:00
Michael McCandless 7861385221 Core: remove index.fail_on_corruption setting
Now we always fail the engine if corruption is detected.

Closes #10092
2015-03-14 17:11:44 -04:00
Simon Willnauer caafad750a [TEST] Fix test to use correct type in the mapping 2015-03-14 13:18:10 -07:00
Michael McCandless 0683a66277 Core: remove index.fail_on_merge_failure
Always fail the engine if an unexpected exception is hit during merge.

Closes #10088
2015-03-14 09:53:42 -04:00
javanna ebe1a4663d [TEST] renamed variables in ScriptServiceTests 2015-03-13 12:59:40 -07:00
Lee Hinman 6aec68cd29 Revert "[QUERY] Remove lowercase_expanded_terms and locale options"
This reverts commit d1f7bd97cb.

Ryan pointed out that this needs to work with the multi term query, so
additional analysis and tests should be added.
2015-03-13 13:51:44 -06:00
Lee Hinman d1f7bd97cb [QUERY] Remove lowercase_expanded_terms and locale options
The analysis chain should be used instead of relying on this, as it is
confusing when dealing with different per-field analysers.

The `locale` option was only used for `lowercase_expanded_terms`, which,
once removed, is no longer needed, so it was removed as well.

Fixes #9978
Relates to #9973
2015-03-13 13:17:27 -06:00
javanna a8271595dc Scripting: File scripts cache key to include language to prevent conflicts
The file scripts cache key should include the language of the script to prevent conflicts between scripts with same name but different extension (hence lang). Note that script engines can register multiple acronyms that may be used as lang at execution time (e.g. javascript and js are synonyms). We then need to make sure that the same script gets loaded no matter which of the acronyms is used at execution time. The problem didn't exist before this change ad the lang was simply ignored, while now we take it into account.

This change has also some positive effect on inline scripts caching. Up until now, the same script referred to with different acronyms would be compiled and cached multiple times, once per acronym. After this change every script gets compiled and cached only once, as we chose internally the acronym used as part of the cache key, no matter which one the user provides.

Closes #10033
2015-03-12 23:18:00 -07:00
Igor Motov 55f2a547d0 Snapshot/Restore: delete operation should ignore finalizing shards on nodes that no longer exist
Related to #9924
2015-03-11 12:10:48 -07:00
Shay Banon a161cf402b fix test to close node environment
the resource check only fails on windows for some reason..., need to chase why...
2015-03-08 16:42:18 -07:00
Shay Banon 13630d8028 Remove dangling indices settings, always import it
Remove the settings around dangling indices, such as no import and timeout for deletion, we always want to import dangling indices for safety, and we should not allow to change the behavior. This also cleans up the code quite a bit.
closes #10016
2015-03-08 13:24:07 -07:00
javanna 521ac7f35a Scripting: cleanup ScriptService & friends in preparation for #6418
- Added NAME constants for each script language, avoiding to repeat the same strings all over the place.
- Simplified `compile` method signatures by removing a couple of variants. Note that all of these signatures are going to change again with #6418 as in order to compile/execute a script the caller will need to specify which operation is attempting to execute the script, info that will be provided as an additional mandatory argument.
- Removed double call to ScriptService#verifyDynamicScripting for every indexed or dynamic script.
- Decreased ScriptService inner classes visibility to private (CacheKey, IndexedScript, ApplySettings)
- Moved ScriptService inner classes to the bottom of the class, I think it makes it more readable.
- Resolved some compiler warnings

Closes #9992
2015-03-07 10:01:34 +01:00
javanna 2d2ba48c0b Tribe node: system properties and configuration settings must not be forwarded to tribe clients
The tribe node, at startup, sets up the tribe clients that will join their corresponding tribes. All of the tribe.* settings are properly forwarded to the corresponding tribe client. System properties and global configuration settings must not be forwarded to the tribe client though or they will end up overriding per tribe settings with same name causing issues.

 For instance if you set the transport.tcp.port to some defined value for the tribe node, via system property or configuration file, that same value must not be forwarded to the tribe clients, otherwise they will try and use the same port, which will be already occupied by the tribe node itself, resulting in startup failed. Same for cluster.name, which will cause the tribe clients not to join their tribes.

Closes #9576
Closes #9721
2015-03-07 09:26:46 +01:00
Matthias Wahl e15d4d1124 Internal: Fix equality check of timevalue after serialization
closes #9218
2015-03-06 13:00:31 -08:00
Britta Weber 0ca1e31392 Revert "[mappings] update dynamic fields in mapping on master even if parsing fails for the rest of doc"
This reverts commit d9a1540948.
2015-03-06 19:23:41 +01:00
Britta Weber 3abf11611b [significant terms] Use 'script_file' instead of 'script' if the script is a file 2015-03-06 18:28:33 +01:00
Britta Weber 580728dfd6 significant terms: add scriptable significance heuristic
This commit adds scripting capability to significant_terms.
Custom heuristics can be implemented with a script that provides
parameters subset_freq, superset_freq,subset_size, superset_size.

closes #7850
2015-03-06 17:06:04 +01:00
Britta Weber d9a1540948 [mappings] update dynamic fields in mapping on master even if parsing fails for the rest of doc
The local DocumentMapper is updated while parsing and dynamic fields are added before
parsing has finished. If parsing fails after a dynamic field has been added already
then the field was not added to the cluster state but was present in the local mapper of this
node. New documents with the same field would not necessarily cause an update either and
after restarting the node the mapping for these fields were lost. Instead the new fields
should always be updated.

closes #9851
closes #9874
2015-03-06 15:35:23 +01:00
Martijn van Groningen dccaa49aa0 Tests: wait for discovery to be completed after both majority nodes follow a new master 2015-03-06 13:50:34 +01:00
Shay Banon 48bdd58d51 Use provided cluster state for indices service validations
Since the method can be called in an #execute event of the cluster service, we need the ability to use the cluster state that will be provided in the ClusterChangedEvent, have the ClusterState be provided as a parameter
2015-03-06 13:39:53 +01:00
Simon Willnauer c5a6767a55 [TEST] Reduce the number of fields in MLT tests 2015-03-06 11:54:27 +01:00
Martijn van Groningen 634c91a0ca Tests: added more logging 2015-03-06 11:18:24 +01:00
Britta Weber 6c79636985 [TEST] wait until mappings are added to cluster state to make sure they are persisted 2015-03-06 10:42:29 +01:00
Martijn van Groningen 0c254e9832 Zen: Node receiving a cluster state with a wrong master node should reject and throw an error.
Previously it was ignored and the publish cluster state timeout would kick in. In that case a stale master node would just wait for the inevitable and waste valuable time.
This issue was discovered by the DiscoveryWithServiceDisruptionsTests#testStaleMasterNotHijackingMajority test.

Also only perform cluster state versions and wrong master node check inside cluster state update task.
2015-03-06 08:47:32 +01:00
Lee Hinman 2d2cc764ac Revert "[TESTS] remove AwaitsFix from CircuitBreakerServiceTests"
This reverts commit 21e246f6a3.
2015-03-05 22:13:05 -07:00
Martijn van Groningen 274da68040 Test: added health call to will hold when wait when there is a cluster block, so that the refresh call doesn't fail if that is the case. 2015-03-05 20:32:23 +01:00
Zachary Tong 3131e01c9d Move GapPolicy and resolveBucketValues() to static helper methods
Will allow many reducers to share the same helper functionality without repeating code.  Chose
to put these in static helpers instead of adding to Reducer base class.  I can imagine other reducers
that aren't time-based (or don't care about contiguous buckets), which would make things like
gap policy useless.

Since these seemed more like helpers than inherent traits of a Reducer, they went into their own
static class.

Closes #9954
2015-03-05 09:50:07 -05:00
Britta Weber cea8999406 Store: Delete index folder if all shards were allocated away from a data only node
If a folder for an index was created that folder is never deleted from that node unless the index is deleted.
Data only nodes therefore can have empty folders for indices that they do not even have shards for.
This commit makes sure empty folders are cleaned up after all shards have moved away from a data only
node. The behavior is unchanged for master eligible nodes.

closes #9985
2015-03-05 15:48:41 +01:00
Colin Goodheart-Smithe 8935959cbf [TEST] removed custom index settings for all DateHistogram tests
In favour of randomising number of shards and replicas and only the extended bounds test sets number of shards and replicas explicitly
2015-03-05 10:29:22 +00:00
Britta Weber 764901a9cd [TEST] make sure update task is actually executed
The update task that was submitted in this test never got executed
if node_2 was not master.
2015-03-04 15:49:49 +01:00
Simon Willnauer 6b95a05fc7 Revert "[TEST] Enable trace logging for translog recovery"
This reverts commit 52d53e658f.
2015-03-04 15:33:28 +01:00
Martijn van Groningen f81805d7d3 Test: muted testStaleMasterNotHijackingMajority 2015-03-04 15:07:59 +01:00
Colin Goodheart-Smithe dc03912731 Merge branch 'master' into feature/aggs_2_0
Conflicts:
	src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoHashGridParser.java
	src/main/java/org/elasticsearch/search/aggregations/metrics/percentiles/InternalPercentileRanks.java
	src/main/java/org/elasticsearch/search/aggregations/metrics/percentiles/InternalPercentiles.java
	src/main/java/org/elasticsearch/search/aggregations/metrics/tophits/InternalTopHits.java
	src/main/java/org/elasticsearch/search/aggregations/metrics/tophits/TopHitsAggregator.java
	src/test/java/org/elasticsearch/search/aggregations/bucket/significant/SignificanceHeuristicTests.java
2015-03-04 10:49:46 +00:00
Simon Willnauer 52d53e658f [TEST] Enable trace logging for translog recovery 2015-03-04 11:48:10 +01:00
Lee Hinman a5ab49dc70 [TESTS] Flush and refresh before querying in IndexWithShadowReplicasTests 2015-03-03 14:35:22 -07:00
Lee Hinman 94a74ddaec [CORE] Handle truncated translog gracefully
We used to handle truncated translogs in a better manner (assuming that
the node was killed halfway through writing an operation and discarding
the last operation). This brings back that behavior by catching an
`EOFException` during the stream reading and throwing a
`TruncatedTranslogException` which can be safely ignored in
`IndexShardGateway`.

Fixes #9699
2015-03-03 08:25:03 -07:00
Britta Weber a064f57bc2 [TEST] increase suite timeout for OldIndexBackwardsCompatibilityTests
Test suite times out too often and it seems this is not because of actual
failures but becasue it is a long running test.
2015-03-03 15:44:11 +01:00
Simon Willnauer 4becaffb41 [TEST] use context classloader to load testclasses 2015-03-03 14:34:13 +01:00
javanna 4ad33c30ac [TEST] Work around URI encode limitations in RestClient
We've been relying on URI for url encoding, but it turns out it has some problems. For instance '+' stays as is while it should be encoded to `%2B`. If we go and manually encode query params we have to be careful though not to run into double encoding ('+'=>'%2B'=>'%252B'). The applied solution relies on URI encoding for the url path, but manual url encoding for the query parameters. We prevent URI from double encoding query params by using its single argument constructor that leaves everything as is.

We can also revert back the expression script REST test that revealed this to its original content (which contains an addition).

Closes #9769
Closes #9946
2015-03-03 10:21:23 +01:00
Martijn van Groningen e559471948 Test: fix testStaleMasterNotHijackingMajority by waiting for the old master node to step down.
It may take some time for the old master node to step down anf for it to rejoin and that all nodes have it in the nodes list.
By waiting for the old master node to have stepped down, we can again rely on assertDiscoveryCompleted() to make sure that it has joined.
2015-03-03 08:49:14 +01:00
Lee Hinman 21e246f6a3 [TESTS] remove AwaitsFix from CircuitBreakerServiceTests
I beasted these tests for a while without failure, I would like to
re-enable them to see if they still fail.

Fixes #8710
Fixes #9270
2015-03-02 16:54:15 -07:00
Martijn van Groningen ca50221474 Test: fix DiscoveryWithServiceDisruptionsTests#isolatedUnicastNodes by starting a 4 node cluster instead of a 3 node cluster.
If the isolated unicast host is also a master node then its local cluster state gets unusable a source for pinging when the disruption stops.
All the nodes in the cluster state node list can be removed and at that time it will only ping itself and never find out about the other nodes.
(these nodes will not ping, because they are already following a new master)
2015-03-02 22:42:47 +01:00
Martijn van Groningen 7f6c65bf8e Test: increased logging 2015-03-02 21:16:24 +01:00
javanna b053fc97f6 [TEST] Make sure we restart the suite cluster after each test failure
CurrentTestFailedMarker is a RunListener that gets notified whenever a test fails, and we were using it to be able to restart the suite cluster after each failure. We were checking whether a test had failed in the @After method though, which runs before the listener gets notified, so the failed flag would always be false.

This commit makes sure that the suite cluster gets restarted not only when there are problems in the afterInternal method, but also after each test failure. In order to achieve this, we need to reset the cluster afterwards, when we get to know about both of the events (problem in afterInternal and test failure), and before resetting the currentCluster. Introduced a TestRule that keeps track of test failures and allows to execute arbitrary tasks when a test fails and when a test is completed (regardless of its result). Allows also to force the execution of the failure task (used in case of afterInternal issues rather than actual test failure).

Also updated ElasticsearchRestTests to make sure that the RestClient gets re-initialized in case we restart the suite cluster, otherwise all the subsequent tests fail. Improved this mechanism also to relate it directly to the restart of the cluster instead of checking whether the addresses have changed, which doesn't work anyway as the new cluster will use the same addresses but the client needs to be recreated anyway.

Closes #9015
2015-03-02 19:07:23 +01:00
Simon Willnauer df8206853b [TESTS] Make sure test end with ..Tests
This commit adds a simple testcase that ensures all our tests end with the right naming.

Closes #9945
2015-03-02 17:31:19 +01:00
Martijn van Groningen 68da7c05ee Test: fix npe 2015-03-02 16:41:19 +01:00
Colin Goodheart-Smithe 7c046d28bf Implementation of GapPolicy for derivative 2015-03-02 14:53:05 +00:00
Martijn van Groningen 2b00ecb5b5 Test: use assertBusy to fix timing issue 2015-03-02 15:30:39 +01:00
Britta Weber 358fd176c1 [TEST] add Tests suffix 2015-03-02 13:46:45 +01:00
Britta Weber 600cb886da [TEST] add Tests suffix 2015-03-02 13:19:23 +01:00
Tanguy Leroux c457499cb2 [Native] Use direct mapping call in Kernel32Library
This commit modifies the Kernel32Library to use direct mapping instead of a proxy class when doing native calls on Windows platforms. It also adds the "createSecurityManager" permission to the tests.policy file, and adds unit tests that should have failed when the Java security manager is enabled.

Closes #9802
2015-03-02 09:48:18 +01:00
Boaz Leskes c9b8c22850 Test: InternalEngineTests.testEnableGcDeletes missed closing translog 2015-03-01 17:14:42 +01:00
Boaz Leskes 4110c1ab6c Test: InternalEngineTests.testSegmentsWithMergeFlag should close it's translog
Also improve test suite tearDown to not fail if setUp didn't create engines, translogs etc.
2015-03-01 12:10:35 +01:00
Boaz Leskes ecbb9c03b0 Test: testOldIndexes start nodes async 2015-03-01 09:02:23 +01:00
Boaz Leskes facf87079c Test: add LoggingListener to ElasticsearchLuceneTestCase 2015-03-01 08:48:35 +01:00
Boaz Leskes eafba93919 Test: InternalEngineTests.testSimpleRecover should close snapshot 2015-03-01 08:48:14 +01:00
Boaz Leskes c346effd9c Test: InternalEngineTests - JVM specific paths + retry to clean up translogs on startUp
Files may still be locked
2015-03-01 00:51:36 +01:00
Ryan Ernst 2e797b9d55 Test: ShadowEngineTests - close translogs on tear down here too 2015-02-27 22:05:42 -08:00
Boaz Leskes 9b576763d7 Test: InternalEngineTests - close translogs on tear down 2015-02-27 21:53:25 +01:00
Ryan Ernst fe62e463e1 fix test bug leftover from #9914 2015-02-27 12:17:19 -08:00
Boaz Leskes 0cec37f3c3 Recovery: unify RecoveryState management to IndexShard and clean up semantics
We keep track of the current stage of recovery using an instance of RecoveryState which is stored on the relevant IndexShard. At the moment changes to this object are made in many places of the code, which are charged of doing it in the right order, keeping track of timers and many more. Also the changes to shard state are decoupled from the recovery stages which caused #9503.

This PR refactors this and brings all of the changes into IndexShard. It also makes all recovery follow the exact same stages and shortcut some. This is in order to keep things simple and always the same (those shortcuts didn't add anything, we ended doing it all anyway).

Also, all timer management is now folded into RecoveryState and unit tests are added.

This closes #9503 by moving the shard to post recovery only once the recovery is done (before they were decoupled), meaning that master promotion of the target shard to started can not cancel the recovery.

Closes #9902
2015-02-27 21:09:50 +01:00
Boaz Leskes 0f1c779d2c Engine: close snapshots before recovery counter
#9760 was a fix for translog leaking due to measing a delete flag. This is not needed here as we have a better solution to not loose the flag. This commit takes the changes from 1x in order  to keep the code base similar and enjoy the extra tests.

Closes #9760
2015-02-27 20:22:55 +01:00
Ryan Ernst 702b2abd1b fix compilation issue from forward port of #9916 2015-02-27 11:20:55 -08:00
Ryan Ernst dd0084de83 Mappings: Lock down _ttl field
While the parser allowed changing field type settings, these would never
have been serialized.  So this change simply removes parsing using
parseField. Backcompat will still work if a user uploads old settings
(they just would never have worked anyways, so we continue ignoring
them with 1.x, and 2.x will now error).

see #8143
closes #9914
2015-02-27 11:11:04 -08:00
Ryan Ernst 9d708e20a0 Mappings: Lock down _size field
This also changes the stored setting for _size to true (for
indexes created in 2.x).

see #8143
closes #9913
2015-02-27 11:09:52 -08:00
Ryan Ernst f87fa8172e Tests: Add back tests.cluster
This setting is used by the release script to run rest tests against
the version being released.  It used to work only for tests using
the global cluster.  Now it supercedes both SUITE and TEST scope
test clusters.

closes #9916
2015-02-27 11:08:24 -08:00
Robert Muir 4ca57ab10a Upgrade to Lucene r1662607
Closes #9915.

Squashed commit of the following:

commit cfa59f5a3f03d9d1b432980dcee6495447c1e7ea
Author: Robert Muir <rmuir@apache.org>
Date:   Fri Feb 27 12:10:16 2015 -0500

    add missing null check

commit 62fe5403068c730c0e0b6fd1ab1a0246eeef6220
Author: Robert Muir <rmuir@apache.org>
Date:   Fri Feb 27 11:31:53 2015 -0500

    Disable ExtrasFS for now, until we hook all this in properly in a separate issue.

commit 822795c57c5cf846423fad443c2327c4ed0094ac
Author: Adrien Grand <jpountz@gmail.com>
Date:   Fri Feb 27 10:12:02 2015 +0100

    Fix PercolatorTests.

commit 98b2a0a7d8298648125c9a367cb7e31b3ec7d51b
Author: Adrien Grand <jpountz@gmail.com>
Date:   Fri Feb 27 09:27:11 2015 +0100

    Fix ChildrenQueryTests.

commit 9b99656fc56bbd01c9afe22baffae3c37bb48a71
Author: Robert Muir <rmuir@apache.org>
Date:   Thu Feb 26 20:50:02 2015 -0500

    cutover apis, no work on test failures yet.
2015-02-27 12:51:36 -05:00