Commit Graph

6625 Commits

Author SHA1 Message Date
Adrien Grand 1adf232bb2 Mappings: Validate dynamic mappings updates on the master node.
This commit changes dynamic mappings updates so that they are synchronous on the
entire cluster and their validity is checked by the master node. There are some
important consequences of this commit:
 - a failing index request on a non-existing type does not implicitely create
   the type anymore
 - dynamic mappings updates cannot create inconsistent mappings on different
   shards
 - indexing requests that introduce new fields might induce latency spikes
   because of the overhead to update the mappings on the master node

Close #8688
2015-04-21 11:08:21 +02:00
Adrien Grand ca03e40605 Internal: Ensure that explanation descriptions are not null on serialization.
As requested on #10399
2015-04-21 11:08:21 +02:00
Martijn van Groningen 24c75dec2d Merge pull request #10694 from martijnvg/matched_queries/cleanup
matched queries: Remove redundant and broken code
2015-04-21 10:55:49 +02:00
Adrien Grand cc9957fe0e Merge pull request #10689 from jpountz/enhancement/check_expl_desc
Internal: Ensure that explanation descriptions are not null on serialization.

Close #10399
2015-04-21 09:50:48 +02:00
Martijn van Groningen bb1cd65c0d matched queries: Remove redundant and broken code
Because the fetch phase now has nested doc, the logic that deals with detecting if a named nested query/filter matches with a hit can be removed.

Closes #10661
2015-04-21 08:52:51 +02:00
Adrien Grand b69e7e4d35 Internal: Ensure that explanation descriptions are not null on serialization.
As requested on #10399
2015-04-20 23:58:28 +02:00
Igor Motov faf725b788 Improve the error message when attempting to snapshot a closed index
Currently the error message is the same when index is closed and when it is missing shards. This commit will generate a specific failure message when a user tries to create a snapshot of a closed index.

Related to #10579
2015-04-20 15:55:32 -04:00
Isabel Drost-Fromm 717d9ec1d0 Merge pull request #10525 from MaineC/bug-fix/JVM_Checker
Fix typo in JVM checker user help.

When checking the JVM we provide the user with help on which environment variable to use to disable the check in case the check fails. Fixing the variable we point the user to - should be JAVA_OPTS
2015-04-20 19:35:40 +02:00
Ryan Ernst 3a04d3ca91 Mappings: Remove dead code after previous refactorings
This is mostly removing code that handled deletion of types, which was
removed in #8877.

closes #10666
2015-04-20 10:07:24 -07:00
Simon Willnauer 24d1f595a5 [TEST] Add back old way for naming clusters 2015-04-20 18:29:27 +02:00
Simon Willnauer 5730c06af9 [STORE] Move to on data.path per shard
This commit moves away from using stripe RAID-0 simumlation across multiple
data paths towards using a single path per shard. Multiple data paths are still
supported but shards and it's data is not striped across multiple paths / disks.
This will for instance prevent to loose all shards if a single disk is corrupted.

Indices that are using this features already will automatically upgraded to a single
datapath based on a simple diskspace based heuristic. In general there must be enough
diskspace to move a single shard at any time otherwise the upgrade will fail.

Closes #9498
2015-04-20 17:19:45 +02:00
javanna 91afe64df7 [TEST] remove unused ElasticsearchIntegrationTest#afterTestFailed method 2015-04-20 16:51:27 +02:00
Tanguy Leroux 0dad33f17f Update after @eletrical review 2015-04-20 14:58:19 +02:00
Tanguy Leroux 867955188e Standardization of packages structure and install
The existing DEB/RPM packages have a lot of differences: they don't execute the same actions when installing or removing the package. They also don't declare exactly the same environment variables at the same place. At the end of the day the global behavior and configuration is *almost* the same but it's very difficult to maintain the scripts.

