Commit Graph

10833 Commits

Author SHA1 Message Date
Ryan Ernst b96bd201c1 Mappings: Lock down _id field
There are two implications to this change.
First, percolator now uses _uid internally, extracting the id portion
when needed. Second, sorting on _id is no longer possible, since you
can no longer index _id. However, _uid can still be used to sort, and
is better anyways as indexing _id just to make it available to
fielddata for sorting is wasteful.

see #8143
closes #9842
2015-02-24 14:26:22 -08:00
Simon Willnauer c54bd2f7ad [STORE] Improve safety when deleting files from the store
Today if we delete files from the index directory we never acquire the
write lock. Yet, for safety reasons we should get the write lock before
we modify / delete any files. Where we can we should leave the deletion
to the index writer and only delete that are necessary to delete ourself.
2015-02-24 21:15:19 +01:00
Igor Motov 73faa2e5ed Snapshot/Restore: Allow deletion of snapshots with corrupted snapshot files
Improve resiliency of snapshot deletion operation by allowing deletion of snapshot with corrupted snapshot files.

Closes #9534
2015-02-24 14:31:49 -05:00
Ryan Ernst d479611dc5 Tests: Use all found index files instead of static list for static bwc tests
It is a pain to add a new static index, and then have to update the old
index test.  This removes the need for the latter step.

closes #9854
2015-02-24 11:19:57 -08:00
Igor Motov 432f578807 Internal: refactor settings filtering
Refactor how settings filters are handled. Instead of specifying settings filters as filtering class, settings filters are now specified as list of settings that needs to be filtered out. Regex syntax is supported. This is breaking change and will require small change in plugins that are using settingsFilters. This change is needed in order to simplify cluster state diff implementation.

Contributes to #6295
2015-02-24 13:05:47 -05:00
Britta Weber ff8fd677cc mappings: update cluster state with type mapping also for failed indexing request
When indexing of a document with a type that is not in the mappings fails,
for example because "dynamic": "strict" but doc contains a new field,
then the type is still created on the node that executed the indexing request.
However, the change was never added to the cluster state.
This commit makes sure mapping updates are always added to the cluster state
even if indexing of a document fails.

closes #8692
relates to #8650
2015-02-24 17:41:12 +01:00
Ryan Ernst 4ee7ed987e Tests: Remove thread leak filter
Now that the global cluster is gone, we shoudln't need to ignore
thread leaks across tests.  We unfortunately still need suite level
scope, since most tests are using suite scope clusters (although
test clope clusters should really switch back to test scope thread
leaks).

closes #9843
2015-02-24 08:06:10 -08:00
Simon Willnauer 3e1c7b5a0c Remove InternalNode interface 2015-02-24 11:07:24 +01:00
Simon Willnauer 028f379781 Simplify SingleNodeTest and close propperly instead of calling stop 2015-02-24 09:40:32 +01:00
Lee Hinman f610774546 Revert "Add String to the default whitelisted receivers"
This reverts commit f493b98259.
2015-02-23 22:30:05 -07:00
Lee Hinman f493b98259 Add String to the default whitelisted receivers
Fixes #8866
2015-02-23 17:59:30 -07:00
Robert Muir 96b37a4bef remove dead code 2015-02-23 19:52:20 -05:00
Ryan Ernst 822ffe9e70 Mappings: Lock down _uid field
Also, cleanup writePre20Settings so it is shared across all field
mappers.

see #8143
2015-02-23 15:54:41 -08:00
Robert Muir 0fa5b87fdd Add missing @Override annotations.
These help a lot when refactoring, upgrading lucene, etc, and
can prevent code duplication (as you get a compile error for outdated stuff).

Closes #9832.
2015-02-23 17:08:28 -05:00
Simon Willnauer 668d09db08 [TEST] Don't reuse single node tests node instance across tests
Similar to the shared cluster we should not reuse the node from
singlenodetest across tests.
2015-02-23 21:13:23 +01:00
Simon Willnauer 1848d1ba8b [STORE] add debug logging if delete fails 2015-02-23 20:56:10 +01:00
Simon Willnauer 9700fe0367 remove dead code 2015-02-23 20:55:01 +01:00
Michael Sander fd6c6058ce Remove Triple Negative!
Double negatives are confusing, but a triple negative (1 no, 2 non, 3 null)? It takes five minutes to understand this little sentence.  Cleaned that up a bit.

Closes #9789
2015-02-23 20:09:05 +01:00
Robert Muir daa8e5f226 some more simple fs cleanups.
the isSameFile() sha1 logic is just flat out buggy, in addition to wasting cpu.

