flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-5487) Proper at-least-once support for ElasticsearchSink
Date Tue, 21 Feb 2017 13:19:44 GMT

    [ https://issues.apache.org/jira/browse/FLINK-5487?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15875948#comment-15875948

ASF GitHub Bot commented on FLINK-5487:

Github user rmetzger commented on a diff in the pull request:

    --- Diff: flink-connectors/flink-connector-elasticsearch-base/src/main/java/org/apache/flink/streaming/connectors/elasticsearch/ElasticsearchSinkBase.java
    @@ -165,20 +286,36 @@ public void beforeBulk(long executionId, BulkRequest request) {
     				public void afterBulk(long executionId, BulkRequest request, BulkResponse response)
     					if (response.hasFailures()) {
    -						for (BulkItemResponse itemResp : response.getItems()) {
    -							Throwable failure = callBridge.extractFailureCauseFromBulkItemResponse(itemResp);
    +						BulkItemResponse itemResponse;
    +						Throwable failure;
    +						for (int i = 0; i < response.getItems().length; i++) {
    +							itemResponse = response.getItems()[i];
    +							failure = callBridge.extractFailureCauseFromBulkItemResponse(itemResponse);
     							if (failure != null) {
    -								LOG.error("Failed Elasticsearch item request: {}", failure.getMessage(), failure);
    -								failureThrowable.compareAndSet(null, failure);
    +								LOG.error("Failed Elasticsearch item request: {}", itemResponse.getFailureMessage(),
    +								if (failureHandler.onFailure(request.requests().get(i), failure, requestIndexer))
    --- End diff --
    Mh. I don't know if the use case I've mentioned makes a lot of sense. Probably most of
the users just want to use a custom logic to decide how to do the retries / discards.
    I think we shouldn't do complicated things like checkpointing the state of the failure
handler. Its good enough if the user keeps it locally (and loses it on failure)

> Proper at-least-once support for ElasticsearchSink
> --------------------------------------------------
>                 Key: FLINK-5487
>                 URL: https://issues.apache.org/jira/browse/FLINK-5487
>             Project: Flink
>          Issue Type: Bug
>          Components: Streaming Connectors
>            Reporter: Tzu-Li (Gordon) Tai
>            Assignee: Tzu-Li (Gordon) Tai
>            Priority: Critical
> Discussion in ML: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Fault-tolerance-guarantees-of-Elasticsearch-sink-in-flink-elasticsearch2-td10982.html
> Currently, the Elasticsearch Sink actually doesn't offer any guarantees for message delivery.
> For proper support of at-least-once, the sink will need to participate in Flink's checkpointing:
when snapshotting is triggered at the {{ElasticsearchSink}}, we need to synchronize on the
pending ES requests by flushing the internal bulk processor. For temporary ES failures (see
FLINK-5122) that may happen on the flush, we should retry them before returning from snapshotting
and acking the checkpoint. If there are non-temporary ES failures on the flush, the current
snapshot should fail.

This message was sent by Atlassian JIRA

View raw message