Commit Graph

2091 Commits

Author SHA1 Message Date
Simon Willnauer 7999027bf5 apply review comments 2015-10-14 09:19:02 +02:00
Jason Tedor 2e445d3ede Do not pollute Cache with failed futures 2015-10-13 22:14:13 -04:00
Jason Tedor b154c84306 Avoid deadlocks in Cache#computeIfAbsent
This commit changes the behavior of Cache#computeIfAbsent to not invoke
load for a key under the segment lock. Instead, the synchronization
mechanism to ensure that load is invoked at most once per key is
through the use of a future. Under the segment lock, we put a future in
the cache and through this ensure that load is invoked at most once per
key. This will not lead to the same deadlock situation as before
because a dependent key load on the same thread can not be triggered
while the segment lock is held.

Closes #14090
2015-10-13 21:15:28 -04:00
Simon Willnauer cac073dafa enforce that wrappers delegate core cache key and ban getCombinedCoreAndDeletesKey() entirely 2015-10-13 23:31:25 +02:00
Simon Willnauer ec60018e34 add comment why and when we have a leaf reader in the warmer 2015-10-13 21:06:20 +02:00
Simon Willnauer 0ead0faa1b fix typo 2015-10-13 20:51:43 +02:00
Simon Willnauer 1dca0e8f9b Add simple tests to ensure we can load and unload global ordinal with a wrapped reader 2015-10-13 20:51:10 +02:00
Britta Weber f7693b694b fix access denied for shard deletion with WindowsFS
We randomly use the WindowsFS mock file system to simulate that
windows does not delete files if they are opened by some other
process and instead gives you java.io.IOException: access denied.
In the tests we also check if the shard was deleted while it is
being deleted. This check loads the mata data of the index
and therefore might hold on to a file while the node
is trying to delete it and deletion will fail then.

Instead we should just check if the directory was removed.

closes #13758
2015-10-13 18:33:53 +02:00
Simon Willnauer e3f00e302c Add more pickyness to index warming and searcher wrappping
this commit also fixes a bug where we wramed a leaf reader in a top level context
which caused atomic segment readers to be used in our top level caches.
2015-10-13 17:21:46 +02:00
Simon Willnauer dac1799305 Cast DirectoryReader only when really requested 2015-10-13 17:21:46 +02:00
Simon Willnauer ba8de12429 remove unnecessary cast 2015-10-13 17:21:46 +02:00
Simon Willnauer bd5ac9ce1a enforce DirectoryReader when globals are loaded 2015-10-13 17:21:46 +02:00
Simon Willnauer d3436ff592 Streamline top level reader close listeners and forbid general usage
IndexReader#addReaderCloseListener is very error prone when it comes to
caching and reader wrapping. The listeners are not delegated to the sub readers
nor can it's implementation change since it's final in the base class. This commit
only allows installing close listeners on the top level ElasticsearchDirecotryReader
which is known to work an has a defined lifetime which corresponds to its subreader.
This ensure that cachesa re cleared once the reader goes out of scope.
2015-10-13 17:21:18 +02:00
jaymode 077a401c28 [TEST] do not wipe excluded templates
In #13606, the ability to exclude a template from being wiped was added but a call to
wipeTemplates() was not removed, so all index templates were still being removed.

This change removes the wipeTemplates() call in the wipe method so that only the
non-excluded templates are removed.
2015-10-13 09:59:32 -04:00
javanna 4d7d29f65b Plugins: plugin script to set proper plugin config dir attributes
Depending on how elasticsearch is installed, we have two scenarios to take into account that relate to user, group and permissions assigned to the config directory:

1) deb/rpm package: /etc/elasticsearch is root:elasticsearch 750 and the plugin script is run from root user
2) tar/zip archive: es config dir is most likely elasticsearch:elasticsearch and the plugin script is most likely run from elasticsearch user

When the plugin script copies over the plugin config dir within the es config dir, it should take care of setting the proper user, group and permissions, which vary depending on how elasticsearch was installed in the first place. Should be root:elasticsearch 750 if installed from a package, or elasticsearch:elasticsearch if installed from an archive.

This commit makes sure that the plugin script looks at user, group and permissions of the config dir and copies them over to the plugin config subdirectory, whatever they are, so that they get properly setup depending on how elasticsearch was installed in the first place. We also make sure that execute permissions are left untouched for files.

