Commit Graph

10328 Commits

Author SHA1 Message Date
Simon Willnauer 17110508ac Add missing await into an interruptable block 2014-11-20 15:35:08 +01:00
Britta Weber 06e907d99e Revert "[TEST] use logger level from test class annotation also in external nodes"
This reverts commit 4604a68bef.
2014-11-20 15:29:44 +01:00
Simon Willnauer 0fcb466555 [STORE] Remove `memory`/ `ram` store
The RAM store is discuraged for production usage anyway and
we don't test it in our randomized infrastructure. This commit
removes it for `2.0`
2014-11-20 14:47:19 +01:00
markharwood 0c94314996 Parser throws NullPointerException when Filter aggregation clause is empty.
Added Junit test that recreates the error and fixed FilterParser to default to using a MatchAllDocsFilter if the requested filter clause is left empty.
Also added fix and test for the Filters (with an "s") aggregation.

Closes #8438
2014-11-20 13:06:11 +00:00
Britta Weber 4b5592cc59 [root mappers] fix conflict when updating mapping with _all disabled
_all reports a conflict since #7377. However, it was not checked if _all
was actually configured in the updated mapping. Therefore whenever _all
was disabled a mapping could not be updated unless _all was again added to the
updated mapping.
Also, add enabled setting to mapping always whenever enabled was set explicitely.

closes #8423
closes #8426
2014-11-20 12:46:27 +01:00
Britta Weber 4604a68bef [TEST] use logger level from test class annotation also in external nodes
closes #8552
2014-11-20 12:04:08 +01:00
Adrien Grand dc3389a97a Tests: Fix test bug in Filter[s]Tests that made it throw a version conflict. 2014-11-20 11:30:49 +01:00
Adrien Grand a94fb92ac5 Aggregations: Fix geohash grid aggregation on multi-valued fields.
This aggregation creates an anonymous fielddata instance that takes geo points
and turns them into a geo hash encoded as a long. A bug was introduced in 1.4
because of a fielddata refactoring: the fielddata instance tries to populate
an array with values without first making sure that it is large enough.

Close #8507
2014-11-20 10:03:56 +01:00
Adrien Grand f30a0e846d Aggregations: Do not take deleted documents into account in aggregations filters.
Since aggregators are only called on documents that match the query, it never
gets called on deleted documents, so by specifying `null` as live docs, we very
likely remove a BitsFilteredDocIdSet layer.

Close #8540
2014-11-20 09:59:13 +01:00
Ryan Ernst cca5934e9d Tests: Pass through locale and timezone to test runner, and print in
repro command line.

The carrot runner currently randomizes both locale and timezone, but
these are not set in the maven reproduce line.  Since they aren't
even printed, we have no idea what locale/timezone the tests
actually ran with.
2014-11-19 22:01:26 -08:00
Ryan Ernst a0b7e5842d Tests: Forward port tweak to prepareBackwardsDataDir to 1.x to allow passing
settings when loading an old index.
2014-11-19 16:54:41 -08:00
Ryan Ernst 4f225007f0 Tests: Add static index based backcompat tests
This change adds tests against static indexes for previous versions
of elasticsearch. It also adds a python script to
generate the indexes.
2014-11-19 15:56:04 -08:00
Simon Willnauer 5763116dbe Revert "[TEST] Add search trace logging for debugging"
This reverts commit a7b2bdca4c.
2014-11-20 00:12:01 +01:00
Simon Willnauer 4df867fd17 Revert "[CORE] Free pending search contexts if index is closed"
This reverts commit edc48f39c5.
2014-11-20 00:10:43 +01:00
Martijn van Groningen 52b77dad8d Test: Fix malformed mapping setting, slipped in from merging a commit from 1.x 2014-11-19 23:51:21 +01:00
Martijn van Groningen 7cc2bc8a14 Core: Added query/filter wrapper that builds the actual query to be executed on the last possible moment to aid with index aliases and percolator queries using `now` date expression.
Percolator queries and index alias filters are parsed once and reused as long as they exist on a node. If they contain time based range filters with a `now` expression then the alias filters and percolator queries are going to be incorrect from the moment these are constructed (depending on the date rounding).

 If a range filter or range query is constructed as part of adding a percolator query or a index alias filter then these get wrapped in special query or filter wrappers that defer the resolution of now at last possible moment as apposed during parse time. In the case of the range filter a special Resolvable Filter makes sure that `now` is resolved when the DocIdSet is pulled and in the case of the range query `now` is resolved at query rewrite time. Both occur at the time the range filter or query is used as apposed when the query or filter is constructed during parse time.

