OpenSearch/x-pack/plugin/ilm/qa
Jay Modi 515b53d297
Fix race in SLM master/cluster state listeners (#59896)
This change fixes two possible race conditions in SLM related to
how local master changes and cluster state events are observed. When
implementing the `LocalNodeMasterListener` interface, it is only
recommended to execute on a separate threadpool if the operations are
heavy and would block the cluster state thread. SLM specified that the
listeners should run in the Snapshot thread pool, but the operations
in the listener were lightweight. This had the side effect of causing
master changes to be delayed if the Snapshot threads were all busy and
could also potentially cause the `onMaster` and `offMaster` calls to
race if both were queued and then executed concurrently. Additionally,
the `SnapshotLifecycleService` is also a `ClusterStateListener` and
there is currently no order of operations guarantee between
`LocalNodeMasterListeners` and `ClusterStateListeners` so this could
lead to incorrect behavior.

The resolution for these two issues is that the
SnapshotRetentionService now specifies the `SAME` executor for its
implementation of the `LocalNodeMasterListener` interface. The
`SnapshotLifecycleService` is no longer a `LocalNodeMasterListener` and
instead tracks local master changes in its `ClusterStateListner`.

Backport of #59801
2020-07-20 09:59:46 -06:00
..
multi-cluster [7.x] Add default composable templates for new indexing strategy (#57629) (#58757) 2020-07-01 09:32:32 -06:00
multi-node Fix race in SLM master/cluster state listeners (#59896) 2020-07-20 09:59:46 -06:00
rest 7.x - Create plugin for yamlTest task (#56841) (#59090) 2020-07-06 14:16:26 -05:00
with-security Remove deprecated usage of testCompile configuration (#57921) (#58083) 2020-06-14 22:30:44 +02:00
build.gradle [7.x] Smarter copying of the rest specs and tests (#52114) (#52798) 2020-02-26 08:13:41 -06:00