This commits unifies the package behavior:
- DEB/RPM use the same package scripts (pre installation, post installation etc) in order to execute exactly the same actions
- Use of a unique environment vars file that declares everything needed by scripts (the goal is to delete vars declaration in init.d and systemd scripts, this will be done in another PR)
- Variables like directory paths are centralized and replaced according to the target platform (using #10330)
- Move /etc/rc.d/init.d to standard /etc/init.d (RPM only)
- Add PID_DIR env var
- Always set ES_USER, ES_GROUP,MAX_MAP_COUNT and MAX_OPEN_FILES in env vars file
- Create log, data, work and plugins directories with DEB/RPM packaging system
- Change to elastic.co domain in copyright and control files
- Add Bats files to automate testing of DEB and RPM packages
- Update TESTING.asciidoc

More info on Bats here:  https://github.com/sstephenson/bats
2015-04-20 14:58:19 +02:00
Adrien Grand 2b0440368c Merge pull request #10674 from jpountz/enhancement/indexsearcher_count
Search: Cut over to IndexSearcher.count.

Close #10674
2015-04-20 14:54:48 +02:00
Adrien Grand 03c07377e3 Search: Cut over to IndexSearcher.count.
There is a new IndexSearcher.count method that makes it easier to count how
many documents match a particular query.
2015-04-20 14:49:35 +02:00
Robert Muir db096b4404 Merge pull request #10656 from elastic/mockfilesystem
Integrate better with lucene test framework and mockfilesystems
2015-04-20 08:14:06 -04:00
Simon Willnauer a6c154aa7a Use dummy TermStatistics when term is not found Closes #10660 2015-04-20 11:46:29 +02:00
Shay Banon 45fa5dcad9 Cleanup local code transport execution
Now that we handle automatically the local execution within the transport service, we can remove parts of the code that handle it in actions.
closes #10582
2015-04-20 10:43:06 +02:00
Robert Muir 2ed711fc6f mark just this method as @Slow, can easily take over a minute 2015-04-19 15:09:16 -04:00
Robert Muir b09d236fc0 run tests with AssertingCodec to find bugs 2015-04-19 13:56:12 -04:00
Ryan Ernst 68f75ea7b6 simplified rest skip range version parsing more, ranges can now be open
ended
2015-04-19 06:50:08 -07:00
Robert Muir 9e0a9588e8 add more paranoia to PathUtils 2015-04-19 09:21:45 -04:00
Ryan Ernst 22af0e627c cleanup order of before/after stuff, reorganize helper methods a bit 2015-04-18 18:17:13 -07:00
Robert Muir b728772fe4 more fine-grained @slow tuning, remove from many tests that got unlucky with fsync 2015-04-18 19:59:29 -04:00
Ryan Ernst 137875513e remove fixed seed for version util tests 2015-04-18 13:28:17 -07:00
Ryan Ernst b46df4d5dc suppress extrasfs from integ tests, fix bug in random version util 2015-04-18 13:25:00 -07:00
Ryan Ernst 06eee11dbb simplify version handling in rest tests, add tests for version utilities 2015-04-18 12:48:00 -07:00
Robert Muir d301567ecf let tests.verbose tell the story 2015-04-18 13:48:33 -04:00
Ryan Ernst ce6b3774ec move version related stuff to dedicated test utility 2015-04-18 03:00:45 -07:00
Ryan Ernst d8a92947d1 removed some esoteric helper functions, shuffled methods around in base class 2015-04-18 01:53:22 -07:00
Ryan Ernst e91a7de9f7 move rest and integration test annotations and sysprops to their respective tests 2015-04-18 01:00:45 -07:00
Robert Muir d2854d7267 mark slow tests with @Slow annotation 2015-04-18 02:23:05 -04:00
Ryan Ernst b27c7f0d2a suppress extrasfs from corrupted file test 2015-04-17 21:09:36 -07:00
Ryan Ernst 310e04bdb3 Merge branch 'mockfilesystem' of github.com:elastic/elasticsearch into mockfilesystem 2015-04-17 20:53:46 -07:00
Ryan Ernst e4de0cb57f removed jvm ordinal constant, only really needed now for test cluster
port numbering (moved to there)
2015-04-17 20:52:38 -07:00
Robert Muir c7ce72733d disable extras for this test 2015-04-17 23:52:28 -04:00
Robert Muir 96f08a38e6 parallelize rest tests 2015-04-17 23:38:01 -04:00
Ryan Ernst 621f502b12 move bwc specific stuff to backcompat base class 2015-04-17 18:48:34 -07:00
Robert Muir 52c4af6115 remove these helpers 2015-04-17 21:22:57 -04:00
Robert Muir a312098785 nuke duplicate methods 2015-04-17 21:09:53 -04:00
Robert Muir 61b60da7d2 nuke some unused stuff 2015-04-17 21:02:05 -04:00
Robert Muir aa381a2775 fold ESTestCase into ElasticsearchTestCase 2015-04-17 20:35:28 -04:00
Robert Muir 84811a57d6 nuke ElasticsearchSingleNodeLuceneTestCase 2015-04-17 20:19:32 -04:00
Robert Muir 0ff0a0082d fix backwards test to not muck with URIs or get mad about extra clusters 2015-04-17 19:41:55 -04:00
Robert Muir 43b6cd2118 Merge branch 'master' into mockfilesystem 2015-04-17 19:15:25 -04:00
Robert Muir e71553556e remove tests.processors, this is a reproducibility nightmare 2015-04-17 18:32:52 -04:00
Robert Muir c7c4045e19 speed up directory wrapping 2015-04-17 17:12:55 -04:00
Julie Tibshirani dc1742785d Mappings: Fixed an equality check in StringFieldMapper.
The check was ineffective and was causing search_quote_analyzer to be added to the mapping unnecessarily.

Closes #10357
closes #10359
2015-04-17 13:18:53 -07:00
Michael McCandless fdc7db7b11 Test back compat of 0.90.6 index
Add back UpgradeReallyOldIndexTest from 1.x, but test 0.90.6 index
(Lucene 4.x) instead of 0.20 (Lucene 3.x), and make sure
only_ancient_segments works.

Closes #10639
2015-04-17 14:02:53 -04:00
Robert Muir a985c972f2 suppress all filesystems here due to jimfs brokenness 2015-04-17 12:28:29 -04:00
Robert Muir b113fbd283 fix nocommits 2015-04-17 11:57:45 -04:00
Robert Muir 57b5e06dd6 disable extras for test, clean up some stragglers 2015-04-17 11:35:20 -04:00
Robert Muir d08322e000 disable WindowsFS for this test. unsure if its a problem on real windows too 2015-04-17 09:21:54 -04:00
Robert Muir 2d9e5b4807 fix FileSystemUtils failures 2015-04-17 08:26:25 -04:00
Robert Muir c421948300 upgrade to lucene 5.2 r1674278 2015-04-17 07:58:20 -04:00
Robert Muir 89b9f0e541 Merge branch 'master' into mockfilesystem 2015-04-17 07:55:48 -04:00
Martijn van Groningen 161e74029f Core: Fix NPE. The `future` field is set from a different thread.
Closes #10630
2015-04-17 10:46:22 +02:00
Adrien Grand fd416d5ed5 Upgrade to Lucene-5.2-snapshot-1674183. 2015-04-17 10:05:30 +02:00
Simon Willnauer 630544cc69 [TEST] Use lowercase index names in test 2015-04-17 08:34:51 +02:00
Robert Muir 007e8f1d5c remove redundant confusing output 2015-04-17 02:05:59 -04:00
Robert Muir 65367f5efa fix many test bugs by minimizing URI handling 2015-04-16 21:24:07 -04:00
Ryan Ernst 84b20c0e0e revert change to use .getPath(), it doens't work on windows 2015-04-16 16:05:06 -07:00
Robert Muir 370819a98a Merge branch 'master' into mockfilesystem 2015-04-16 18:26:12 -04:00
Simon Willnauer 5f9bac435e [TEST] mute test and remove once #10638 is in 2015-04-16 22:56:52 +02:00
Robert Muir 8ceb495007 improve REPRODUCE WITH 2015-04-16 09:56:56 -04:00
Simon Willnauer 4fccb48ae8 [TEST] Wait for green after restore indices 2015-04-16 14:10:36 +02:00
Michael McCandless 399f0ccce9 Core: add only_ancient_segments to upgrade API, so only segments with an old Lucene version are upgraded
This option defaults to false, because it is also important to upgrade
the "merely old" segments since many Lucene improvements happen within
minor releases.

But you can pass true to do the minimal work necessary to upgrade to
the next major Elasticsearch release.

The HTTP GET upgrade request now also breaks out how many bytes of
ancient segments need upgrading.

Closes #10213

Closes #10540

Conflicts:
	dev-tools/create_bwc_index.py
	rest-api-spec/api/indices.upgrade.json
	src/main/java/org/elasticsearch/action/admin/indices/optimize/OptimizeRequest.java
	src/main/java/org/elasticsearch/action/admin/indices/optimize/ShardOptimizeRequest.java
	src/main/java/org/elasticsearch/action/admin/indices/optimize/TransportOptimizeAction.java
	src/main/java/org/elasticsearch/index/engine/InternalEngine.java
	src/test/java/org/elasticsearch/bwcompat/StaticIndexBackwardCompatibilityTest.java
	src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java
	src/test/java/org/elasticsearch/rest/action/admin/indices/upgrade/UpgradeReallyOldIndexTest.java
2015-04-16 05:24:33 -04:00
Adrien Grand 563e704881 Mappings: Same code path for dynamic mappings updates and updates coming from the API.
We have two completely different code paths for mappings updates, depending on
whether they come from the API or are guessed based on the parsed documents.
This commit makes dynamic mappings updates execute like updates from the API.

The only change in behaviour is that a document that fails parsing can not
modify mappings anymore (useful to prevent issues such as #9851). Other than
that, this change should be fairly transparent to users but working this way
opens doors to other changes such as validating dynamic mappings updates on the
master node (#8688).

The way it works internally is that Mapper.parse now returns a Mapper instead
of being void. The returned Mapper represents a mapping update that has been
performed in order to parse the document. Mappings updates are propagated
recursively back to the root mapper, and once parsing is finished, we check
that the mappings update can be applied, and either fail the parsing if the
update cannot be merged (eg. because of a concurrent mapping update from the
API) or merge the update into the mappings.

However not all mappings updates can be applied recursively, `copy_to` for
instance can add mappings at totally different places in the tree. Because of
it I added ParseContext.rootMapperUpdates which `copy_to` fills when the
field to copy data to does not exist in the mappings yet. These mappings
updates are merged from the ones generated by regular parsing.

One particular mapping update was the `auto_boost` setting on the `all` root
mapper. Being tricky to work on, I removed it in favour of search-time checks
that payloads have been indexed.

One interesting side-effect of the change is that concurrency on ObjectMapper
is greatly simplified since we do not have to care anymore about having
concurrent dynamic mappings and API updates.
2015-04-16 10:16:59 +02:00
Ryan Ernst 93e591c5fa Enabled mockfs on base test class. All tests pass. Added suppressions
with nocommits for tests that need to be investigated.
2015-04-16 00:25:02 -07:00
Ryan Ernst 4d44fa0192 Fixed test using .getURI() for resource paths to use .getPath() instead. We should probalby ban .getURI()?
Also added a couple nocommits for some issues with tests after mockfs is
working again. But I also re-enabled the mockfs suppression in the base
test case for now.
2015-04-15 23:09:21 -07:00
Robert Muir e5a699fa05 cutover to lucenetestcase 2015-04-16 00:58:02 -04:00
Robert Muir 401452608e ensure security manager is always on if it should be 2015-04-15 21:20:13 -04:00
Robert Muir fb481bc145 Merge branch 'master' into mockfilesystem
Conflicts:
	src/main/java/org/elasticsearch/index/translog/Translog.java
	src/main/java/org/elasticsearch/index/translog/fs/FsTranslog.java
2015-04-15 18:34:24 -04:00
Robert Muir 6ac4d6daef contain filesystem access 2015-04-15 18:23:30 -04:00
Lee Hinman 4f8ea78356 [TEST] Supress filesystems for base test classes 2015-04-15 15:49:56 -06:00
Lee Hinman 2d768bb3e8 [TEST] Fix ShadowEngineTests writing to CWD
After #a3f0789 these tests fail because the translog getPath returns a
path that is a CWD path (even though it is unneeded)
2015-04-15 15:37:55 -06:00
Ryan Ernst a3f078985b Tests: Forbid tests from writing to CWD
Allowing tests writing to the working directory can mask problems.
For example, multiple tests running in the same jvm, and using the
same relative path, may cause issues if the first test to run
leaves data in the directory, and the second test does not remember
to cleanup the path before using it.

This change adds security manager rules to disallow tests writing
to the working directory. Instead, tests create a temp dir with
the existing test framework.

closes #10605
2015-04-15 12:45:20 -07:00
Areek Zillur c326738193 [FIX] Make GeoContext mapping idempotent
closes #10581
closes #8937
2015-04-15 12:01:24 -04:00
Boaz Leskes 3dd37c06ff Test: testTranslogReplayWithFailure didn't allow for MockDirectoryWrapper being optional 2015-04-14 20:36:32 +02:00
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
Colin Goodheart-Smithe 82df50a039 Aggregations: Fix _as_string output to only show when format specified
Closes #10284
2015-04-14 16:30:18 +01: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
Simon Willnauer 210f6c7b33 [TRANSLOG] Remove useless random translog directory selection
Using ThreadLocalRandom only prevents reproducibilty but doesn't buy us
anything. In production different datapaths won't have the same since
anyway or at least with a low likelyhood.
2015-04-14 15:57:09 +02:00
Christoph Büscher eac922b73b Merge pull request #10592 from cbuescher/remove-matchall-norms
Remove unused normsField from MatchAllQuery
2015-04-14 13:11:05 +02:00
Christoph Büscher c169e792b5 Remove unused normsField from MatchAllQuery 2015-04-14 12:39:05 +02:00
Michael McCandless 8925615eea also log all mounts in node path summary log line; use JmxFsProbe also in non-summarized case 2015-04-14 06:22:24 -04: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
Robert Muir 131431aa54 nuke duplicate copy-paste in AllTermQuery 2015-04-13 18:57:02 -04: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
Lee Hinman fcbe3f92b7 [CORE] Log sending translog operation batches to nodes 2015-04-13 14:59:32 -06: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
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
Adrien Grand 45afa47a6f Upgrade to lucene-5.2.0-snapshot-1673124. 2015-04-13 10:43:58 +02:00
Simon Willnauer d738b3d1e2 [BUILD] Use SuppressFrobidden annotation instead of class level excludes
Forbidden APIs 1.8 allows excludes based on annotations which can now be on methods etc. for more find grained control.

Closes #10560
2015-04-13 10:08:50 +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
Michael McCandless 3cc3390f17 don't return negative percentage when max < 0 2015-04-11 06:02:59 -04: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
Isabel Drost-Fromm 5faac37900 Fix typo in JVM checker user help.
When checking the JVM currently running ES we provide the user with
help on which environment variable to use to disable the check in
case the check fails. The variable we point to however is the wrong
one.
2015-04-10 09:42:11 +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 78612cf0a8 fix indent 2015-04-09 14:47:48 -04: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
Michael McCandless 2f5cbf5f9d Core: log path.data filesystem details to INFO level
This change logs total space, free space, usable free space, an
estimate of whether the IO system spins (e.g., SSD or not), the mount
point and filesystem type, on node startup.

It produces log output like this:

[2015-04-09 12:09:30,244][INFO ][env                      ] [node_t0] node data locations details:
  -> /l/es.logspins/target/J0/data/TEST-haswell-CHILD_VM=[0]-CLUSTER_SEED=[2926863498862121027]-HASH=[AFC194B1B384B]/nodes/0, free_space [260.6gb], usable_space [256.3gb], total_space [465gb], spins? [no], mount [/ (/dev/mapper/haswell--vg-root)], type [btrfs]

Closes #10502
2015-04-09 13:11:49 -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
javanna 4608f868bf add 1.5.2 snapshot version and and make 1.5.1 a released version 2015-04-09 16:15:05 +02:00
Colin Goodheart-Smithe fcc09f62b9 Aggregations: removed aggregations from ReduceContext
ReduceContext contains the list of aggregations to reduce but these aggregations are set as null half of the time. This change makes the reduce(ReduceContext) method changed to reduce(List<InternalAggregation>, ReduceContext) and ReduceContext now only holds the BigArrays and Script services.
2015-04-09 14:58:17 +01:00
Simon Willnauer 3b41299273 Add missing hashCode method to RecoveryState#File 2015-04-09 15:07:28 +02:00
David Pilato 88ee7a5dca Deprecate rivers
* In code, we mark `River`, `AbstractRiverComponent`, `RiverComponent` and `RiverName` classes as deprecated
* We log that information when a cluster is still using it
* We add this information in the plugins list as well
2015-04-09 14:29:16 +02: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
Michael McCandless c9afeccac4 merged 2015-04-09 05:01:53 -04:00
Michael McCandless 9981d69e06 Core: add trace logging for the commitTranslog=false case in InternalEngine.flush 2015-04-09 05:00:40 -04:00
Simon Willnauer 953ae63d2b [TEST] beast slow index to fail with trace logging 2015-04-09 10:47:00 +02:00
Simon Willnauer a243b3f924 [LOGGING] Use static logger name in Engine.java
To ensure subclasses like MockInternalEngine which is in a different
package (test.engine) are logging under the same logger name this commit
moves to a static logger class to determin the logger name. This way
all subclasses of engine will log under `index.engine` which also plays
nicely with `@TestLogging` where log messages sometimes disappeared since
they were enabled for the `index.engine` package but not for `test.engine`
2015-04-09 10:07:50 +02:00
Ryan Ernst a5bfe332e5 Tests: increase logging for lucene commit during flush in InternalEngine 2015-04-09 00:25:05 -07: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
Simon Willnauer f687377e2f [ENGINE] sync translog before closing engine
If the translog is buffered we must make sure everything is synced to disk
before we rollback the writer otherwise we open a window for potential dataloss due
to stupid errors preventing the translog from being closed.
2015-04-08 17:57:33 +02:00
Ryan Ernst 6df978e76e Test: increasing replicas timeout to avoid slowness on virtualized
hardware (aka jenkins)
2015-04-08 08:44:39 -07:00
javanna acabf2d55a Cluster state REST api: print routing_nodes out only when requested through specific flag
For bacwards compatibility reasons routing_nodes were previously printed out when routing_table was requested, together with the actual routing_table. Now they are printed out only when requests through `routing_nodes` flag.

Relates to #10412
Closes #10486
2015-04-08 16:10:36 +02: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
Leonardo Menezes 5fd9aee16e Cluster state REST api: routing_nodes as an independent metric option
Cluster state api returns both routing_table and routing_nodes sections whenever routing_table is requested. That is pretty much the same info, just grouped differently. This commit allows to differentiate between the two. Yet, routing_table still returns both for bw comp reasons.

Closes #10352
Closes #10412
2015-04-08 15:35:11 +02:00
javanna d9aebf4906 Scripting: remove deprecated methods from ScriptService
Removed the following methods from `ScriptService`, which don't require the `ScriptContext` argument:

```
public CompiledScript compile(String lang,  String script, ScriptType scriptType)

public ExecutableScript executable(String lang, String script, ScriptType scriptType, Map<String, Object> vars)

public SearchScript search(SearchLookup lookup, String lang, String script, ScriptType scriptType, @Nullable Map<String, Object> vars)
```

Also removed the ScriptContext.Standard.GENERIC_PLUGIN enum value, as it was used only for backwards compatibility.

 Plugins that make use of scripts should declare their own script contexts through `ScriptModule#registerScriptContext` and use them when compiling/executing scripts.

Closes #10476
2015-04-08 12:20:03 +02: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
javanna df875707ec Indexed scripts/templates: return response body when script is not found
Align get indexed scripts and get search template apis to our get api, which returns a response body when the document is not found, with a found boolean flag. Also, return metadata info all the time too.

Closes #7325
Closes #10396
2015-04-08 10:44:11 +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
jaymode 1edf883bae Netty: make exceptionCaught method protected
The exceptionCaught method had default access, which imposes a requirement
for subclasses that need to override this method to be in a specific package. This
change simply makes the method protected, which removes the package requirement.
2015-04-07 13:09:47 -04: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