Commit Graph

10802 Commits

Author SHA1 Message Date
Simon Willnauer 8d7ce3c558 [STORE] Expose ShardId via LeafReader rather than Direcotry API
Today we try to fetch a shard Id for a given IndexReader / LeafReader
by walking it's tree until the lucene internal SegmentReader and then
casting the directory into a StoreDirecotory. This class is fully internal
to Elasticsearch and should not be exposed outside of the Store.

This commit makes StoreDirectory a private inner class and adds dedicated
ElasticsearchDirectoryReader / ElasticserachLeafReader exposing a ShardId
getter to obtain information about the shard the index / segment belogs to.

These classes can be used to expose other segment specific information in
the future more easily.
2014-12-08 12:10:28 +01:00
Simon Willnauer a43259eba4 Add more trace loggin to LocalIndexShardGateway.java 2014-12-08 12:07:16 +01:00
tlrx a046ee756d Scripting: Add explicit error message when script_score script returns NaN
When a scoring script returns not a number, the current message is confusing (IllegalArgumentException[docID must be >= 0 and < maxDoc=3 (got docID=2147483647)]). This commit adds the error message ScriptException[script score function returns a wrong score: NaN].

Closes #2426
2014-12-08 10:14:01 +01:00
Alexander Reelsen 7b64a5c2c8 Packaging: Check if proc file exists before calling sysctl
The packaged init scripts could return an error, if the file
/proc/sys/vm/max_map_count was not existing and we still called
sysctl.

This is primarly to prevent confusing error messages when elasticsearch
is started under virtualized environments without a proc file system.

Closes #4978
2014-12-08 09:56:14 +01:00
Boaz Leskes 2bc48a4806 Tests: move RecoverAfterNodesTests to org.elasticsearch.gateway.local and increase BLOCK_WAIT_TIMEOUT to 10s
The tests were still in org.elasticsearch.gateway.none but the none gateway was removed.
2014-12-07 22:10:11 +01:00
Simon Willnauer 3cdf266d4d [ALLOCATION] Speed-up disk-threshold decider
Instead of iterating all shards of all indices to get all relocating
shards for a given node we can just use the RoutingNode#shardsWithState
method and fetch all INITIALIZING / RELOCATING shards and check if they
are relocating. This operation is much faster and uses pre-build
data-structures.

Relates to #6372
2014-12-06 22:03:37 +01:00
Jun Ohtani d78d2ff93d Docs: add randomizedtesting-runner to testing-framework.asciidoc
Close #8450
2014-12-07 01:30:58 +09:00
Patrick Koenig 00275ac1d6 Clarify InternalIndexShard callbacks
This commit changes internal callback to be clear
about when they are called and also provide the
exception that was potentially thrown as a callback argument.

Closes #5945
2014-12-05 23:55:32 +01:00
Igor Motov 0b024ad2f3 Snapshot/Restore: switch to write once mode for snapshot metadata files
This commit removes creation of in-progress snapshot file and makes creation of the final snapshot file atomic.

Fixes #8696
2014-12-05 12:39:24 -05:00
Simon Willnauer 0bab17ffde [TEST] wait unitl all machines joined the cluster 2014-12-05 18:12:00 +01:00
Lee Hinman d32f1a8ad0 [TESTS] Log what the _default_ template is in ElasticsearchIntegrationTest 2014-12-05 14:45:24 +01:00
Lee Hinman caa5af4bf6 [TESTS] Use a _default_ template to load field data lazily
Previously it was possible for the field data clearing in this test to
take too long, causing the test to time out.

This also switches to using `scaledRandomIntBetween` for the number of
fields.
2014-12-05 14:45:17 +01:00
Thilo Fromm 3d03c39ae6 Packaging: Make ES user own plugins dir, remove on uninstall
This change will chown /usr/share/elasticsearch/plugins to the elasticsearch
user (the directory was formerly owned by root). This enables the ES user to
manage plugins.

Also, /usr/share/elasticsearch/plugins is now removed when the elasticsearch
package is un-installed. Previously it was left lying there.

Closes #8732

Signed-off-by: Thilo Fromm <github@thilo-fromm.de>
2014-12-05 14:25:15 +01:00
Thilo Fromm 98d18c4bd9 deb: add systemd service config for upcoming Jessie
This change adds a systemd service configuration file, and adds systemd logic
to installation and de-installation scripts. The upcoming Debian 8 "Jessie"
release will use systemd.

