Commit Graph

311 Commits

Author SHA1 Message Date
Adrien Grand bf4bdcce73 Build: Remove UnsafeUtils from forbidden-apis exclusion list. 2014-07-23 09:30:51 +02:00
Ryan Ernst 64ab22816c Scripting: Add script engine for lucene expressions.
These are javascript expressions, which can only access numeric
fielddata, parameters, and _score. They can only be used for searches (not document updates).

closes #6818
2014-07-15 07:49:01 -07:00
Shay Banon 386a14370a Upgrade to jackson core 2.4.1.1
Note, we had to disable the symbol overflow, since the many mapping case was tripping it
closes #6789
2014-07-09 17:49:51 +02:00
Alexander Reelsen ec92646289 Build: Add all netty classes during shading
In order to have access to all codecs and handlers by netty, they
need to be exposed during shading, otherwise only the classes, which
are used by the built are exposed.
2014-07-07 15:09:36 +02:00
Shay Banon 5093f050ab Upgrade Jackson to 2.4.1
closes #6757
2014-07-07 09:49:53 +02:00
Simon Willnauer 9ddfaf3aaf [TEST] Expose `tests.filter` for elasticsearch tests.
`-Dtests.filter` allows to pass filter expressions to the elasticsearch
tests. This allows to filter test annotaged with TestGroup annotations
like @Slow, @Nightly, @Backwards, @Integration with a boolean expresssion like:

 * to run only backwards tests run:
     `mvn -Dtests.bwc.version=X.Y.Z -Dtests.filter="@backwards"`
 * to run all integration tests but skip slow tests run:
     `mvn -Dtests.filter="@integration and not @slow"
 * to take defaults into account ie run all test as well as backwards:
     `mvn -Dtests.filter="default and @backwards"

This feature is a more powerful alternative to flags like
`-Dtests.nighly=true|false` etc.

Closes #6703
2014-07-03 11:40:49 +02:00
Boaz Leskes 72d2ac1328 Better support for partial buffer reads/writes in translog infrastructure
Some IO api can return after writing & reading only a part of the requested data. On these rare occasions, we should call the methods again to read/write the rest of the data. This has cause rare translog corruption while writing huge documents on Windows.

Noteful parts of the commit:
- A new Channels class with utility methods for reading and writing to channels
- Writing or reading to channels is added to the forbidden API list
- Added locking to SimpleFsTranslogFile
- Removed FileChannelInputStream which was not used

