3648 Commits

Author SHA1 Message Date
Colin Goodheart-Smithe
54c6d280a5 Adds Steps for ReplicasAction
Also adds tests for those steps and ReplicasAction.toSteps
2018-04-09 14:43:57 +01:00
Colin Goodheart-Smithe
2eb8fd9336 Adds tests for AllocateAction and its steps
Also tweaks some of the code in the steps of the allocate action
2018-04-09 13:59:25 +01:00
Tal Levy
47ed2e5b23 add more tests 2018-04-05 18:00:41 -07:00
Tal Levy
b58159ddad add more tests 2018-04-05 17:43:32 -07:00
Tal Levy
228fc8c842 add some stuff 2018-04-05 17:21:44 -07:00
Tal Levy
c0acea3721 :check yourself greeny 2018-04-05 13:16:19 -07:00
Tal Levy
1a2afac98b fix tests 2018-04-05 12:43:10 -07:00
Colin Goodheart-Smithe
e3e669067c Adds loggic for TerminalPolicyStep 2018-04-05 17:58:22 +01:00
Colin Goodheart-Smithe
05c2c5655b replaces cause with boolean 2018-04-05 17:53:15 +01:00
Colin Goodheart-Smithe
ed260a0430 Removes Cause stuff 2018-04-05 17:10:56 +01:00
Martijn van Groningen
d77f756f5c ccr: use indices stats api to fetch global checkpoint of the follower shards and
keep track of shard follow stats inside shard follow stats' node task instead of persistent task status.