Closes #8474
Closes #8534
2014-11-19 23:21:39 +01:00
Simon Willnauer a7b2bdca4c [TEST] Add search trace logging for debugging 2014-11-19 23:13:45 +01:00
Simon Willnauer 043f18d5ff [RECOVERY] Allow to cancle recovery sources when shards are closed
Today recovery sources are not cancled if a shard is closed. The recovery target
is already cancled when shards are closed but we should also cleanup and cancel
the sources side since it holds on to shard locks / references until it's closed.
2014-11-19 22:50:30 +01:00
Simon Willnauer edc48f39c5 [CORE] Free pending search contexts if index is closed
Today we hold on to search context reference if they are not cleaned
up for a while until a reaper thread trashes them if they timed out.
This commit removes all pending contexts once the index is closed to release
resources and filehandles immediatly once the index is closed.
2014-11-19 21:44:51 +01:00
Boaz Leskes fb81a3203b Internal: IndexService - synchronize close to prevent race condition with shard creation
During node shutdown we have a race condition between processing cluster state updates (creating shards) and closing down the index service. This may cause shards to leak and not be closed properly.

This commit removes the concurrency in shard closing as InternalIndexService.removeShard has been synchronized for a long time now.

On the other hand, the commit restores the parallel shutdown of indices lost in 7e1d8a6ca3

Closes #8557
2014-11-19 21:31:10 +01:00
Philipp Bogensberger 69ac838259 Fix: If dangling_timeout was set to 0 and auto_import_dangled
was set to yes, dangling indices were deleted by mistake,
because a RemoveDanglingIndices runnable was added
to every dangling indices, without considering the auto_import_dangled
setting.
2014-11-19 15:08:57 +00:00
David Pilato cbced948c4 Fix example in logging daily rotate configuration
PR #8464 come with a bug in the example provided.

First, the current log file is not compressed so it should not end with `.gz`.
Second, conversion pattern was removing all the log content but was printing only the log date.
Then, the current log filename was hardcoded to `elasticsearch` instead of the cluster name.
2014-11-19 15:58:53 +01:00
Nicholas Knize c297ca1668 [GEO] Add LinearRing and LineString validity checks as defined by http://geojson.org/geojson-spec.html to ensure valid polygons are specified at parse time.
Closes #8433
2014-11-19 08:23:50 -06:00
Simon Willnauer 923ddcce42 add more debug logging if recovery thread got iterrupted 2014-11-19 15:14:52 +01:00
javanna 06fafa3ed9 [DOCS] document that we support loading multiple logging conf files 2014-11-19 11:34:57 +01:00
javanna ecc56a57f5 [TEST] move LoggingConfigurationTests to common.logging.log4j
Make also LogConfigurator#ALLOWED_SUFFIXES package private so that it can be used in LoggingConfigurationTests, now that it's in the same package as the class that it tests.
Add few randomized aspects to LoggingConfigurationTests.
2014-11-19 11:34:35 +01:00
Mathias Fussenegger 2dcb1f503d Logging: restrict files loaded as logging configuration based on their suffix
Make sure that files such as logging.yml.rpmnew or logging.yml.bak are not loaded as logging configuration.

Only files that start with the "logging." prefix and end with ".yaml", ".yml", ".json" and ".properties" suffix get loaded.

Closes #7457
2014-11-19 11:34:03 +01:00
Igor Motov 314da4ec9e Test: don't enable unnecessary http transport in restoreIndexWithShardsMissingInLocalGateway test 2014-11-18 21:08:24 -05:00
Boaz Leskes 1e16375d04 Docs: Update execution hint docs for Significant terms agg
copied over the relevant pieces from the terms agg

Closes #8532
2014-11-18 20:54:26 +01:00
Simon Willnauer 7f27664ae0 [TEST] Revert accidential massive iterations 2014-11-18 17:26:31 +01:00
Simon Willnauer fdac110368 [TEST] add more debug output when engine / store are closed 2014-11-18 17:04:34 +01:00
Lee Hinman 7bd389de61 [TEST] Give tests for ctx._ttl more leeway
Fixes #8500
2014-11-18 17:01:36 +01:00
Simon Willnauer 734dc198ca [TEST] distributor direcotory is only used if multiple datapath are configured 2014-11-18 15:33:00 +01:00
Simon Willnauer 5c6fe2593e [CORE] Ban all useage of Future#cancel(true)
Interrupting a thread while blocking on an NIO Read / Write Operation
can cause a file to be closed due to the interrupts. This can have unpredictable
effects when files are open by index readers etc. we should prevent interruptions
across the board if possible.

