Add global and index level blocks to IndexSettings #23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request adds a new
getIndexBlocks()
method to theIndexSettings
class. This method returns aClusterBlocks
object that can be used to retrieve the current global level and index level blocks set on theIndexShard
object which the index settings belongs to.While the purpose of such method has been discussed via another channel few weeks ago, it resurfaced recently after the merge of elastic#35332 in which we added check for global/index blocks in the primary action of transport replication actions. This change caused some tests to fail on CI (see elastic#35597): the
TransportResyncReplicationAction
failed and the replica was never promoted to primary before the test timed out. The resync failed because the primary action inTransportResyncReplicationAction
checks blocks using the cluster state from theClusterService
, which is not yet updated and in the case of this tests still contains a global "no master" block, whereas it should check blocks against the blocks from the incoming cluster state that is not yet applied.This pull request changes the
IndicesClusterStateService
so that blocks are updated and propagated to theIndexSettings
. After elastic#35332 has been recomited again (it was reverted to allow CI to pass), a follow up PR will change how blocks are checked in TransportReplicationAction so that it uses blocks fromindexShard.indexSettings().getIndexBlocks()
.