Commit Graph

10174 Commits

Author SHA1 Message Date
Simon Willnauer e799ac9bd6 [TEST] Fix content comparison to not take platform dependent control chars into account. 2014-10-08 06:47:02 +02:00
Igor Motov 2359e33b1e Docs: fix formatting in snapshots documentation 2014-10-07 12:33:21 -04:00
Ryan Ernst 032184bd5e Fix missed places referencing optimize force flag from removal in commit 1ae8195. 2014-10-07 09:06:25 -07:00
Ryan Ernst c06c10bbb0 Remove deprecations from master (follow up to #7922) 2014-10-07 08:35:11 -07:00
Ryan Ernst c021f22523 Add Upgrade API
This commit does the following:
* Add the new API at the rest layer, being backed by the optimize API
  with upgrade flag, and segments api to find upgrade status.
* Add `upgrade` flag to optimize API, and deprecate `force` flag (will
  remove in master)
* Add test for both synchronous and async upgrade

closes #7884
closes #7922
2014-10-07 08:09:50 -07:00
Igor Motov 555bfcb02b [SNAPSHOT] Add repository validation
Fixes #7096
2014-10-07 10:50:16 -04:00
David Pilato 09ff3724ee plugins: disable support for config dir
When removing and installing again the plugin all configuration files will be removed in `config/pluginname` dir.
This is bad as users may have set and added specific configuration files.

During an install, if we detect already existing files in `config/pluginname` directory, we simply copy the new file to the same dir but we append a `.new` at the end.

Related to  #5064.

(cherry picked from commit 5da028f)
(cherry picked from commit 4cb1f95)
2014-10-07 16:16:37 +02:00
javanna 6cc7431bd3 [TEST] fix CurrentTestFailedMarker to reset its state after each test
The currently used method `testRunStarted` is only called before any tests have been run, we need to reset that state before each test, that's why we need to use `testStarted`.
2014-10-07 12:17:01 +02:00
Britta Weber 0408f90c08 [TEST] Fix config directory for external nodes in bwc tests
The logging configuration was expected in the path.home folder which is set to
target/JX
when running the bwc tests from the console.
Therefore the logger could not be initialized with error message:

[INFO] Failed to configure logging...
org.elasticsearch.ElasticsearchException: Failed to load logging configuration
        at org.elasticsearch.common.logging.log4j.LogConfigurator.resolveConfig(LogConfigurator.java:117)
        at org.elasticsearch.common.logging.log4j.LogConfigurator.configure(LogConfigurator.java:81)
        at org.elasticsearch.bootstrap.Bootstrap.setupLogging(Bootstrap.java:96)
        at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:180)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:32)
Caused by: java.nio.file.NoSuchFileException: /home/britta/es/target/J0/config
        at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
        at sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
        at sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:144)
        at sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:97)
        at java.nio.file.Files.readAttributes(Files.java:1686)
        at java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:109)
        at java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:69)
        at java.nio.file.Files.walkFileTree(Files.java:2602)
        at org.elasticsearch.common.logging.log4j.LogConfigurator.resolveConfig(LogConfigurator.java:107)
        ... 4 more
log4j:WARN No appenders could be found for logger (node).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

Setting the config directory fixes this.

Logs from external nodes are still not printed properly. They are inserted to the log
whenever the stdout is printed ([WARNING] JVM J0: stdout was not empty...)

closes #7964
2014-10-07 11:23:20 +02:00
Igor Motov c0129ebcc2 Snapshot/Restore: make it possible to delete snapshots with missing metadata file
Fixes #7980
2014-10-06 18:43:07 -04:00
Martijn van Groningen e1a8b027d7 Core: Perform write consistency just before writing on the primary shard
Before this change the write consistency change was performed on the node that receives the write request and the node that holds the primary shard. This change removes the check on the node that receives the request, since it is redundant.

Also this change moves the write consistency check on the node that holds the primary shard to a later moment after forking of the thread to perform the actual write on the primary shard.