By maintaining the shard follow stats inside its node task the stats update is quicker as
no cluster state update is required. The stats are now transient; meaning if the task
is going to run a different node then the stats are gone too. Currently only the processed
global checkpoint is being tracked and this is being restored when a shard follow node task
starts via the indices stats api (the reason of the first change of this change). Other stats
that we may add in the future (like fetch_time, see: https://gist.github.com/s1monw/dba13daf8493bf48431b72365e110717)
it is ok if we start from zero in case a shard follow task moves to another node.
2018-04-05 14:52:20 +02:00
Tal Levy
907586c9e4 add MoveToNextStepUpdateTaskTests 2018-04-04 20:39:00 -07:00
Tal Levy
55d2a62fec add tests for ExecuteStepsUpdateTask 2018-04-04 15:32:36 -07:00
Colin Goodheart-Smithe
a8dc8a7c98 Adds more unit tests for IndexLifecycleRunner 2018-04-04 15:59:10 +01:00
Colin Goodheart-Smithe
9ef26dbe51 Unit tests static methods in IndeexLifecycleRunner 2018-04-04 13:29:30 +01:00
Tal Levy
47dcc8fe9c more changes + updated api 2018-04-03 17:42:25 -07:00
Tal Levy
1ac1ee413f moar changes 2018-04-02 16:21:48 -07:00
Tal Levy
d2e87a66e5 moar changes
- set `indexSurvives` for Step
- extract the two ClusterStateUpdateTasks to separate classes

- simple Delete Policy works!
2018-03-29 16:23:57 -07:00
Martijn van Groningen
d976fa44e7 Removed LocalCheckpointTracker usage. 2018-03-29 07:41:23 +02:00
Tal Levy
74eaba2078 moar changes from Tal 2018-03-28 17:10:50 -07:00
Colin Goodheart-Smithe
179074d3b0 Refactors steps and adds some execution logic
This is far from complete but its necessary to push so the new step classes can be shared and used.
2018-03-28 16:34:34 +01:00
Martijn van Groningen
a22a7d079d ccr: Added maximum translog limit that a single shard changes response can return.
This limit is based on the number of estimate bytes in each translog
operation that fall between the minimum and maximum request sequence number.

If this limit is met then the shard follow task executor will make sure
that a subsequent shard changes request will be performed to fetch the
remaining translog operations.

This limit is needed in order to protect against returning too many
translog operations in a single shard changes response.

Relates to #2436
2018-03-28 15:49:57 +02:00
Martijn van Groningen
282740610b Fixed test after merging in master branch. 2018-03-28 09:54:41 +02:00
Tal Levy
e6ee5b49d1 have steps point to step-key, not the actual step object 2018-03-27 11:52:08 -07:00
Tal Levy
ce4248ec59 slight changes 2018-03-27 11:41:38 -07:00
Colin Goodheart-Smithe
9972710e9e Makes brnach compile
Commented out toSteps implem,entations and other bits needed to get the branch to compile
2018-03-27 12:14:38 +01:00
Tal Levy
f429fc0b3e begin making sense of types 2018-03-26 18:48:59 -07:00
Tal Levy
083c563cf6 meh 2018-03-26 18:12:38 -07:00
Tal Levy
57821cd55a moar refactor for steps 2018-03-26 17:54:15 -07:00
Nhat Nguyen
51111a8106 CCR: Stop FollowExistingIndexAction after report failure (#4111)
We check for the existence of both leader and follower index, then properly 
report to the caller. However, we do not return after reporting failure. This
causes the caller receive exception twice: IllegalArgumentException then
NullPointerException. This commit makes sure to stop the action after reporting
failure.
2018-03-26 13:56:47 -04:00
Tal Levy
d63cd8c9c3 step by step 2018-03-26 08:00:03 -07:00
Martijn van Groningen
9e4c68c389 Fixed compile and test errors after merging in master 2018-03-16 17:47:10 +01:00
Tal Levy
fe22c08207 stop using illegal logging of Object 2018-03-12 13:18:02 -07:00
Tal Levy
ebff02c1b2 fix compilation changes 2018-03-12 12:29:22 -07:00
Martijn van Groningen
10cfa21a68 required changes after merge master branch into ccr branch. 2018-02-22 15:03:33 +01:00
Tal Levy
9850f44b95 fix state left over by spec test 2018-02-13 13:40:09 -08:00
Tal Levy
8e282f21c8 Merge branch 'master' into index-lifecycle 2018-02-12 14:17:24 -08:00
Martijn van Groningen
1a9a7ffe97 removed hack 2018-02-07 17:54:28 +01:00
Martijn van Groningen
c442d14f1d Several changes that were required after merging master into the ccr branch. 2018-02-05 13:25:58 +01:00
Tal Levy
0a3dcebca0 disallow deleting lifecycle policies that are referenced by existing indices (#3806) 2018-02-01 14:16:06 -08:00
Tal Levy
ab49e40f91 add phase and action timestamps to cluster-state (#3726)
This commit sets `index.lifecycle.phase_time` and `index.lifecycle.action_time`
appropriately during setPhase and setAction in IndexLifecycleContext.
2018-01-25 09:02:26 -08:00
Colin Goodheart-Smithe
faf067080b Makes sure creation date garentees execution in tests 2018-01-25 13:21:50 +00:00
Martijn van Groningen
4e818254ad re-enabled java integration tests 2018-01-25 14:18:34 +01:00
Tal Levy
9920d6be2d keep plugin up to date with structure changes (#3702)
Looks like we need to split out the tests of core classes to core
and index-lifecycle ones stay in index-lifecycle.

I believe I got everything, although I may have missed at least one thing

checked status with

$ ./gradlew :x-pack-elasticsearch:plugin:index-lifecycle:check -Dtests.seed=39838421912001B4
$ ./gradlew :x-pack-elasticsearch:plugin:core:check -Dtests.seed=39838421912001B4

other things done in this PR:
- removal of a few unused variables/thrown exceptions/imports
- fix TimeseriesLifecycleTypeTests
  - an all null AllocateAction was created
- fix AllocateActionTests
  - woops. -Dtests.seed=39838421912001B4 resulted in two `null`s and an emptyMap.
    this resulted in a test failure.
2018-01-24 08:47:21 +00:00
Martijn van Groningen
05d3d2e49c fix packages after merge 2018-01-24 09:28:42 +01:00
Tal Levy
4856baf66b fix guice and plugin initialization after split (#3677)
the x-pack-split required updating the IndexLifecycle plugin to
be a proper plugin with the Plugin API methods instead of the XPackPlugin API
methods.
2018-01-23 10:41:22 -08:00
Colin Goodheart-Smithe
fd502aa3e6 Makes some fields in Index Lifecycle API optional (#3687)
Specifically this change makes it optional to:
* Specify `includes`, `excludes` and `requires`maps in the allocate action as long as at least one fo the options is specified and is not an empty map
* Specify an `after` parameter on a phase. If no `after` value is specified `TimeValue.ZERO` is used and the phase will be moved to as soon as the previous phase reports `ACTIONS COMPLETED`. `after` is always non-null when we are serialising the Phase.
* Specify a `type` for a LifecyclePolicy. If no `type` is specified `TimeSeriesLifecycleType.INSTANCE` is used since this is currently the only production `type`. `type` is always non-null when we are serialising the LifecyclePolicy.
2018-01-23 17:02:11 +00:00
Colin Goodheart-Smithe
f2fa988f2f Fixes Checkstyle 2018-01-23 08:24:03 +00:00
Jason Tedor
9b6bb2c635 Enable run task for CCR
This commit enables the run task for ccr by specifying that the ccr
project not be evaluated until after core is evaluated. This is
important since ccr is alphabetically before core and thus Gradle
evaluates it first.

Relates #3665
2018-01-22 15:07:20 -05:00
Tal Levy
07b28fd721 migrate lifecycle settings to plugin:core:LifecycleSettings (#3670) 2018-01-22 10:43:16 -08:00