Relates to #11016
Closes #14048
2015-10-13 15:56:26 +02:00
Britta Weber 1634c8364e Merge pull request #14085 from brwe/fix-score-accuracy
fix numerical issue in function score query
2015-10-13 15:21:04 +02:00
Jason Tedor b7e09582ce Merge pull request #14087 from jasontedor/vle-integral-arrays
Add methods for variable-length encoding integral arrays
2015-10-13 09:12:10 -04:00
Robert Muir ceb969a13e Make PerThreadIDAndVersionLookup per-segment
Closes #14070

Squashed commit of the following:

commit ad5829e590cf6150763c31886e97d69976b7f02d
Author: Robert Muir <rmuir@apache.org>
Date:   Tue Oct 13 06:50:25 2015 -0400

    Add more tests for version map caching

commit 617333eefd6d4ddc99db491d0843827b1b5936b2
Author: Robert Muir <rmuir@apache.org>
Date:   Mon Oct 12 13:25:51 2015 -0400

    fix javadocs ref

commit 9626dd02e01a2676538e1071e302d882fc870837
Author: Robert Muir <rmuir@apache.org>
Date:   Mon Oct 12 13:23:16 2015 -0400

    make the version map cache per-segment
2015-10-13 09:00:04 -04:00
Yannick Welsch a550ebf381 Merge pull request #13998 from ywelsch/tests/transportmasternodeaction
Tests for TransportMasterNodeAction
2015-10-13 05:48:40 -07:00
Jason Tedor 2162172f30 Add methods for variable-length encoding integral arrays
This commit adds methods to serialize the elements of int and long
arrays using variable-length encodings. This can be useful for
serializing int and long arrays containing mostly non-negative “not
large” values in a compressed form.
2015-10-13 08:47:42 -04:00
Yannick Welsch c2df88a21d [TEST] Add tests for TransportMasterNodeAction
Closes #13998
2015-10-13 14:46:59 +02:00
Britta Weber d021b1bfeb assert that doc was actually found 2015-10-13 14:35:32 +02:00
Yannick Welsch 57770d4d6c Fix import in SharedClusterSnapshotRestoreIT 2015-10-13 13:56:46 +02:00
Yannick Welsch 889edd00f0 Merge pull request #13931 from ywelsch/fix/index-settings-restore
Snapshot restore and index creates should keep index settings and cluster blocks in sync
2015-10-13 04:36:02 -07:00
Britta Weber 318dfba464 use same score computation for actual scoring and explanation
FiltersFunctionScoreQuery sums up scores and weights and scores as double but when
we explain we cannot get the double scores from the explanation of score
functions. as a result we cannot compute the exact score from the explanations
of the functions alone.
this commit makes the explanation more accurate but also causes the score to be
computed one additional time.
2015-10-13 13:30:53 +02:00
Robert Muir a68c163959 Merge pull request #14064 from rmuir/blinded_forever
Allow tests to run from eclipse on windows
2015-10-13 06:58:19 -04:00
Britta Weber 17ce5d5242 fix numerical issue in function score query
we should sum the weights as double to not lose precision. also,
the tests should simulate exactly what function score does and then test
for equality of scores.
2015-10-13 11:54:37 +02:00
Simon Willnauer 6120f26c40 Remove unused clear(IndexReader) method from IndexFieldData
This method is unused can can simply be removed. It's rather confusing
instead since it's another way of invalidating a cache entry but not through
the close listener.
2015-10-13 11:32:31 +02:00
Andreas Kohn 03cb92f99f Fix the quotes in the explain message for a script score function without parameters 2015-10-13 10:59:17 +02:00
Colin Goodheart-Smithe ca76712de6 Merge branch 'master' into feature/search-request-refactoring 2015-10-13 08:18:17 +01:00
Adrien Grand d3aa3565db Deprecate `index.analysis.analyzer.default_index` in favor of `index.analysis.analyzer.default`.
Close #11861
2015-10-12 22:19:16 +02:00
Robert Muir 9072f4ffbf Support "bogus" windows classpath entries in JarHell. 2015-10-12 08:08:11 -04:00
Colin Goodheart-Smithe 6819224d2c Merge branch 'master' into feature/search-request-refactoring
# Conflicts:
#	core/src/main/java/org/elasticsearch/search/SearchService.java
#	core/src/test/java/org/elasticsearch/cluster/ClusterStateDiffIT.java
#	core/src/test/java/org/elasticsearch/search/fetch/FetchSubPhasePluginIT.java
2015-10-12 12:54:14 +01:00
Christoph Büscher affe2f2bcc Tests: Avoid unicode strings for alternative versions in query builder tests 2015-10-12 12:38:14 +02:00
Yannick Welsch 069b397794 Snapshot restore and index creates should keep index settings and cluster blocks in sync
Restoring an index from a snapshot or creating a new index can bring the index settings index.blocks.read_only, index.blocks.read, index.blocks.write and index.blocks.metadata out-of-sync with the corresponding cluster blocks.

