Skip to content

Commit

Permalink
fixed IT fail
Browse files Browse the repository at this point in the history
Signed-off-by: Petar Dzepina <petar.dzepina@gmail.com>
  • Loading branch information
petardz committed Aug 4, 2022
1 parent 08c356c commit 6dc3385
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.step.rollup

import org.apache.logging.log4j.LogManager
import org.opensearch.ExceptionsHelper
import org.opensearch.OpenSearchException
import org.opensearch.action.support.WriteRequest
import org.opensearch.action.support.master.AcknowledgedResponse
import org.opensearch.index.engine.VersionConflictEngineException
Expand Down Expand Up @@ -62,7 +63,7 @@ class AttemptCreateRollupJobStep(private val action: RollupAction) : Step(name)
}
} catch (e: RemoteTransportException) {
processFailure(rollup.id, indexName, ExceptionsHelper.unwrapCause(e) as Exception)
} catch (e: Exception) {
} catch (e: OpenSearchException) {
processFailure(rollup.id, indexName, e)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ class TransportIndexRollupAction @Inject constructor(
if (response.isAcknowledged) {
log.info("Successfully created or updated $INDEX_MANAGEMENT_INDEX with newest mappings.")
if (request.opType() == DocWriteRequest.OpType.CREATE) {
if (!validateTargetIndexName()) {
return actionListener.onFailure(
OpenSearchStatusException(
"target_index value is invalid: ${request.rollup.targetIndex}",
RestStatus.BAD_REQUEST
)
)
}
putRollup()
} else {
getRollup()
Expand Down

0 comments on commit 6dc3385

Please sign in to comment.