Closes #7873
2014-10-06 19:00:07 +02:00
Boaz Leskes 99187e5259 Discovery: remove MasterFaultDetection.Listener.notListedOnMaster
It is never used in practice. We treat it as a master failure (using NodeDoesNotExistOnMasterException).

Closes #7995
2014-10-06 17:09:30 +02:00
David Pilato 6ae6a078de Search: add `format` support for date range filter and queries
When the date format is defined in mapping, you can not use another format when querying using range date query or filter.

For example, this won't work:

```
DELETE /test

PUT /test/t/1
{
  "date": "2014-01-01"
}

GET /test/_search
{
  "query": {
    "filtered": {
      "filter": {
        "range": {
          "date": {
            "from": "01/01/2014"
          }
        }
      }
    }
  }
}
```

It causes:

```
Caused by: org.elasticsearch.ElasticsearchParseException: failed to parse date field [01/01/2014], tried both date format [dateOptionalTime], and timestamp number
```

It could be nice if we can support at query time another date format just like we support `analyzer` at search time on String fields.

Something like:

```
GET /test/_search
{
  "query": {
    "filtered": {
      "filter": {
        "range": {
          "date": {
            "from": "01/01/2014",
            "format": "dd/MM/yyyy"
          }
        }
      }
    }
  }
}
```

Same for queries:

```
GET /test/_search
{
  "query": {
    "range": {
      "date": {
        "from": "01/01/2014",
        "format": "dd/MM/yyyy"
      }
    }
  }
}
```

Closes #7189.
2014-10-06 15:59:18 +02:00
Colin Goodheart-Smithe 6cf371395a Aggregations: makes script params consistent with other APIs in scripted_metric
This change removes the script_type parameter form the Scripted Metric Aggregation and adds support for _file and _id suffixes to the init_script, map_script, combine_script and reduce_script parameters to make defining the source of the script consistent with the other APIs which use the ScriptService
2014-10-06 09:07:25 +01:00
Igor Motov 2cbe1b9d59 Snapshot/Restore: Make sure indices cannot be renamed into restored aliases
Fixes #7915
2014-10-05 13:30:36 -04:00
Igor Motov 384114f52f Fix NPE in ScriptService when script file with no extension is deleted
Fixes #7689
2014-10-03 14:21:07 -04:00
Alex Ksikes 349b7a3a8b Term Vectors/MLT Query: support for different analyzers than default at field
This adds a `per_field_analyzer` parameter to the Term Vectors API, which
allows to override the default analyzer at the field. If the field already
stores term vectors, then they will be re-generated. Since the MLT Query uses
the Term Vectors API under its hood, this commits also adds the same ability
to the MLT Query, thereby allowing users to fine grain how each field item
should be processed and analyzed.

Closes #7801
2014-10-03 16:40:17 +02:00
Ryan Ernst d35d125ad8 Tests: Improve BWC preconditions to error cleanly when wire formats differ.
closes #7966
2014-10-03 07:37:02 -07:00
markharwood f878f40ae5 Aggs fix - background count for docs should include deleted docs otherwise a term’s docFreq (which includes deleted docs) can exceed the number of docs reported in the index and cause an exception.
The randomisation that deletes documents is also removed from tests as this doc-accounting change would mean the specific scores being expected in tests would now be subject to random variability and so fail.

Closes #7951
2014-10-03 13:20:39 +01:00
David Pilato f0052a58d6 Admin: show open and closed indices in _cat/indices
When asking for `GET /_cat/indices?v`, you can now retrieve closed indices in addition to opened ones.

```
health status index              pri rep docs.count docs.deleted store.size pri.store.size
yellow open   .marvel-2014.05.21   1   1       8792            0     21.7mb         21.7mb
       close  test
yellow open   .marvel-2014.05.22   1   1       3871            0     10.7mb         10.7mb
red    open   .marvel-2014.05.27   1   1
```

Closes #7907.
Closes #7936.
2014-10-03 13:16:14 +02:00
Adrien Grand 97816c135f Internal: Don't let `took` be negative.
`took` is computed based on the system clock and can be negative if the clock
time was updated during the execution of the search request. This commit
protects against these cases by replacing `took` with 1 if the elapsed time is
negative.