Closes #13931
2015-10-12 11:56:00 +02:00
Simon Willnauer 1cb30c3a49 Fold IndexAliasesService into IndexService
The IndexAliasesService abstraction only adds unnecessary code and classes
and can be removed. This commit folds the rather simple methods in this
class into IndexService where the IndexAliasesService was obtained from in the past.
2015-10-11 21:48:22 +02:00
Simon Willnauer 1205c66cfb [TEST] only use internal API if we are running against an internal cluster 2015-10-11 20:54:54 +02:00
Jason Tedor e95af69fb7 Remove Deprecated tags from o.e.c.c.MapBuilder#immutableMap 2015-10-09 16:07:19 -04:00
Jason Tedor 9a9a6a4b3b Remove Guava as a dependency
This commit removes Guava as a dependency. Note that Guava will remain
as a test-only dependency (transitively through Jimfs).

Closes #13224
2015-10-09 14:19:22 -04:00
Nik Everett 27f43e2e39 Remove files accidentally re-added during merge 2015-10-09 12:08:22 -04:00
Nik Everett beeea145d8 Remove forbidden-apis check for cluster
This was useful during the ImmutableMap removal but shouldn't be needed
for normal development.
2015-10-09 12:04:48 -04:00
Nik Everett d9e11e4b39 Merge branch 'master' into immutable_map_be_gone 2015-10-09 12:04:03 -04:00
Jason Tedor 50368b3704 Merge pull request #13879 from jasontedor/straight-cache-homey
Replace Guava cache with simple concurrent LRU cache
2015-10-09 11:56:15 -04:00
Jason Tedor 59c90496a6 Mutating the cache while iterating is undefined 2015-10-09 11:28:05 -04:00
Jason Tedor 01495172d2 Release locks in reverse order of acquisition 2015-10-09 11:10:52 -04:00
Nik Everett 9492223c2b Clean up DiskThreasholdDeciderUnitTests
They had made some routing table changes that weren't working. This fixes
the changes to do what they intended.
2015-10-09 10:38:22 -04:00
Nik Everett 56318df10c Be more careful with RoutingTable.Builder
RoutingTable.Builder#build can only be called once but didn't have any
checks to make sure it _was_ only called once. And the error message it
threw when called more than once was a NullPointerException. This makes
it throw IllegalStateException when you try to reuse the builder in any way.
2015-10-09 10:28:13 -04:00
Nik Everett bfb9054a11 Remove addAll(Collection, Iterable<ObjectCursor>)
It was used just one time and didn't add any value.
2015-10-09 10:12:54 -04:00
Jason Tedor 0f23f8e5f1 Remove unused import in o.e.p.PluginManagerIT 2015-10-09 08:53:17 -04:00
javanna d5e6f34e68 Plugins: fix error message while copying plugin config dir
The destination directory is the plugin config dir, not bin. Also updated existing code to reuse already declared destBin and destConfig variables.
2015-10-09 14:31:25 +02:00
Colin Goodheart-Smithe 05147f7f66 Merge pull request #14018 from kufi/master
Added correct generic type parameter on ScriptedMetricBuilder
2015-10-09 10:43:34 +01:00
Adrien Grand 275da4821e Cleanup the Lucene utility class.
- removes Lucene.count(IndexSearcher,Query) in favor of IndexSearcher.count(Query)
 - removes EarlyTerminatingCollector.reset(): reusing Collector objects does not
   help given that query execution needs to allocate objects (weights, scorers)
   anyway
 - adds unit tests to Lucene.exists