Closes #6441 , #6576
2014-07-01 19:11:36 +02:00
Robert Muir b55ad98d73 Upgrade to Lucene 4.9 (closes #6623) 2014-06-26 08:18:59 -04:00
Lee Hinman 50bb274efa Remove MVEL as a built-in scripting language 2014-06-26 10:33:28 +02:00
Lee Hinman 2708e453ac Re-shade MVEL as a dependency 2014-06-20 11:28:50 +02:00
Lee Hinman c70f6d0171 Add Groovy as a scripting language, add sandboxing for Groovy
Sandboxes the groovy scripting language with multiple configurable
whitelists:

`script.groovy.sandbox.receiver_whitelist`: comma-separated list of string
classes for objects that may have methods invoked.
`script.groovy.sandbox.package_whitelist`: comma-separated list of
packages under which new objects may be constructed.
`script.groovy.sandbox.class_whitelist` comma-separated list of classes
that are allowed to be constructed.

As well as a method blacklist:

`script.groovy.sandbox.method_blacklist`: comma-separated list of
methods that are never allowed to be invoked, regardless of target
object.

The sandbox can be entirely disabled by setting:

`script.groovy.sandbox.enabled: false`
2014-06-20 10:20:16 +02:00
Britta Weber ef05334fdd don't check .metadata folder for tabs and nocommits 2014-06-17 12:07:13 +02:00
Simon Willnauer 4dfa822e1b [TEST] Add basic Backwards Compatibility Tests
This commit add a basic infrastructure as well as primitive tests
to ensure version backwards compatibility between the current
development trunk and an arbitrary previous version. The compatibility
tests are simple unit tests derived from a base class that starts
and manages nodes from a provided elasticsearch release package.

Use the following commandline executes all backwards compatiblity tests
in isolation:

```
mvn test -Dtests.bwc=true -Dtests.bwc.version=1.2.1 -Dtests.class=org.elasticsearch.bwcompat.*
```

These tests run basic checks like rolling upgrades and
routing/searching/get etc. against the specified version. The version
must be present in the `./backwards` folder as
`./backwards/elasticsearch-x.y.z`
2014-06-16 12:40:43 +02:00
Simon Willnauer b8537d0e95 [BUILD] exclude target dir from tab validation 2014-06-12 12:31:18 +02:00
Nik Everett 29c10ed1bb [BUILD] Generate source jars for tests
Closes #6125
2014-06-12 12:05:54 +02:00
Simon Willnauer 5575ba1a12 [BUILD] Check for tabs and nocommits in the code on validate
This commit adds checks for nocommit and tabs in the source code.
The task is executed during the validate phase and can be disabled via
`-Dvalidate.skip`
2014-06-12 11:11:23 +02:00
mikemccand a71bb13563 Compilation: don't warn about using Sun proprietary APIs
E.g. we use Unsafe in quite a few places and this generates lots of
warnings, which we now suppress using the undocumented
-XDignore.symbol.file command-line option to javac.

Closes #6423
2014-06-06 05:46:06 -04:00
mikemccand af30947b66 get -Dtests.verbose passing through Maven 2014-06-05 09:38:10 -04:00
Adrien Grand 7ab99de483 Routing: Restore shard routing.
Routing has been inadvertly changed in #5562 resulting in documents going to
different shards in 1.2. This is a terrible bug because an indexing request
would not necessarily go to the same shard anymore, potentially leading to
duplicates.

Close #6391
2014-06-03 16:37:54 +02:00
Simon Willnauer ea80b381c0 [BUILD] Java version line was missleading
calling `java -version` might not print the java version that
is actually used to run maven. This commit prints a more accurate version
2014-06-02 15:51:38 +02:00
Shay Banon b2c7c8b0e7 Upgrade to netty 3.9.1
closes #6331
2014-05-30 00:20:37 +02:00
Simon Willnauer 57316bbfb3 Remove obsolet ASF repository Lucene 4.8.1 is on maven central 2014-05-19 21:17:33 +02:00
Simon Willnauer 85a0b76dbb Upgrade to Lucene 4.8.1
This commit upgrades to the latest Lucene 4.8.1 release including the
following bugfixes:

 * An IndexThrottle now kicks in when merges start falling behind
   limiting index threads to 1 until merges caught up. Closes #6066
 * RateLimiter now kicks in at the configured rate where previously
   the limiter was limiting at ~8MB/sec almost all the time. Closes #6018
2014-05-19 20:47:55 +02:00
David Pilato 0dbc83e7b0 [TEST] Do not filter gz files 2014-05-16 15:23:09 +02:00
David Pilato bd871f96c2 Check that a plugin is Lucene compatible with the current running node using `lucene` property in `es-plugin.properties` file.
* If plugin does not provide `lucene` property, we consider that the plugin is compatible.
* If plugin provides `lucene` property, we try to load related Enum org.apache.lucene.util.Version. If this fails, it means that the node is too "old" comparing to the Lucene version the plugin was built for.
* We compare then two first digits of current node lucene version against two first digits of plugin Lucene version. If not equal, it means that the plugin is too "old" for the current node.

Plugin developers who wants to launch plugin check only have to add a `lucene` property in `es-plugin.properties` file. If you are using maven to build your plugin, you can do it like this:

In `pom.xml`:

```xml
    <properties>
        <lucene.version>4.6.0</lucene.version>
    </properties>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>
```

In `es-plugin.properties`, add:

```properties
lucene=${lucene.version}
```

BTW, if you don't already have it, you can add the plugin version as well:

```properties
version=${project.version}
```

You can disable that check using `plugins.check_lucene: false`.
2014-05-16 13:41:20 +02:00
Simon Willnauer 13f37b3800 Shade mustache into org.elasticsearch.common package
Previously we shared the jar but never rewrote the packages such
that the shading had no effect.

Closes #6192
2014-05-15 21:21:36 +02:00
Simon Willnauer e47de1f809 [TEST] Randomize number of available processors
We configure the threadpools according to the number of processors which is
different on every machine. Yet, we had some test failures related to this
and #6174 that only happened reproducibly on a node with 1 available processor.
This commit does:
  * sometimes randomize the number of available processors
  * if we don't randomize we should set the actual number of available processors
    in the settings on the test node
  * always print out the num of processors when a test fails to make sure we can
    reproduce the thread pool settings with the reproduce info line

Closes #6176
2014-05-15 12:24:53 +02:00
Adrien Grand 9425472f61 [BUILD] Shade t-digest. 2014-05-14 00:42:48 +02:00
Adrien Grand cc530b9037 Use t-digest as a dependency.
Our improvements to t-digest have been pushed upstream and t-digest also got
some additional nice improvements around memory usage and speedups of quantile
estimation. So it makes sense to use it as a dependency now.

This also allows to remove the test dependency on Apache Mahout.

Close #6142
2014-05-13 10:38:08 +02:00
David Pilato 645efa05df Update shade-plugin to 2.3
Shade-plugin 2.2 does not work with JDK8 (see http://jira.codehaus.org/browse/MSHADE/fixforversion/19828)
2014-05-12 10:23:49 +02:00
Martijn van Groningen e2a2f13f17 Added FilteredQuery to the list of forbidden apis 2014-05-08 09:54:10 +02:00
Holger Hoffstätte f5c9bf6f0f Update JNA to latest version
Updating to this version allows to configure a special JNA directory,
in case the /tmp directory is mounted with the noexec option, as JNA
extracts some data and tries to execute parts of it.

Also updated documentation to clarify mlockall and memory settings as well
as pointing to the new jna.tmpdir system property.

Closes #5493
2014-05-02 11:52:57 +02:00
Matt Weber 2663d04a96 Run tests through forbidden-apis. 2014-04-30 17:48:33 +02:00
Shay Banon 2076194d8f Upgrade to Jackson 2.3.3
fixes the long value bug as well...
2014-04-29 20:13:43 -04:00
Robert Muir 8e0a479316 Upgrade to Lucene 4.8
Closes #5932
2014-04-28 06:45:50 -04:00
Shay Banon 6899e642b5 Upgrade to Guava 17
closes #5953
2014-04-28 11:02:30 +02:00
javanna 9a68e60142 [TEST] Allow to disable randomization of shards and replicas via system property
Needed for REST backwards compatibility tests, since we need to run older tests with the latest runner, which randomizes shards and replicas, but the tests rely on defaults (5,1).

Done in a generic way based on compatibility versions e.g. `-Dtests.compatibility=1.0.0` allows to run tests in a special manner that is compatibile with 1.0.0 version.

Also moved back randomIndexTemplate to ElasticsearchIntegrationTest (from ImmutableCluster) where all the randomized aspects should be.

Closes #5897
2014-04-24 22:18:31 +02:00
javanna 918da65d35 [TEST] Added blacklist to be able to skip specific REST tests
The blacklist can be provided through -Dtests.rest.blacklist and supports a comma separated list of globs
e.g. -Dtests.rest.blacklist=get/10_basic/*,index/*/*

Also added some missing docs and made it clearer that the suite/test descriptions effectively contains their (relative) path (api/yaml_file/test section)

Closes #5881
2014-04-22 09:52:48 +02:00
Uwe Schindler a6764e24a4 Update forbidden-apis to 1.5.1 and remove the relaxed missing classes error. 2014-04-19 08:53:45 +02:00
Shay Banon 21a3667888 Upgrade to mvel 2.2.0.Final
closes #5877
2014-04-18 21:52:24 +02:00
Simon Willnauer eaf04fc828 [BUILD] Fail release if test have AwaitsFix annotations
Note this commit upgrades Forbidden APIs to version 1.5

Closes #5807
2014-04-17 16:45:46 +02:00
Shay Banon bc5bdbc5de Remove jsr166y now that we on Java 7, cleanup jsr166e to classes we use 2014-04-15 13:17:28 +02:00
Simon Willnauer 8bede7024f Use TransportBulkAction for internal request from IndicesTTLService
This prevents executing bulks internal autocreate indices logic
and ensures that this internal request never creates an index
automaticall.

This fixes a bug where the TTL purger thread ran after the actual
index it was purging was already closed / deleted and that re-created
that index.

Closes #5766
2014-04-15 12:40:25 +02:00
Simon Willnauer 754eb16835 Upgrade to Lucene 4.7.2 2014-04-14 18:30:03 +02:00
Bill Hwang dcc6a6e138 [BUILD] Remove site dependencies generation
Removed dependencies library generation.  It stalls Jenkins static analysis job
2014-04-07 16:01:02 -07:00
javanna 1ec4f8f04b [TEST] Replaced RestTestSuiteRunner with parametrized test that uses RandomizedRunner directly
ElasticsearchRestTests extends now ElasticsearchIntegrationTest and makes use of our ordinary test infrastructure, in particular all randomized aspects now come for free instead of having to maintain a separate (custom) tests runner

We previously parsed only the tests that needed to be run given the version of the cluster the tests are running against. This doesn't happen anymore as it didn't buy much and it would be harder to support as the tests get now parsed before the test cluster gets started. Thus all the tests are now parsed regardless of their skip sections, afterwards the ones that don't need to be run will be skipped through assume directives.

Fixed REST tests that rely on a specific number of shards as this change introduces also random number of shards and replicas (through randomIndexTemplate)

Closes #5654
2014-04-07 17:08:05 +02:00
Simon Willnauer 6f5b7fa086 [BUILD] Set -Dtests.jvms=auto by default to make use of multiple JVMs 2014-04-03 13:01:01 +02:00
Simon Willnauer 42b20d601f Upgrade to Lucene 4.7.1
* Removed XTermsFilter fixed in LUCENE-5502
 * Switched back to automaton queries that caused failures due to LUCENE-5532
 * Fixed Highlight test that has different results due to LUCENE-5538
2014-04-01 23:50:55 +02:00
javanna 806c4e87fb [TEST] Removed last occurences of cluster_seed, no longer used
Relates to #5233
2014-04-01 17:57:57 +02:00
Simon Willnauer 71de2bc414 [BUILD] Allow to set tests memory via the commandline 2014-04-01 14:12:52 +02:00