Close #7968
2014-10-03 12:25:22 +02:00
Adrien Grand bb6e2799cf Tests: Add more assertions to ExistsMissingTests. 2014-10-03 12:14:34 +02:00
Alex Ksikes c4830cf862 Term Vectors: support for realtime
By default term vectors are now realtime, as opposed to previously near
realtime. If they are not found in the index, they will be generated on the
fly. The document is fetched from the transaction log and treated as an
artificial document. One can set `realtime` parameter to `false` in order to
disable this functionality. This consequently makes the MLT query realtime in
fetching documents, as it previsouly used to be before switching from using
the multi get API to the mtv API.

Closes #7846
2014-10-03 09:26:47 +02:00
Boaz Leskes 1cc5da43b3 Logging: suppress long mapping logging during mapping updates (unless in TRACE)
Currently DEBUG logs can get very verbose because IndicesClusterStateService logs the complete mapping with every mapping update. We should suppress it if long in DEBUG mode and always log the full one in TRACE.

Closes #7949
2014-10-02 22:19:29 +02:00
Shay Banon 361b7b16b8 Upgrade to Jackson 2.4.2
closes #7934
closes #7932
2014-10-02 15:32:04 -04:00
Clinton Gormley 3267c2a2bf Docs: Updated the resiliency docs to point to the DiscoveryWithServiceDisruptions class 2014-10-02 21:08:32 +02:00
Boaz Leskes be2229c183 Discovery: add a finalize round to multicast pinging
When sending a multicast ping, there is no way to determine how long it will take before all nodes will respond. Currently we send two pings (one at start, one after half timeout) and wait until the ping timeout has passed for all responses to come back. However, if all nodes are fast to respond, there is a gap relatively large between the moment that pings were gathered and the election that is based on them. This commits adds a last ping round (at timeout) where we know the number of nodes we expect to receive answers from. Once all nodes responded, we complete the pinging.

Closes #7924
2014-10-02 15:17:54 +02:00
Boaz Leskes ab5d1b9633 Discovery: only accept unicast pings when started
Due to component start order we may process an incoming ping while the ZenDiscovery module is not yet started. This leads to exception (from which we recover correctly, but the logs are note nice). UnicastZenPing should only start processing pings if it is started. We previously processed if not closed or stopped.

Closes #7950
2014-10-02 15:00:25 +02:00
Michael McCandless 34e513c1a0 release tool: must decode bytes to string 2014-10-02 08:58:21 -04:00
Boaz Leskes c4866b3f03 DiscoveryWithServiceDisruptions: some more java docs and todos 2014-10-02 14:02:31 +02:00
Adrien Grand 3b38db121b Mappings: Make lookup structures immutable.
This commit makes the lookup structures that are used for mappings immutable.
When changes are required, a new instance is created while the current instance
is left unmodified. This is done efficiently thanks to a hash table
implementation based on a array hash trie, see
org.elasticsearch.common.collect.CopyOnWriteHashMap.

ManyMappingsBenchmark returns indexing times that are similar to the ones that
can be observed in current master.

Ultimately, I would like to see if we can make mappings completely immutable as
well and updated atomically. This is not trivial however, eg. because of dynamic
mappings. So here is a first baby step that should help move towards that
direction.

Close #7486
2014-10-02 13:42:20 +02:00
Clinton Gormley 12265aae02 Docs: Fixed issue link in doc values section of resiliency status 2014-10-02 13:34:27 +02:00
Michael McCandless a4e09d9a8a release tool: fix 'log exists' check to not create the log before it checks ;) 2014-10-02 07:35:38 -04:00
Michael McCandless 868778c5b6 Core: improve build_release.py
Don't insist on log file removal until after usage is printed.

Some simple Python code improvements (x.find(y) != -1 --> y in x)

Make sure the git area is "clean" (has no unpushed changes, has pulled
all changes, has no untracked files)

