12130 Commits

Author SHA1 Message Date
Adrien Grand
fd1954d74f Internal: Fix CompressedString.equals.
CompressedString relied on the assumption that two CompressedString instanes
are equal if there compressed representation are equal. Unfortunately this is
not always true because the compressed representation also depends on when
flush() was called on the output stream or on the size of the hash table that
has been used at compression time.
2015-05-20 08:36:42 +02:00
Igor Motov
21ed6bb90c Core: Don't allow indices containing too-old segments to be opened
When index is introduced into the cluster via cluster upgrade, restore or as a dangled index the MetaDataIndexUpgradeService checks if this index can be upgraded to the current version. If upgrade is not possible, the newly upgraded cluster startup and restore process are aborted, the dangled index is imported as a closed index that cannot be open.

Closes #10215
2015-05-19 23:37:05 -04:00
Ryan Ernst
26ef40a46d Mappings: Remove document parse listener
There was previously a single user of the parse listener, MLT API.
However, now that this is gone, there is no need for it.
2015-05-19 15:35:45 -07:00
Simon Willnauer
8949cb85fb [RECOVERY] Add engine failure on recovery finalization corruption back
This engine failure on finalization corruption was lost on refactorings and
should be added back.
2015-05-19 22:24:02 +02:00
Simon Willnauer
eaa8576bba Remove all corruption markers if finalization fails 2015-05-19 22:15:48 +02:00
Simon Willnauer
7025a27f78 Revert "Revert "Ensure we mark store as corrupted if we fail to read the segments info""
This reverts commit 5fbb6a714d24cb9f2e3b03c171ab59673da64e51.
2015-05-19 20:28:01 +02:00
Ryan Ernst
4dd4f48a2f Merge pull request #11216 from rjernst/remove/smart-field-mappers
Mappings: Remove SmartNameFieldMappers
2015-05-19 10:49:21 -07:00
Simon Willnauer
5fbb6a714d Revert "Ensure we mark store as corrupted if we fail to read the segments info"
This reverts commit 70b4bb6e0e294e5888dc7ff48e960bdd1cf40fd6.
2015-05-19 17:53:25 +02:00
Simon Willnauer
70b4bb6e0e Ensure we mark store as corrupted if we fail to read the segments info
This commit also reenables CorruptedFileTest#testReplicaCorruption which had
a missing `GatewayAllocator.INDEX_RECOVERY_INITIAL_SHARDS: "one"` setting.

Closes #11226
2015-05-19 17:41:53 +02:00
jaymode
2e94753c95 [Test] set socket reuse address when using unicast discovery
When we use unicast discovery in tests, we test for available ports by binding to ports and if
the bind was successful, we use that port. This has a timing issue on certain operating systems
the socket can still be in a TIME_WAIT causing subsequent binds to fail before a certain timeout.
Setting reuse address on the Java socket will instruct the underlying operating system to allow
the socket to be bound to immediately, usually by specifying the SO_REUSEADDR socket option.
2015-05-19 10:59:25 -04:00
Adrien Grand
52899c87ef Merge pull request #11224 from jpountz/enhancement/filtered_query_forbidden
Search: Make FilteredQuery a forbidden API.
2015-05-19 15:35:24 +02:00
Simon Willnauer
348e14fa85 [TEST] Wait for green until testing Version.FORCE 2015-05-19 15:35:09 +02:00
Adrien Grand
4131bcbec7 Search: Make FilteredQuery a forbidden API.
This commit makes FilteredQuery a forbidden API and also removes some more usage
of the Filter API. There are some remaining code using filters for parent/child
queries but I'm not touching this as they are already being refactored in #6511.
2015-05-19 15:33:43 +02:00
Adrien Grand
fae1a0731f Tests: Add tests for null_value. 2015-05-19 15:32:55 +02:00
Britta Weber
55139659bb Merge pull request #11179 from elastic/feature/synced_flush
Seal indices for faster recovery
2015-05-19 15:17:16 +02:00
Simon Willnauer
242a452142 Merge branch 'master' into feature/synced_flush
Conflicts:
	src/main/java/org/elasticsearch/index/engine/InternalEngine.java
