[ 
https://issues.apache.org/jira/browse/GOBBLIN-787?focusedWorklogId=250504&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-250504
 ]

ASF GitHub Bot logged work on GOBBLIN-787:
------------------------------------------

                Author: ASF GitHub Bot
            Created on: 29/May/19 20:49
            Start Date: 29/May/19 20:49
    Worklog Time Spent: 10m 
      Work Description: htran1 commented on pull request #2653: [GOBBLIN-787] 
Add an option to include the task start time in the out…
URL: https://github.com/apache/incubator-gobblin/pull/2653#discussion_r288682047
 
 

 ##########
 File path: 
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/fork/Fork.java
 ##########
 @@ -529,9 +529,18 @@ protected void cleanup() {
    */
   private DataWriter<Object> buildWriter()
       throws IOException {
+    String writerId = this.taskId;
+
+    // Add the task starting time if configured.
+    // This is used to reduce file name collisions which can happen due to the 
scheduling of a task on multiple workers.
+    // One case where this occurs is when a worker gets disconnected from a 
Helix cluster.
+    if 
(this.taskState.getPropAsBoolean(ConfigurationKeys.WRITER_ADD_TASK_TIMESTAMP, 
false)) {
+        writerId = this.taskId + "_" + 
this.taskState.getProp(ConfigurationKeys.TASK_START_TIME_MILLIS_KEY, "0");
 
 Review comment:
   Changed the code to raise an error if the task start time is not set as 
suggested by Shirshanka.
   The reason for using a fixed time assigned at task startup is to allow 
grouping of output files which can be useful to understand debug issues with 
task execution or to understand how much data comes from each task.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 250504)
    Time Spent: 1h 10m  (was: 1h)

> Add an option to include the task start time in the output file name
> --------------------------------------------------------------------
>
>                 Key: GOBBLIN-787
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-787
>             Project: Apache Gobblin
>          Issue Type: Task
>            Reporter: Hung Tran
>            Assignee: Hung Tran
>            Priority: Major
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> In some cases a task may be scheduled to run on multiple workers. One case 
> where this happens is when running with the Helix task execution framework. 
> Helix may reschedule a task on a different worker if it loses contact with a 
> worker. That worker may continue executing for some time before the task is 
> terminated. During this period if the output file names collide then there 
> may be an error during data publish.
> Add an option "writer.addTaskTimestamp" that can be used to reduce the chance 
> of name collisions by appending a task startup timestamp to the file name.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to