This commit modifies the Kernel32Library to use direct mapping instead of a proxy class when doing native calls on Windows platforms. It also adds the "createSecurityManager" permission to the tests.policy file, and adds unit tests that should have failed when the Java security manager is enabled. Closes #9802
… translog Also improve test suite tearDown to not fail if setUp didn't create engines, translogs etc.
…anslogs on startUp Files may still be locked
Previously a few methods and many class members were package-private or private and could not be referenced from overriding classes. This changes the member variables and a few methods to have protected access, so they can be referenced or overridden from a subclass.
…emantics We keep track of the current stage of recovery using an instance of RecoveryState which is stored on the relevant IndexShard. At the moment changes to this object are made in many places of the code, which are charged of doing it in the right order, keeping track of timers and many more. Also the changes to shard state are decoupled from the recovery stages which caused #9503. This PR refactors this and brings all of the changes into IndexShard. It also makes all recovery follow the exact same stages and shortcut some. This is in order to keep things simple and always the same (those shortcuts didn't add anything, we ended doing it all anyway). Also, all timer management is now folded into RecoveryState and unit tests are added. This closes #9503 by moving the shard to post recovery only once the recovery is done (before they were decoupled), meaning that master promotion of the target shard to started can not cancel the recovery. Closes #9902
…ene snapshot repository
When we clean up after recoveries, we currently close the recovery counter first, followed up by the different snapshots. Since the recovery counter may issue a flush (introduced in #9439) , the snapshot references prevent the flush from cleaning up the current translog file. This commit changes the order of the close command. Note: this is not a problem on master, as we moved the translog delete logic, making it kick in if needed when the ref counter goes to 0. Closes #9760
Some tests failures are seen when a node attempts to use a port that is already bound by some other process on the test machine. This commit adds a bind to test port availability and iterates over the port range until an available port is found. This reduces the likelihood of a test node failing to start up due to the port already being bound.
…ugh index=no Almost all of our meta fields that allow enabling/disabling have an `enabled` setting. However, _field_names is enabled by default, and disabling requires setting `index=no`. This change adds a flag similar to that with other meta fields. closes #9893 Conflicts: src/main/java/org/elasticsearch/index/mapper/internal/FieldNamesFieldMapper.java
Random geo shape testing periodically fails on a known issue within Spatial4j core. A simple patch in ES will fix the issue. For now this random test will be disabled until the patch can be applied.
Mainly simplified buildTestCluster method now that there is no global cluster anymore.