2015-10-09 10:16:12 +02:00
xuzha 7b5964f9c5 Add response into ClearScrollResponse
When deleting an individual scroll ID, ES does produce a 200 in the
header if successful and a 404 if the scroll ID wasn't found, but
returns empty response body. It will be more user friendly to provide
some information on whether the scroll deletion is successful.
2015-10-08 20:46:39 -07:00
Jason Tedor a6abb4fcdd Comment regarding synchronization in Cache#computeIfAbsent 2015-10-08 18:15:52 -04:00
Jason Tedor 881593eea9 Safe locking and unlocking of segments during invalidation 2015-10-08 17:56:43 -04:00
Jason Tedor a556e31010 Safety assertions on head and tail modifications 2015-10-08 17:51:16 -04:00
Jason Tedor 818d217ede Preserve copy of head after taking lock on LRU list 2015-10-08 17:46:00 -04:00
Jason Tedor e0fa3297bd Use longs for Cache.CacheStats to avoid overflow 2015-10-08 17:43:15 -04:00
Simon Willnauer 0a22a3af31 drop binary mapping BWC test 2015-10-08 20:19:27 +02:00
Simon Willnauer fcae618c8c Drop pre 1.4 binary numeric docvalues support 2015-10-08 20:19:27 +02:00
Simon Willnauer 9a662de422 Fix min supported version 2015-10-08 20:19:27 +02:00
Simon Willnauer 61c7302bfb fix bwc test for hashing / routing and simplify test to be a real unittest 2015-10-08 20:19:27 +02:00
Simon Willnauer 7329493783 Drop legacy hashfunctions - these tests don't work anymore since we dropped support for them 2015-10-08 20:19:27 +02:00
Simon Willnauer 48162fa90b remove another redundant test 2015-10-08 20:19:26 +02:00
Simon Willnauer 867882cd32 remove unnecessary bwc tests 2015-10-08 20:19:26 +02:00
Simon Willnauer 4d38b8f959 revert rather more complex simplification 2015-10-08 20:19:26 +02:00
Simon Willnauer 50907d5b7d apply review comments 2015-10-08 20:19:26 +02:00
Simon Willnauer dee94c798c add additional checks for version compatibility 2015-10-08 20:19:26 +02:00
Simon Willnauer 39891594f0 Remove support for pre 2.0 indices
This commit removes all index level compatibilty and upgrade paths for
pre 2.0 indices. This includes:

 * Remove leftover from delete_by_query to replay translog records,
since in 3.x all pending delelte_by_query instances are applied on the
upgrade to 2.x we can remove the bwc layer now.

 * Remove Elasticsearch090PostingsFormat - we maintained our own posting format
until 2.0 this is now removed since folks need to upgrade to 2.x first before going
to 3.0
 * Remove BloomFilterPostingFormat - this was only used for ID fields in the Elasticsearch090PostingsFormat
 * Remove upgrade methods to pre 2.0 translogs without checkpoints