Closes #9827
2015-02-23 13:25:24 -05:00
Christoph Büscher 4ef430d1e1 [Test] Add `date_histogram` test for time zone corner case
Add test case for time zone issue reported in #8209, already fixed
on master by previous changes in TimeZoneRounding classes.
2015-02-23 19:10:56 +01:00
Colin Goodheart-Smithe 2753db4685 Scripting: Removed deprecated script parameter names
This change removes the deprecated script parameter names ('file', 'id', and 'scriptField').
It also removes the ability to load file scripts using the 'script' parameter. File scripts should be loaded using the 'script_file' parameter only.
2015-02-23 13:49:21 +00:00
orenash 55ab08c537 Adding tests for timezone rounding:
1. Test using the pre_zone_adjust_large_interval option.
2. Test rounding of ambiguous timestamps in local time (after DST switch)
2015-02-23 12:55:36 +01:00
Martijn van Groningen 4fddda307f [Discovery] Prevent stale master nodes from sharing dated cluster states to nodes that have moved to a different master node.
If an elected master node goes into a long gc then other nodes' fault detection will notice this and a new master election is started and eventually a new master node is elected. If the previous master nodes goes out of the long gc it can still have pending tasks which can result in new cluster state updates. Nodes that are still in the nodes list of this previous elected master node can get these cluster state updates. This commit makes sure that this dated cluster states are not accepted by these nodes.

This issue can temporary lead to the fact that non elected master nodes switch to the previous elected master node. The new elected master node also gets the same dated cluster state, but rejects it and tells the previous elected master node to step down and rejoin. Because the new elected master is the only master node the previous elected master node will follow the new elected master node. Any nodes that follow the previous elected master node (by accident), will also rejoin and follow the new elected master node because their master fault detection will fail. So all in all this isn't a severe problem, because the problem fixes itself eventually.

Closes #9632
2015-02-23 12:28:13 +01:00
Colin Goodheart-Smithe 7d3856c9d3 [DOCS] update script docs to use preferred script parameter names 2015-02-23 11:16:28 +00:00
Michael McCandless 6867f4a3fa Core: don't listAll twice
In #6636 we switched to a default FileSwitchDirectory that made
.listAll run twice on the same underlying file system directory.

This fixes listAll to do a single directory listing again.

Closes #9666
2015-02-23 04:12:03 -05:00
Simon Willnauer 98aad1bcbd Remove unused constant 2015-02-23 09:49:05 +01:00
Simon Willnauer 221c7b6e30 [TEST] use same type in mapping and for indexing 2015-02-23 09:41:29 +01:00
Ryan Ernst f3d5d483db Internal: Fix field mappers to always pass through index settings
Currently many meta field mappers do not take index settings in their
simple constructor that DocumentMapper uses, and instead pass null or
empty settings to the parent abstract mapper.  This change fixes them to
pass through index settings, and adds an assertion in AbstractFieldMapper
that settings are not null.

closes #9780
2015-02-22 22:14:18 -08:00
Robert Muir 1e015e6e33 Tests: Remove global shared cluster
This was previously attempted in #8854. I revived that branch and did
some performance testing as was suggested in the comments there.

I fixed all the errors, mostly just the rest tests, which
needed to have http enabled on the node settings (the global cluster
previously had this always enabled). I also addressed the comments from
that issue.

My performance tests involved running the entire test suite on my
desktop which has 6 cores, 16GB of ram, and nothing else was being
run on the box at the time. I ran each set of settings 3 times and
took the average time.

| mode    | master | patch | diff |
| ------- | ------ | ----- | ---- |
| local   | 409s   | 417s  | +2%  |
| network | 368s   | 380s  | +3%  |

This increase in average time is clearly worthwhile to pay to achieve
isolation of tests. One caveat is the way I fixed the rest tests
is still to have one cluster for the entire suite, so all the rest
tests can still potentially affect each other, but this is an
issue for another day.

There were some oddities that I noticed while running these tests
that I would like to point out, as they probably deserve some
investigation (but orthogonal to this PR):
* The total test run times are highly variable (more than a minute between the min and max)
* Running in network mode is on average actually *faster* than local mode. How is this possible!?
2015-02-22 22:04:22 -08:00
Robert Muir 6125ae1fdf Remove redundant fs metadata ops.
Files.exists(f) && Files.isDirectory(f) -> Files.exists(f)
if (Files.exists(f)) Files.delete(f) -> Files.deleteIfExists(f)
if (!Files.exists(f)) Files.createDirectories(f) -> Files.createDirectories(f)

In a few places where successive i/o ops are done against the same file, convert
to Files.readAttributes().

Closes #9807.
2015-02-22 17:31:44 -05:00
Martijn van Groningen daefb4c673 Docs: Document that the fielddata loading defaults to eager on the _parent field.
Closes #9804
2015-02-22 23:15:59 +01:00
Martijn van Groningen 298f753bf2 Muted testParentFieldToNonExistingType test 2015-02-22 23:06:18 +01:00
Simon Willnauer 3e2f4b86e4 [CORE] close all resources even if #beforeIndexShardClosed throws an exception
Conflicts:
	src/main/java/org/elasticsearch/index/IndexService.java
