-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
Describe the bug
The DiskThresholdMonitor introduced in #19071 unconditionally auto-releases index.blocks.read on all indices, even when manually set by users. This setting was added to support warm node file cache threshold protection, but the implementation assumes index.blocks.read is only used by the system. Unlike cluster.blocks.create_index which has cluster.blocks.create_index.auto_release to control this behavior, there is no equivalent setting for index.blocks.read.
Related component
Search
To Reproduce
- Start an OpenSearch cluster (any node type, not just warm nodes)
- Create an index:
PUT /test-index - Set read block:
PUT /test-index/_settings with {"index.blocks.read": true} - Wait ~1-2 seconds for DiskThresholdMonitor to run
- Check settings:
GET /test-index/_settings - Observe index.blocks.read has been automatically unset to false
Expected behavior
Manually-set index.blocks.read should persist until explicitly removed by the user. The auto-release behavior should either:
- Be disabled by default (breaking change), OR
- Be controllable via a new setting cluster.blocks.read.auto_release (similar to
cluster.blocks.create_index.auto_release), OR - Only apply to blocks that were set by the system (file cache mechanism)
Additional Details
In DiskThresholdMonitor.handleReadBlocks(), the code releases INDEX_READ_BLOCK on any index not in indicesToBlockRead. The indicesToBlockRead set is only populated for warm nodes exceeding file cache search threshold. For all other nodes/indices, this set is empty, causing ALL read blocks to be auto-released.
private void handleReadBlocks(ClusterState state, Set<String> indicesToBlockRead, ActionListener<Void> listener) {
final Set<String> indicesToReleaseReadBlock = StreamSupport.stream(...)
.filter(index -> indicesToBlockRead.contains(index) == false) // Always true for non-warm nodes
.filter(index -> state.getBlocks().hasIndexBlock(index, IndexMetadata.INDEX_READ_BLOCK))
.collect(Collectors.toSet());
if (indicesToReleaseReadBlock.isEmpty() == false) {
updateIndicesReadBlock(indicesToReleaseReadBlock, listener, false); // <<<<< Unconditionally released
}
}
Suggested fix: Add cluster.blocks.read.auto_release setting to DiskThresholdSettings, similar to CLUSTER_CREATE_INDEX_BLOCK_AUTO_RELEASE.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status