fixes #8943

Signed-off-by: Thilo Fromm <github@thilo-fromm.de>
2014-12-05 12:25:48 +01:00
Adrien Grand 344bbf2ced Docs: Add instructions to start elasticsearch on bootup on RHEL/Fedora. 2014-12-05 11:14:13 +01:00
tristanbob 0a09f1ea13 Docs: Added a command to start elasticsearch on bootup on Debian.
Close #8600
2014-12-05 11:03:32 +01:00
Louis Sautier 6c2abcc754 Debian package: Prevent init script from returning when the service isn't actually started.
Close #6909
2014-12-05 10:26:31 +01:00
Boaz Leskes 72155311f0 Gateway: GatewayService should register cluster state listener before checking for current state
At the moment we may miss a state change and fail to recover on time.

Closes #8789
2014-12-05 10:22:20 +01:00
John Michael Luy 27724bef6a Typo in error message with too few points for geo polygon filter.
Closes #8767
2014-12-04 20:20:21 +01:00
Simon Willnauer b8687163c4 [TEST] produce valid symlinks in tests 2014-12-04 17:02:38 +01:00
Martijn van Groningen 7ac713aedc Core: surgically removed slow scroll, because master (2.0) requires full cluster restart coming from previous versions. 2014-12-04 15:56:03 +01:00
Simon Willnauer 8b5bc2643e [Store] Only fail recovery if files are inconsistent
the recovery diff can return file in the `different` category
since it's conservative if it can't tell if the files are the same.
Yet, the cleanup code only needs to ensure both ends of the recovery
are consistent. If we have a very old segments_N file no checksum is present
but for the delete files they might be such that the segments file passes
the consistency check but the .del file doesn't sicne it's in-fact the same
but this check was missing in the last commit.
2014-12-04 15:48:40 +01:00
Simon Willnauer 164853fd0b [TEST] Fix Link permission to create symoblic links in temp dirs 2014-12-04 15:11:34 +01:00
javanna ad004072bb Internal: remove optional original indices
Original indices are optional in ShardDeleteByQueryRequest only for backwards compatibility, see #7406. We can remove this in master since 2.0 will require a full cluster restart.

Closes #8777
2014-12-04 14:25:46 +01:00
javanna 95c2d844a9 Internal: remove some more bwc code
Some more code that was left for backwards compatibility can now be removed on master since 2.0 will require a full cluster restart.

Closes #8778
2014-12-04 14:07:58 +01:00
javanna 5f329bd607 Internal: remove bwc leftover
This caused some test failures as the readFrom method was not in sync anymore with the writeTo
2014-12-04 13:38:20 +01:00
Simon Willnauer 219bb88bc2 Remove runtime version checks
This cleanup commmit removes a large protion of the versioned reads / writes
in the network protocol since master requires a full cluster restart.
2014-12-04 11:31:29 +01:00
Simon Willnauer f4052fd936 Factor out PID file creation and add tests
This commit factors out the PID file creation from bootstrap and adds
tests for error conditions etc. We also can't rely on DELETE_ON_CLOSE
since it might not even write the file depending on the OS and JVM implementation.
This impl uses a shutdown hook to best-effort remove the pid file if it was written.

Closes #8771
2014-12-04 11:12:16 +01:00
Simon Willnauer ab0e3a6db2 [CLIENT] Add internal liveness action
This commit adds a very lightweight action to the transport
serivce that allows to fetch clustername and the discovery node
from a node. This is used by transport clients to test liveness of
a node without using the nodesinfo API which can be blocking if management
threadpools are busy.

Closes #8763
2014-12-04 10:49:20 +01:00
Sebastian Ziebell ab001cf8e3 API endpoint cluster.put_settings accepts timeout & master_timeout query parameters
Closes #8769
2014-12-04 09:14:20 +01:00
David Pilato 26a0976adb [Doc] Java API: add information on JBoss EAP
Closes #3445.
2014-12-03 17:02:02 +01:00
David Pilato 778f76adea [Doc] Java API: add search templates
Closes #7321.
2014-12-03 16:45:30 +01:00
javanna 171e718f88 [DOCS] Document ActionNamesTests 2014-12-03 16:28:36 +01:00
javanna 6ccb46ef37 [TEST] remove action names bwc layer
The bwc layer added with #7105 is not needed in master as a full cluster restart will be required, thus from 2.0 on the only supported action names are compliant to the defined conventions and don't need to be converted to the old format