2015-02-21 14:26:20 +01:00
Simon Willnauer 16f19bf7bd add more logging and fix pending delete removal 2015-02-21 09:22:16 +01:00
Robert Muir a4f7023e29 set AwaitsFix until we discuss if proxies are needed 2015-02-20 17:59:17 -05:00
Simon Willnauer 1837d8a5fc fix test bug 2015-02-20 23:16:23 +01:00
Simon Willnauer d0a9c35c69 Prune all segment_N files not just newer ones 2015-02-20 22:30:02 +01:00
Simon Willnauer 136d36b724 [ENV] NodeEnv should lock all shards for an index
Today locking all shards only locks the shards that are present on
the node or that still have a shard directory. This can lead to odd
behavior if another shard that doesn't exist yet is allocated while
all shards are supposed to be locked.
2015-02-20 22:11:10 +01:00
Ryan Ernst 94348cb788 replace awaitsfix url with underlying lucene issue for index lookup failure 2015-02-20 11:18:53 -08:00
Nicholas Knize 9302126162 [GEO] Adds randomization to geo test suite
Adds RandomShapeGenerator for creating random shape types. This adds a level of randomized testing to the Geospatial logic. An initial randomized GeometryCollection test is added to the GeoShapeIntegrationTest suite for validating and verifying geo_shape filter behavior. The RandomShapeGenerator can/should be used in Unit and Integration testing to avoid biased testing.

closes #9588
2015-02-20 11:18:14 -06:00
Adrien Grand 7c20a8a913 Mute IndexLookupTests temporarily. 2015-02-20 15:01:04 +01:00
markharwood 29b1902cfb New aggregations feature - “PercentageScore” heuristic for significant_terms aggregation provides simple “per-capita” type measures.
Closes #9720
2015-02-20 13:22:08 +00:00
Simon Willnauer 50b9a8d6f2 Add missing segments file to the lucene file listing
Relates to #9761
2015-02-20 13:14:35 +01:00
Robert Muir f71beacbdb ban deprecated lucene postings apis 2015-02-20 07:11:37 -05:00
Robert Muir e8cfc11a6e add missing import 2015-02-20 07:02:25 -05:00
Robert Muir 30a4294a6a Upgrade to lucene r1660560
Squashed commit of the following:

commit 07391388715ed1f737e8acc391cea0bce5d79db9
Merge: a71cc45 b61b021
Author: Robert Muir <rmuir@apache.org>
Date:   Fri Feb 20 06:58:11 2015 -0500

    Git really sucks

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

commit b61b02163f62ad8ddd9906cedb3d57fed75eb52d
Author: Adrien Grand <jpountz@gmail.com>
Date:   Wed Feb 18 19:03:49 2015 +0100

    Try to improve TopDocs.merge usage.

commit bf8e4ac46d7fdaf9ae128606d96328a59784f126
Author: Ryan Ernst <ryan@iernst.net>
Date:   Wed Feb 18 07:43:37 2015 -0800

    reenable scripting test for accessing postings pieces.  commented out
    parts that fail because of bad assumptions

commit 6d4d635b1a23b33c437a6bae70beea70ad52d91c
Author: Robert Muir <rmuir@apache.org>
Date:   Wed Feb 18 09:41:46 2015 -0500

    add some protection against broken asserts, but, also disable crappy test

commit c735bbb11f38782dfea9c4200fcf732564126bf5
Author: Robert Muir <rmuir@apache.org>
Date:   Wed Feb 18 02:21:30 2015 -0500

    cutover remaining stuff from old postings api

commit 11c9c2bea3db3ff1cd2807bd43e77b500b167aed
Author: Robert Muir <rmuir@apache.org>
Date:   Wed Feb 18 01:46:04 2015 -0500

    cut over most DocsEnum usage

commit bc18017662f6abddf3f074078f74e582494c88e2
Author: Robert Muir <rmuir@apache.org>
Date:   Wed Feb 18 01:19:35 2015 -0500

    upgrade to lucene_r1660560, modulo one test fail
2015-02-20 06:58:43 -05:00
Simon Willnauer a71cc45023 [INDICES] Retry if shard deletes fail due to IOExceptions
Today if a shard deletion fails we simply ignore it and move on. On system like
windows where a virus scanner can hold on to files or any other process ie. the admins
explorer window we fail to delete shards leaving large amout of data behind. We should try
best effort to clean those shards up before we ack the delete.
2015-02-20 12:50:40 +01:00
Simon Willnauer 8e09070246 [RESTORE] Refactor how restore cleans up files after snapshot was restored
Today we restore files by running through the directory removeing all files
not in the snapshot. Some files in that direcotry might belong there even though
we remove them. This commit moves the responsiblity of cleaning up pending files
to lucene by utilizing IndexWriter#IndexFileDeleter
2015-02-20 09:33:40 +01:00
Ryan Ernst dae0ed168a Test: Remove use of globalTempDir() and forbid it from future use.
Using this temp dir circumvents test isolation and isn't necessary.

closes #9777
2015-02-19 14:05:10 -08:00
Martijn van Groningen 16446440e4 Don't use the fixed bitset filter cache for child nested level filters, but the regular filter cache instead.
Random access based bitsets are not required for the child level nested level filters.

Closes #8810
2015-02-19 21:34:03 +01:00