2015-05-19 14:55:45 +02:00
Simon Willnauer
78d7e5b695 Minor cleanups in SyncedFlushService 2015-05-19 14:53:39 +02:00
Simon Willnauer
b3f1a5da4a Merge pull request #11225 from s1monw/remove_flush_needed
[ENGINE] Remove flushNeeded in favor of IW#hasUncommittedChanges()
2015-05-19 14:53:09 +02:00
Simon Willnauer
2439faaf5b [TEST] Add more engine unittests for sync IDs 2015-05-19 14:43:03 +02:00
Shay Banon
643c2049a2 [TEST] add await fix for #11226 2015-05-19 14:40:02 +02:00
Simon Willnauer
d6e7817666 [ENGINE] Remove flushNeeded in favor of IW#hasUncommittedChanges()
We maintain a boolean that is obsolete since IW maintains the same
property that we can just piggyback on.
2015-05-19 14:10:07 +02:00
Shay Banon
a1a16276da [TEST] Add a corrupted replica test verifying its still allocated
Add a test that verifies that even though all replicas are corrupted on all available nodes, and listing of shard stores faield, it still get allocated and properly recovered from the primary shard
2015-05-19 13:18:43 +02:00
Simon Willnauer
488be75d19 Add some words about the purpose of a seal etc. 2015-05-19 12:26:08 +02:00
Simon Willnauer
9d2852f0ab Merge branch 'master' into feature/synced_flush
Conflicts:
	src/main/java/org/elasticsearch/index/engine/InternalEngine.java
	src/main/java/org/elasticsearch/index/shard/IndexShard.java
	src/main/java/org/elasticsearch/indices/recovery/RecoverySourceHandler.java
	src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java
2015-05-19 12:16:22 +02:00
Simon Willnauer
55f99dfce6 Make SyncedFlushService fully asynchronous
Some requests in the SyncedFlushService were sill blocking on network
calls which made calling this service error prone if done on a network
thread. This commit makes this service fully async based on ActionListener.
2015-05-19 12:01:31 +02:00
Martijn van Groningen
84b24e130e inner hits: Fix search hit field and term resolution 2015-05-19 11:25:52 +02:00
Adrien Grand
17d65a5f90 Tests: Remove RelocationTests.testRelocationWithBusyClusterUpdateThread.
It is not relevant anymore with synchronous mapping updates.
2015-05-19 10:37:45 +02:00
Adrien Grand
df5ffb1418 Merge pull request #11218 from jpountz/upgrade/lucene-5.2.0-snapshot-1680200
Upgrade to lucene-5.2.0-snapshot-1680200.
2015-05-19 10:34:32 +02:00
Simon Willnauer
d817793f9b [TEST] Add Unittest for Lucene#getNumDocs 2015-05-19 10:32:40 +02:00
Adrien Grand
437910e882 Upgrade to lucene-5.2.0-snapshot-1680200. 2015-05-19 10:28:35 +02:00
Simon Willnauer
09283cf7d3 minor cleanups 2015-05-19 10:23:18 +02:00
Adrien Grand
4dc4566168 Merge pull request #11203 from jpountz/fix/remove_ignore_conflicts
Mappings: Remove the `ignore_conflicts` option.
2015-05-19 10:03:02 +02:00
Britta Weber
8a3d504efb skip everything between file checks and translog prepare if sync ids coincide
also throw exception instead of assert if num docs no coincide
2015-05-19 09:30:12 +02:00
Britta Weber
8ef734908c assert num docs in recovery if sync id was used 2015-05-19 09:30:12 +02:00
Adrien Grand
3ca3c6c09c Merge pull request #11209 from jpountz/fix/documentmapper_refreshsource_private
Mappings: Make DocumentMapper.refreshSource() private.
2015-05-19 08:49:52 +02:00
Adrien Grand
f0d6dbbc36 Merge pull request #11210 from nik9000/detect_noop_null
detect_noop now understands null as a valid value
2015-05-19 08:38:49 +02:00
Ryan Ernst
e95097c33c Mappings: Remove SmartNameFieldMappers
This change simplifies the users of the mapper service to no
longer have access to multiple fields for a single name. While
FieldMappersLookup still stores and gives access to multiple
fields, the current users of SmartNameFieldMappers already all
assumed a single field. The arbitrary selection of that field
when multiple exist is now isolated to the mapper service.
2015-05-18 22:41:56 -07:00
Robert Muir
0105b65160 Merge pull request #11212 from rmuir/java.io.tmpdir.early
Ensure java.io.tmpdir is created earlier in tests.
2015-05-18 20:50:37 -04:00
Robert Muir
e89693408f Ensure java.io.tmpdir is created earlier in tests.
When testing, each jvm gets its own tmpdir set, so it may not exist
at all. A Lucene test rule ensures its created, but some tests (I
am looking at you rest tests) do a bunch of file stuff in static {},
in that case because its a parameterized test. And if you try to
extend it, it will fail if security manager is disabled...

