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
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ class ValidateRollover(
if (skipRollover(indexName) || alreadyRolledOver(rolloverTarget, indexName)) return this

if (!isDataStream) {
if (!hasAlias(rolloverTarget, indexName) || !isWriteIndex(rolloverTarget, indexName)
) {
if (!hasAlias(rolloverTarget, indexName) || !isWriteIndex(rolloverTarget, indexName)) {
return this
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ class TransformLockManager(
*/
suspend fun renewLockForLongSearch(timeSpentOnSearch: Long) {
// If the request was longer than 10 minutes and lock expires in less than 20 minutes, renew the lock just in case
if (timeSpentOnSearch > TIMEOUT_UPPER_BOUND_IN_SECONDS && lockExpirationInSeconds() ?: 0 < MAXIMUM_LOCK_EXPIRATION_IN_SECONDS
) {
if (timeSpentOnSearch > TIMEOUT_UPPER_BOUND_IN_SECONDS && lockExpirationInSeconds() ?: 0 < MAXIMUM_LOCK_EXPIRATION_IN_SECONDS) {
this.renewLockForScheduledJob()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,11 +392,13 @@ class RollupInterceptorIT : RollupRestTestCase() {
client().makeRequest("POST", "/target_rollup_search/_search", emptyMap(), StringEntity(req, ContentType.APPLICATION_JSON))
fail("Expected 400 Method BAD_REQUEST response")
} catch (e: ResponseException) {
assertEquals(
val errorMessage = (e.response.asMap() as Map<String, Map<String, Map<String, String>>>)["error"]!!["caused_by"]!!["reason"]!!
assertTrue(
"Wrong error message",
"Could not find a rollup job that can answer this query because [missing field RateCodeID, missing field timestamp, " +
"missing sum aggregation on total_amount]",
(e.response.asMap() as Map<String, Map<String, Map<String, String>>>)["error"]!!["caused_by"]!!["reason"],
errorMessage.startsWith("Could not find a rollup job that can answer this query because") == true &&
errorMessage.contains("missing field RateCodeID") == true &&
errorMessage.contains("missing field timestamp") == true &&
errorMessage.contains("missing sum aggregation on total_amount") == true,
)
assertEquals("Unexpected status", RestStatus.BAD_REQUEST, e.response.restStatus())
}
Expand Down
Loading