Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@ integTest {
excludeTestsMatching "org.opensearch.indexmanagement.indexstatemanagement.action.NotificationActionIT"
}
}

filter {
excludeTestsMatching "org.opensearch.indexmanagement.indexstatemanagement.MetadataRegressionIT"
}
}

run {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ Compatible with OpenSearch 1.0.0-rc1

### Enhancements

* Improve integration with data streams ([#13](https://github.com/opensearch-project/index-management/pull/13))
* Improve integration with data streams ([#13](https://github.com/opensearch-project/index-management/pull/13))

### Bug Fixes

* Fix 7.10 rollover blocking thread issue ([#70](https://github.com/opensearch-project/index-management/pull/70))
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@
package org.opensearch.indexmanagement.indexstatemanagement

import org.apache.logging.log4j.LogManager
import org.opensearch.action.ActionListener
import org.opensearch.action.DocWriteRequest
import org.opensearch.action.admin.cluster.state.ClusterStateRequest
import org.opensearch.action.admin.indices.delete.DeleteIndexRequest
import org.opensearch.action.admin.indices.rollover.RolloverRequest
import org.opensearch.action.admin.indices.rollover.RolloverResponse
import org.opensearch.action.bulk.BulkRequest
import org.opensearch.action.bulk.BulkResponse
import org.opensearch.action.index.IndexRequest
Expand Down Expand Up @@ -134,9 +136,9 @@ class IndexStateManagementHistory(
deleteOldHistoryIndex()
}

private fun rolloverHistoryIndex(): Boolean {
private fun rolloverHistoryIndex() {
if (!indexManagementIndices.indexStateManagementIndexHistoryExists()) {
return false
return
}

// We have to pass null for newIndexName in order to get Elastic to increment the index count.
Expand All @@ -151,11 +153,25 @@ class IndexStateManagementHistory(
)
request.addMaxIndexDocsCondition(historyMaxDocs)
request.addMaxIndexAgeCondition(historyMaxAge)
val response = client.admin().indices().rolloverIndex(request).actionGet()
if (!response.isRolledOver) {
logger.info("${IndexManagementIndices.HISTORY_WRITE_INDEX_ALIAS} not rolled over. Conditions were: ${response.conditionStatus}")
}
return response.isRolledOver
client.admin().indices().rolloverIndex(
request,
object : ActionListener<RolloverResponse> {
override fun onResponse(response: RolloverResponse) {
if (response.isRolledOver) {
logger.info("${IndexManagementIndices.HISTORY_WRITE_INDEX_ALIAS} rolled over.")
} else {
logger.info(
"${IndexManagementIndices.HISTORY_WRITE_INDEX_ALIAS} not rolled over. " +
"Conditions were: ${response.conditionStatus}"
)
}
}

override fun onFailure(e: Exception) {
logger.error("${IndexManagementIndices.HISTORY_WRITE_INDEX_ALIAS} roll over failed.", e)
}
}
)
}

@Suppress("SpreadOperator", "NestedBlockDepth", "ComplexMethod")
Expand Down