Add label color detail when creating next github version label.

Closes #7913
2014-10-02 06:31:45 -04:00
Clinton Gormley 1c7f4ca513 Updated resiliency docs to remove improve_zen branch and update link to dakrone's repo 2014-10-01 18:16:13 +02:00
Clinton Gormley fb18e2e9dd Added resiliency page to docs 2014-10-01 16:16:32 +02:00
Alex Ksikes 8d4373ab66 [TEST] MLT malformed doc test fixed 2014-10-01 14:39:55 +02:00
Boaz Leskes dc86ac5752 Test: AckTests.test*Warmer* - make sure at least one shard is started
The Put Warmer API executes the search encapsulated in the warmer before accepting it. This requires that at least one shard will be started. The tests used to use ensureGreen to check for that because of a publish timeout of 0 (needed to check the ack mechanism) that doesn't guarantee the shard is really started - just that the master has changed the CS to say so. This commit changes the ensureGreen to a the indexing of a single document.
2014-10-01 13:53:37 +02:00
Simon Willnauer 5747c9ebba [TEST] move fragile tests to BadApples rather than AwaitsFix 2014-10-01 12:37:59 +02:00
Boaz Leskes a2029ed6ec Test: AckClusterUpdateSettingsTests - only set publish_timeout to 0 after green 2014-10-01 12:33:58 +02:00
Lee Hinman 9c8beb8220 Be stricter parsing ids for ids query
Adds a check to make sure that all ids in the query are either strings
or numbers. This is to prevent the case where a user accidentally
specifies:

"ids": [["1", "2"]]

(note the double array)

With this change, an exception will be thrown since the second "[" is
not a string or number, it is a Token.START_ARRAY.

Fixes #7686
2014-10-01 10:34:35 +02:00
Simon Willnauer 50923a764c [TEST] Use canonical path for comparison rather than absolute path 2014-10-01 10:25:20 +02:00
Honza Král 3aa4ac9caa [TEST] Make mlt rest tests pass on a single node cluster 2014-09-30 22:42:51 +02:00
Alexander Reelsen 9903c2480e PluginManager: Fix config path extraction from plugin handle
The PluginManager had a subtle bug in case the config directory was not in the
es home directory - which is always true in case of packaging.

This fixes the plugin manager, so that when specifying a path.home and a
path.conf variable on the commandline, the plugin manager acts
appropriately.
2014-09-30 19:51:07 +02:00
Clinton Gormley ea7ed51014 Docs: Typoes on the range filter page 2014-09-30 19:28:35 +02:00
Igor Motov b7a4c6da65 Snapshot/Restore: Allow custom metadata to specify whether or not it should be in a snapshot
Before this change all persistent custom metadata is stored as part of snapshot. It requires us to remove repositories metadata later during recovery process. This change allows custom metadata to specify whether or not it should be stored as part of a snapshot.

  Fixes #7900
2014-09-30 19:16:42 +04:00
uboness ddbeb910be Changed the root rest endpoint ('/') to use cluster service
Instead of issuing a redundant cluster state request.

Closes #7899
2014-09-30 16:48:22 +02:00
Alex Ksikes e53b2eede7 MLT Query/API: fix `minimum_should_match` bwc
Rounded to the nearest int allows to avoid issues in which (int) (0.59f * 100)
= 58, instead of 59%.
2014-09-30 15:38:34 +02:00
Martijn van Groningen fca406415d Docs: Document the most important changes to zen discovery.
Closes #7746
2014-09-30 13:05:45 +02:00
Lee Hinman c86fdecd25 [TESTS] Be less strict about breaker child limit
Failing a parent breaker check is eventually consistent, so the test
could fail the parent limit, throw an exception, and before being
adjusted back down, increment more and throw a circuit breaking
exception on the child. This increases the child's limit, to ensure
we're only testing the parent limit.

It adds an additional assert to ensure that the breaker total is
correctly re-adjusted when the parent breaker has been tripped.
2014-09-30 13:01:27 +02:00