Currently we ensure(java.io.tmpdir) very early when tests are running under
security manager, but otherwise we don't and it won't happen until the
test rule fires. So just do it early always.
2015-05-18 16:37:20 -04:00
Simon Willnauer
6dbe7d4b55 Make commitID byte[] final 2015-05-18 21:55:23 +02:00
Simon Willnauer
75b62e12a6 Merge pull request #11193 from s1monw/remove_commit_without_translog
[ENGINE] Remove the ability to flush without flushing the translog
2015-05-18 21:48:07 +02:00
Nik Everett
400abfceaf detect_noop now understands null as a valid value
If the source contrains a null value for a field then detect_noop should
consider setting it to null again to be a noop.

Closes #11208
2015-05-18 15:14:01 -04:00
Simon Willnauer
4b8ed1b0bf [TRANSLOG] Return null from read() if location generation is outdated
This behavior has changed been changed rescently to throw an IAE if
the translog we try to read from is already outdated. This is not
the expected behavior and this commit adds back the `old` way returning
`null` instead. The InternalEngine implementation will then go and ask the
lucene index for the document instead.
2015-05-18 20:14:39 +02:00
Alexander Reelsen
13e5c19dcf Test: Prevent automatic refresh in ContextAndHeaderTransportTests
In some cases due to calling checking `rarely()` the `indexRandom()` method
can potentially flush, which creates flush requests, that miss a certain
header in this test and allow the test to fail.

In addition unused configuration code for this test has been removed.
2015-05-18 18:22:48 +02:00
Adrien Grand
2999f53e86 Tests: Mark RelocationTests.testRelocationWithBusyClusterUpdateThread as @AwaitsFix. 2015-05-18 18:05:26 +02:00
Simon Willnauer
91d0580b0d Merge pull request #11200 from s1monw/cleanup_translog
Some smallish translog cleanups
2015-05-18 17:41:31 +02:00
Simon Willnauer
a21e4449b7 Added additional assertion that the view to remove was actually registered. 2015-05-18 17:14:06 +02:00
Simon Willnauer
bc810e1320 remove NoopOutputStream 2015-05-18 17:05:36 +02:00
Simon Willnauer
651c067fae Cleanup translog operation serialization
We used to double write the translog operation which is not needed except
of for recovery. This commit cuts over to a big-array based temporary serialiation
and removes the crazy double writing.
2015-05-18 17:05:36 +02:00
Simon Willnauer
60b66a7235 [TRANSLOG] Fold Translog.View into it's only implementation 2015-05-18 17:05:36 +02:00