Closes #8758
2014-12-03 16:18:43 +01:00
David Pilato d2a2d1bb53 java: QueryBuilders cleanup: remove deprecated
Related to #8667:

Some QueryBuilders have been deprecated in 1.x branches. We removed them in 2.0.

Removed
-------

* `textPhrase(...)`
* `textPhrasePrefix(...)`
* `textPhrasePrefixQuery(...)`
* `filtered(...)`
* `inQuery(...)`
* `commonTerms(...)`
* `queryString(...)`
* `simpleQueryString(...)`

Closes #8721.
2014-12-03 16:07:34 +01:00
David Pilato f37355a427 [Doc] Add an UpdateRequest example to Java API doc
Closes #7083.
2014-12-03 16:03:24 +01:00
Simon Willnauer d732077900 [TEST] Wait for yellow before running rescorer tests 2014-12-03 10:03:45 +01:00
Simon Willnauer 921e028e99 [PLUGIN] Don't use atomic move when installing plugin
the extract location might be on a different filesystem where
atomic move won't work. Yet this operation is not critical in terms
of visibility so there is no need to do this.
2014-12-03 09:48:49 +01:00
Simon Willnauer a436da7cdb [PLUGIN] don't set posix permission on filesystem that don't support it 2014-12-03 09:47:54 +01:00
javanna 36e12d39fd [TEST] guarantee REST tests execution order
REST tests are being shuffled before their execution. To guarantee their repeatability given the seed, their order needs to be always the same before the shuffling happens.

Closes #8745
2014-12-03 08:36:15 +01:00
Simon Willnauer 3dfff84043 Revert back APIs that resolve files from classpath to java.net.URL
The conversion to the Path API doesn't work if the path points
to a file inside a JAR like a config. These path must be read
while the ZIP filesystem is opened which can't be guaranteed across
the board. This commit reverts back the relevant changes to java.net.URL
and adds a util method to read UTF-8 Encoded files from URLs correctly.
2014-12-03 00:09:35 +01:00
Simon Willnauer a6510f9245 Add File.java to forbidden APIs
This commit cuts over all of core (not quite all tests) to java.nio.Path
It also adds the file class to the core forbidden APIs to prevent its usage.

This commit also resolves #8254 since we now consistently useing the NIO Path
API. The Changes in this commit allow for more information if IO operations fail
since the NIO API throws exceptions instead of boolean return values. The build-in
methods used in this commit are also more resillient to encodeing errors like
unmappable characters and throw exceptions if those chars are present in a file.

Closes #8254
Closes #8666
2014-12-02 21:29:26 +01:00
Simon Willnauer d8f16178d3 Override write(byte[] b, int off, int len) in FilterOutputStream for better performance
Closes #8748
2014-12-02 21:20:53 +01:00
Adrien Grand 943dbb8ab6 Fix resource description of VerifyingIndexOutput. 2014-12-02 19:26:17 +01:00
Peter Johnson a.k.a. insertcoffee ac71f1b70a [docs] formatting and general pedantry
I'm not sure if the `distance-units` section is totally clear, when using the 'Geohash Cell Filter' and omitting a unit, the default is to interpret the integer as the 'length of the geohash prefix', not to default it to 'meter'. Maybe I'm being pedantic.

Closes #8744
2014-12-02 19:23:48 +01:00
Simon Willnauer 48ec6599c2 [TEST] use private randomness in InternalTestCluster 2014-12-02 18:22:44 +01:00
John Michael Luy 01ef80a33d Update range-filter.asciidoc
Closes #8741
2014-12-02 18:00:38 +01:00
Simon Willnauer e3ed471d30 [TEST] speed up tests by reducing the recovery retry by default 2014-12-02 17:43:06 +01:00
Adrien Grand eba2bd51c1 Core: Upgrade to lucene-5.0.0-snapshot-1642891.
The only required change was to add a description to our index outputs.

Close #8743
2014-12-02 17:38:53 +01:00
Martijn van Groningen a8a5391255 Removed 1.x version check 2014-12-02 14:56:12 +01:00