Closes #8494
2014-11-18 14:14:09 +01:00
Simon Willnauer 119aa4af20 [STORE] Use DistributorDirectory only if there are more than one data direcotry
We don't need the overhead of DistributorDirectory if there is only a single directory
in the distributor.
2014-11-18 14:02:41 +01:00
Simon Willnauer c6c709eda2 [TEST] Register data.path for all nodes on close in InternalTestCluster
We need to register those data paths otherwise we might miss path that
need to get cleaned when using local gatway etc. which can otherwise
cause imports of dangeling indices.
2014-11-18 13:39:06 +01:00
Michael McCandless 2f40b464ad Test: force merge index in the end of IndexStatsTests.throttleStats
This works around slow IO (fsync) causing the test-framework cleanup
to timeout at 30 seconds when trying to delete the index.

Closes #8528
2014-11-18 07:25:16 -05:00
Igor Motov fd8a56dc0b Snapshot/Restore: keep the last legacy checksums file at the end of restore
This commit fixes the issue caused by restore process deleting all legacy checksum files at the end of restore process. Instead it keeps the latest version of the checksum intact. The issue manifests itself in losing checksum for all legacy files restored into post 1.3.0 cluster, which in turn causes unnecessary snapshotting of files that didn't change.

Fixes #8119
2014-11-17 19:50:53 -05:00
Igor Motov b0dde6ee4a Snapshot/Restore: restore of indices that are only partially available in the cluster
Fixes the issue with restoring of an index that had only some of its primary shards allocated before it was closed.

Fixes #8224
2014-11-17 18:47:58 -05:00
markharwood 6f79d67f81 Bulk indexing issue - missing parent routing causes NullPointerException.
Now each error is reported in bulk response rather than causing entire bulk to fail.
Added a Junit test but the use of TransportClient means the error is manifested differently to a REST based request - instead of a NullPointer the whole of the bulk request failed with a RoutingMissingException. Changed TransportBulkAction to catch this exception and treat it the same as the existing logic for a ElasticsearchParseException - the individual bulk request items are flagged and reported individually rather than failing the whole bulk request.

Closes #8365
2014-11-17 17:16:35 +00:00
Ken Wu d1c6d3b7b0 fix of Bulk update child doc, NPE error message when parent is not specified #8365
- Throw an RoutingMissingException instead of NPE
2014-11-17 17:13:57 +00:00
Andreas Kohn 66cf4ecc54 Docs: Fix typo in the javadoc for #tieBreaker()
Closes #8503
2014-11-17 16:57:15 +01:00
Adrien Grand e70b4d835b Search: Do not force the post-filter to be loaded into a BitSet.
Close #8488
2014-11-17 15:46:13 +01:00
Ryan Doyle a2c93304f8 Docs: Add Wireshark protocol dissection support
Hi guys, I've finished my Wireshark dissector for Elasticsearch. It is now merged into their master. See https://code.wireshark.org/review/#/c/4948/

Closes #8495
2014-11-17 13:07:01 +01:00
Martijn van Groningen 28f3ea1b8d Test: Let the random parent/child tests use the query and filter parsers instead of creating the queries and filters in a custom way.
By using the query and filter parsers we increase the test coverage and make the random parent/child tests simpler.
2014-11-17 10:05:46 +01:00
Boaz Leskes 461c20049f Test: CorruptedFileTest.testCorruptionOnNetworkLayer used node settings when creating an index
Test used `indices.recovery.concurrent_streams` when creating an index but this is a node setting. Moved it to the node settings and added similar settings to speed up concurrent recoveries.

Also fixed a misleading log message in ShardRecoveryHandler when logging a remove corruption
2014-11-16 23:54:36 +01:00
Simon Willnauer b0b7c917c3 Prevent double wrapping directories in MockDirectoryWrapper 2014-11-16 20:54:49 +01:00
Simon Willnauer e6908de04a [TEST] Close node env otherwise windows can't delete tmp files 2014-11-16 17:44:38 +01:00
Simon Willnauer 176b4eb1ed Fix synchronization - leftover from refactoring 2014-11-16 15:58:10 +01:00
Simon Willnauer 1c64a113de [CORE] Intorduce shards level locks to prevent concurrent shard modifications
Today it's possible that the data directory for a single shard is used by more than on
IndexShard->Store instances. While one shard is already closed but has a concurrent recovery
running and a new shard is creating it's engine files can conflict and data can potentially
be lost. We also remove shards data without checking if there are still users of the files
or if files are still open which can cause pending writes / flushes or the delete operation
to fail. If the latter is the case the index might be treated as a dangeling index and is brought
back to life at a later point in time.

This commit introduces a shard level lock that prevents modifications to the shard data
while it's still in use. Locks are created per shard and maintined in NodeEnvironment.java.
In contrast to most java concurrency primitives those locks are not reentrant.

This commit also adds infrastructure that checks if all shard locks are released after tests.
2014-11-16 14:24:29 +01:00