-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Transform] Handle permanent bulk indexing errors (#51307)
check bulk indexing error for permanent problems and ensure the state goes into failed instead of retry. Corrects the stats API to show the real error and avoids excessive audit logging. fixes #50122
- Loading branch information
Hendrik Muhs
committed
Jan 23, 2020
1 parent
84664e8
commit 3553f68
Showing
9 changed files
with
183 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...orm/src/main/java/org/elasticsearch/xpack/transform/transforms/BulkIndexingException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
package org.elasticsearch.xpack.transform.transforms; | ||
|
||
import org.elasticsearch.ElasticsearchException; | ||
|
||
// Wrapper for indexing failures thrown internally in the transform indexer | ||
class BulkIndexingException extends ElasticsearchException { | ||
private final boolean irrecoverable; | ||
|
||
/** | ||
* Create a BulkIndexingException | ||
* | ||
* @param msg The message | ||
* @param cause The most important cause of the bulk indexing failure | ||
* @param irrecoverable whether this is a permanent or irrecoverable error (controls retry) | ||
* @param args arguments for formating the message | ||
*/ | ||
BulkIndexingException(String msg, Throwable cause, boolean irrecoverable, Object... args) { | ||
super(msg, cause, args); | ||
this.irrecoverable = irrecoverable; | ||
} | ||
|
||
public boolean isIrrecoverable() { | ||
return irrecoverable; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...nsform/src/main/java/org/elasticsearch/xpack/transform/transforms/TransformException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
package org.elasticsearch.xpack.transform.transforms; | ||
|
||
import org.elasticsearch.ElasticsearchException; | ||
|
||
class TransformException extends ElasticsearchException { | ||
TransformException(String msg, Throwable cause, Object... args) { | ||
super(msg, cause, args); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters