You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flume.apache.org by "Denes Arvay (JIRA)" <ji...@apache.org> on 2017/06/15 11:57:00 UTC
[jira] [Updated] (FLUME-3109) Make HDFS Sink's idleTimeout more
robust
[ https://issues.apache.org/jira/browse/FLUME-3109?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Denes Arvay updated FLUME-3109:
-------------------------------
Description:
Currently the {{idleFuture}} which is responsible of closing idle files is scheduled in {{BucketWriter.flush()}} while it is cancelled in {{BucketWriter.append()}}.
If events were appended to a BucketWriter but the next flush failed then the {{idleFuture}} won't be scheduled, which lead to unclosed/unrenamed files in a setup where there is no other logic to close/rename the files (i.e. hdfs.rollInterval, hdfs.rollSize and hdfs.rollCount are all 0).
Moreover, if any of the {{flush()}} calls fail in {{HDFSEventSink.process()}} (https://github.com/apache/flume/blob/trunk/flume-ng-sinks/flume-hdfs-sink/src/main/java/org/apache/flume/sink/hdfs/HDFSEventSink.java#L429) then all the subsequent flushes will be skipped thus no idleFutures will be scheduled.
I'd recommend to move the scheduling of the idleFuture (https://github.com/apache/flume/blob/trunk/flume-ng-sinks/flume-hdfs-sink/src/main/java/org/apache/flume/sink/hdfs/BucketWriter.java#L450-L467) to {{BucketWriter.append()}}.
was:
Currently the {{idleFuture}} which is responsible of closing idle files is scheduled in {{BucketWriter.flush()}} while it is cancelled in {{BucketWriter.append()}}.
If events were appended to a BucketWriter but the next flush failed then the {{idleFuture}} won't be scheduled, which lead to unclosed/unrenamed files in a setup where there is no other logic to close/rename the files (i.e. hdfs.rollInterval, hdfs.rollSize and hdfs.rollCount are all 0).
Moreover, if any of the {{flush()}} close calls fail in {{HDFSEventSink.process()}} (https://github.com/apache/flume/blob/trunk/flume-ng-sinks/flume-hdfs-sink/src/main/java/org/apache/flume/sink/hdfs/HDFSEventSink.java#L429) then all the subsequent flushes will be skipped thus no idleFutures will be scheduled.
I'd recommend to move the scheduling of the idleFuture (https://github.com/apache/flume/blob/trunk/flume-ng-sinks/flume-hdfs-sink/src/main/java/org/apache/flume/sink/hdfs/BucketWriter.java#L450-L467) to {{BucketWriter.append()}}.
> Make HDFS Sink's idleTimeout more robust
> ----------------------------------------
>
> Key: FLUME-3109
> URL: https://issues.apache.org/jira/browse/FLUME-3109
> Project: Flume
> Issue Type: Improvement
> Affects Versions: 1.7.0
> Reporter: Denes Arvay
> Assignee: Denes Arvay
>
> Currently the {{idleFuture}} which is responsible of closing idle files is scheduled in {{BucketWriter.flush()}} while it is cancelled in {{BucketWriter.append()}}.
> If events were appended to a BucketWriter but the next flush failed then the {{idleFuture}} won't be scheduled, which lead to unclosed/unrenamed files in a setup where there is no other logic to close/rename the files (i.e. hdfs.rollInterval, hdfs.rollSize and hdfs.rollCount are all 0).
> Moreover, if any of the {{flush()}} calls fail in {{HDFSEventSink.process()}} (https://github.com/apache/flume/blob/trunk/flume-ng-sinks/flume-hdfs-sink/src/main/java/org/apache/flume/sink/hdfs/HDFSEventSink.java#L429) then all the subsequent flushes will be skipped thus no idleFutures will be scheduled.
> I'd recommend to move the scheduling of the idleFuture (https://github.com/apache/flume/blob/trunk/flume-ng-sinks/flume-hdfs-sink/src/main/java/org/apache/flume/sink/hdfs/BucketWriter.java#L450-L467) to {{BucketWriter.append()}}.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)