2015-10-08 20:19:25 +02:00
Jason Tedor 9ca032ae9d Enforce strict eviction semantics 2015-10-08 12:42:36 -04:00
Jason Tedor 8d33be83b7 Cache#computeIfAbsent should throw if loader returns null value 2015-10-08 12:21:30 -04:00
Jason Tedor 02a7d9a565 Correct semantics when loading absent values 2015-10-08 12:04:02 -04:00
Jason Tedor d720364b18 Cache.segments can be final 2015-10-08 12:01:18 -04:00
Jason Tedor 35dc287f59 More rigorous test around Cache evictions occurring in LRU order 2015-10-08 11:56:45 -04:00
Jay Modi af068fcd14 Merge pull request #14030 from jaymode/render_search_client
move render search template methods to cluster admin client
2015-10-08 10:41:42 -04:00
jaymode c443e695cc move render search template methods to cluster admin client
In #13971, the RenderSearchTemplateAction was made a cluster level action but the client methods
were not moved from the IndicesAdminClient. This is an inconsistency and this change cleans up the
inconsistency so that the client methods are now part of the ClusterAdminClient since the action is now
considered a cluster level action.
2015-10-08 10:28:28 -04:00
Adrien Grand 7400cbe5fd Remove UpdateTests' dependency on groovy.
This test had to be moved to lang-groovy when groovy has been made a plugin.
I refactored it a bit to use mock plugins instead so that groovy is not
necessary anymore and it can come back to core.
2015-10-08 16:19:00 +02:00
Adrien Grand ef3172c8b0 Merge pull request #14020 from jpountz/enhancement/less_lenient_license_checks
Make license checks a bit less lenient.
2015-10-08 15:21:23 +02:00
Colin Goodheart-Smithe e0a78fdf2c Merge branch 'master' into feature/search-request-refactoring 2015-10-08 13:30:54 +01:00
jaymode 0c8377a0bd rename the RenderSearchTemplateAction to be a cluster level action
The RenderSearchTemplateAction is currently a "indices" action, but the action does not really apply to
indices, it is more of a general action that is used to validate the search template. With our current
categorization of actions, `cluster:` and `indices:`, `cluster:` is a more appropriate type as this action
is not associated with indices. The classes are also moved to a cluster package.
2015-10-08 08:06:14 -04:00
Colin Goodheart-Smithe 83771d36a8 more test fixes 2015-10-08 13:05:09 +01:00
Martijn van Groningen 78921e0486 test: removed the usage of String.valueOf(...), java 8 type inference correctly selects String as type during compile time 2015-10-08 12:51:53 +02:00
Simon Willnauer 666c172ee2 Add minimal javadocs for StreamInput#readGeoPoint() 2015-10-08 12:51:25 +02:00
Colin Goodheart-Smithe 4557d1b560 Merge branch 'master' into feature/search-request-refactoring
# Conflicts:
#	plugins/lang-groovy/src/test/java/org/elasticsearch/messy/tests/FunctionScoreTests.java
2015-10-08 11:39:34 +01:00
Colin Goodheart-Smithe 7aaba20420 more fixes from review 2015-10-08 11:33:45 +01:00
Simon Willnauer cc40f20544 Remove unnecessary Writeable implementation from GeoPoint
GeoPoint now has native support in StreamOutput/StreamInput
impementing Writable is not necessary. This also adds tests
for XContentBuilder rendering GeoPoint
2015-10-08 12:33:14 +02:00
Martijn van Groningen 42d7bfdf12 test: add explicit generic type to get around a strange issue where the inferred type is char[] while Object is expected. 2015-10-08 12:09:12 +02:00
Simon Willnauer a46cf97388 Merge branch 'pr-13632' 2015-10-08 12:04:08 +02:00
Simon Willnauer 77a328a91f Add unittest for GeoPoint seriazliation and corresponding writeGeoPoint method 2015-10-08 12:02:19 +02:00
Adrien Grand 82d1c6a930 Make license checks a bit less lenient.
This fixes license checks to apply to all java files under src/ as opposed to
only those in the org.elasticsearch package. It found some license headers that
had to be reformatted. I also added a missing license header to Nullability.java
however this has not be caught by the license checker since it ignores guice
files.

Relates to #13703
2015-10-08 11:41:15 +02:00
Patrick Kaufmann cf13c78339 Added correct generic type parameter on ScriptedMetricBuilder
Make ScriptedMetricBuilder class declaration consistent with all other Builder declarations
2015-10-08 11:16:25 +02:00
Alexander Reelsen 2b43a1cec2 Tests: Added missing check if permissions are supported on the filesystem
Two test methods didnt have the required check for permissions, so they were
not skipped under windows, leading to CI failures.
2015-10-08 10:58:19 +02:00
Colin Goodheart-Smithe c69cde4ee4 review fixes 2015-10-08 09:30:14 +01:00
Alexander Reelsen 70b2d90a79 PluginManager: Dont leave leftover files on unsuccessful installs
If the plugin manager cannot successfully install a plugin, ensure
that every directory is cleaned up again. This includes

plugins/foo
config/foo
bin/foo

Closes #12749
2015-10-08 10:04:52 +02:00
Michael McCandless 9688e86b38 Merge pull request #13918 from mikemccand/immediate_shard_active
When shard becomes active again, immediately increase its indexing buffer instead of waiting for up to 30 seconds while indexing with a tiny (500 KB) indexing buffer.
2015-10-08 03:53:32 -04:00
Simon Willnauer 7e53123f1f Merge pull request #14000 from s1monw/issues/12730
Don't pull translog from shadow engine
2015-10-08 09:43:56 +02:00
Simon Willnauer 255338111b test and fix TranslogStats - you wouldn't believe how hard it is to sum up two values 2015-10-08 09:24:22 +02:00
David Pilato c73ab50df1 Rename cloud-gce plugin to discovery-gce plugin
Follow up azure and aws splits, we need to be consistent and rename `cloud-gce` to `discovery-gce`.
2015-10-08 06:53:37 +02:00
Jason Tedor 23cd64b767 Merge pull request #13903 from jasontedor/evicting-queue-be-gone
Remove and forbid use of com.google.common.collect.EvictingQueue
2015-10-07 21:04:59 -04:00
Robert Muir 780ccb98e8 Test: add address formatting round trip tests 2015-10-07 20:57:55 -04:00