[jira] [Work logged] (HIVE-24145) Fix preemption issues in reducers and file sink operators

2020-10-13 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-24145?focusedWorklogId=499908=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-499908
 ]

ASF GitHub Bot logged work on HIVE-24145:
-

Author: ASF GitHub Bot
Created on: 13/Oct/20 08:13
Start Date: 13/Oct/20 08:13
Worklog Time Spent: 10m 
  Work Description: kgyrtkirk closed pull request #1485:
URL: https://github.com/apache/hive/pull/1485


   



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:
us...@infra.apache.org


Issue Time Tracking
---

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

> Fix preemption issues in reducers and file sink operators
> -
>
> Key: HIVE-24145
> URL: https://issues.apache.org/jira/browse/HIVE-24145
> Project: Hive
>  Issue Type: Bug
>Reporter: Ramesh Kumar Thangarajan
>Assignee: Ramesh Kumar Thangarajan
>Priority: Major
>  Labels: pull-request-available
> Fix For: 4.0.0
>
>  Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> There are two issues because of preemption:
>  # Reducers are getting reordered as part of optimizations because of which 
> more preemption happen
>  # Preemption in the middle of writing can cause the file to not close and 
> lead to errors when we read the file later



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-24145) Fix preemption issues in reducers and file sink operators

2020-09-12 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-24145?focusedWorklogId=483513=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-483513
 ]

ASF GitHub Bot logged work on HIVE-24145:
-

Author: ASF GitHub Bot
Created on: 12/Sep/20 22:01
Start Date: 12/Sep/20 22:01
Worklog Time Spent: 10m 
  Work Description: rbalamohan commented on a change in pull request #1485:
URL: https://github.com/apache/hive/pull/1485#discussion_r486786544



##
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/FileSinkOperator.java
##
@@ -216,29 +216,47 @@ public FSPaths(Path specPath, boolean isMmTable, boolean 
isDirectInsert, boolean
 }
 
 public void closeWriters(boolean abort) throws HiveException {
+  Exception exception = null;
   for (int idx = 0; idx < outWriters.length; idx++) {
 if (outWriters[idx] != null) {
   try {
 outWriters[idx].close(abort);
 updateProgress();
   } catch (IOException e) {
-throw new HiveException(e);
+exception = e;
+LOG.error("Error closing " + outWriters[idx].toString(), e);
+// continue closing others
   }
 }
   }
-  try {
+  for (int i = 0; i < updaters.length; i++) {
+if (updaters[i] != null) {
+  SerDeStats stats = updaters[i].getStats();
+  // Ignore 0 row files except in case of insert overwrite
+  if (isDirectInsert && (stats.getRowCount() > 0 || 
isInsertOverwrite)) {
+outPathsCommitted[i] = updaters[i].getUpdatedFilePath();
+  }
+  try {
+updaters[i].close(abort);
+  } catch (IOException e) {
+exception = e;
+LOG.error("Error closing " + updaters[i].toString(), e);
+// continue closing others
+  }
+}
+  }
+  // Made an attempt to close all writers.
+  if (exception != null) {
 for (int i = 0; i < updaters.length; i++) {
   if (updaters[i] != null) {
-SerDeStats stats = updaters[i].getStats();
-// Ignore 0 row files except in case of insert overwrite
-if (isDirectInsert && (stats.getRowCount() > 0 || 
isInsertOverwrite)) {
-  outPathsCommitted[i] = updaters[i].getUpdatedFilePath();
+try {
+  fs.delete(updaters[i].getUpdatedFilePath(), true);
+} catch (IOException e) {
+  e.printStackTrace();

Review comment:
   LOG?

##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/optimizer/SortedDynPartitionOptimizer.java
##
@@ -284,6 +285,11 @@ public Object process(Node nd, Stack stack, 
NodeProcessorCtx procCtx,
   // Create ReduceSink operator
   ReduceSinkOperator rsOp = getReduceSinkOp(partitionPositions, 
sortPositions, sortOrder, sortNullOrder,
   allRSCols, bucketColumns, numBuckets, fsParent, 
fsOp.getConf().getWriteType());
+  // we have to make sure not to reorder the child operators as it might 
cause weird behavior in the tasks at
+  // the same level. when there is auto stats gather at the same level as 
another operation then it might
+  // cause unnecessary preemption. Maintaining the order here to avoid 
such preemption and possible errors

Review comment:
   Plz add TEZ-3296 as ref if possible.





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:
us...@infra.apache.org


Issue Time Tracking
---

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

> Fix preemption issues in reducers and file sink operators
> -
>
> Key: HIVE-24145
> URL: https://issues.apache.org/jira/browse/HIVE-24145
> Project: Hive
>  Issue Type: Bug
>Reporter: Ramesh Kumar Thangarajan
>Assignee: Ramesh Kumar Thangarajan
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> There are two issues because of preemption:
>  # Reducers are getting reordered as part of optimizations because of which 
> more preemption happen
>  # Preemption in the middle of writing can cause the file to not close and 
> lead to errors when we read the file later



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-24145) Fix preemption issues in reducers and file sink operators

2020-09-12 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-24145?focusedWorklogId=483190=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-483190
 ]

ASF GitHub Bot logged work on HIVE-24145:
-

Author: ASF GitHub Bot
Created on: 12/Sep/20 21:31
Start Date: 12/Sep/20 21:31
Worklog Time Spent: 10m 
  Work Description: ramesh0201 opened a new pull request #1485:
URL: https://github.com/apache/hive/pull/1485







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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 483190)
Time Spent: 1h  (was: 50m)

> Fix preemption issues in reducers and file sink operators
> -
>
> Key: HIVE-24145
> URL: https://issues.apache.org/jira/browse/HIVE-24145
> Project: Hive
>  Issue Type: Bug
>Reporter: Ramesh Kumar Thangarajan
>Assignee: Ramesh Kumar Thangarajan
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 1h
>  Remaining Estimate: 0h
>
> There are two issues because of preemption:
>  # Reducers are getting reordered as part of optimizations because of which 
> more preemption happen
>  # Preemption in the middle of writing can cause the file to not close and 
> lead to errors when we read the file later



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-24145) Fix preemption issues in reducers and file sink operators

2020-09-12 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-24145?focusedWorklogId=482783=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-482783
 ]

ASF GitHub Bot logged work on HIVE-24145:
-

Author: ASF GitHub Bot
Created on: 12/Sep/20 20:21
Start Date: 12/Sep/20 20:21
Worklog Time Spent: 10m 
  Work Description: ramesh0201 opened a new pull request #1485:
URL: https://github.com/apache/hive/pull/1485







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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 482783)
Time Spent: 50m  (was: 40m)

> Fix preemption issues in reducers and file sink operators
> -
>
> Key: HIVE-24145
> URL: https://issues.apache.org/jira/browse/HIVE-24145
> Project: Hive
>  Issue Type: Bug
>Reporter: Ramesh Kumar Thangarajan
>Assignee: Ramesh Kumar Thangarajan
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> There are two issues because of preemption:
>  # Reducers are getting reordered as part of optimizations because of which 
> more preemption happen
>  # Preemption in the middle of writing can cause the file to not close and 
> lead to errors when we read the file later



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-24145) Fix preemption issues in reducers and file sink operators

2020-09-12 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-24145?focusedWorklogId=482691=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-482691
 ]

ASF GitHub Bot logged work on HIVE-24145:
-

Author: ASF GitHub Bot
Created on: 12/Sep/20 20:12
Start Date: 12/Sep/20 20:12
Worklog Time Spent: 10m 
  Work Description: rbalamohan commented on a change in pull request #1485:
URL: https://github.com/apache/hive/pull/1485#discussion_r486786544



##
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/FileSinkOperator.java
##
@@ -216,29 +216,47 @@ public FSPaths(Path specPath, boolean isMmTable, boolean 
isDirectInsert, boolean
 }
 
 public void closeWriters(boolean abort) throws HiveException {
+  Exception exception = null;
   for (int idx = 0; idx < outWriters.length; idx++) {
 if (outWriters[idx] != null) {
   try {
 outWriters[idx].close(abort);
 updateProgress();
   } catch (IOException e) {
-throw new HiveException(e);
+exception = e;
+LOG.error("Error closing " + outWriters[idx].toString(), e);
+// continue closing others
   }
 }
   }
-  try {
+  for (int i = 0; i < updaters.length; i++) {
+if (updaters[i] != null) {
+  SerDeStats stats = updaters[i].getStats();
+  // Ignore 0 row files except in case of insert overwrite
+  if (isDirectInsert && (stats.getRowCount() > 0 || 
isInsertOverwrite)) {
+outPathsCommitted[i] = updaters[i].getUpdatedFilePath();
+  }
+  try {
+updaters[i].close(abort);
+  } catch (IOException e) {
+exception = e;
+LOG.error("Error closing " + updaters[i].toString(), e);
+// continue closing others
+  }
+}
+  }
+  // Made an attempt to close all writers.
+  if (exception != null) {
 for (int i = 0; i < updaters.length; i++) {
   if (updaters[i] != null) {
-SerDeStats stats = updaters[i].getStats();
-// Ignore 0 row files except in case of insert overwrite
-if (isDirectInsert && (stats.getRowCount() > 0 || 
isInsertOverwrite)) {
-  outPathsCommitted[i] = updaters[i].getUpdatedFilePath();
+try {
+  fs.delete(updaters[i].getUpdatedFilePath(), true);
+} catch (IOException e) {
+  e.printStackTrace();

Review comment:
   LOG?

##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/optimizer/SortedDynPartitionOptimizer.java
##
@@ -284,6 +285,11 @@ public Object process(Node nd, Stack stack, 
NodeProcessorCtx procCtx,
   // Create ReduceSink operator
   ReduceSinkOperator rsOp = getReduceSinkOp(partitionPositions, 
sortPositions, sortOrder, sortNullOrder,
   allRSCols, bucketColumns, numBuckets, fsParent, 
fsOp.getConf().getWriteType());
+  // we have to make sure not to reorder the child operators as it might 
cause weird behavior in the tasks at
+  // the same level. when there is auto stats gather at the same level as 
another operation then it might
+  // cause unnecessary preemption. Maintaining the order here to avoid 
such preemption and possible errors

Review comment:
   Plz add TEZ-3296 as ref if possible.





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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 482691)
Time Spent: 40m  (was: 0.5h)

> Fix preemption issues in reducers and file sink operators
> -
>
> Key: HIVE-24145
> URL: https://issues.apache.org/jira/browse/HIVE-24145
> Project: Hive
>  Issue Type: Bug
>Reporter: Ramesh Kumar Thangarajan
>Assignee: Ramesh Kumar Thangarajan
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 40m
>  Remaining Estimate: 0h
>
> There are two issues because of preemption:
>  # Reducers are getting reordered as part of optimizations because of which 
> more preemption happen
>  # Preemption in the middle of writing can cause the file to not close and 
> lead to errors when we read the file later



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-24145) Fix preemption issues in reducers and file sink operators

2020-09-10 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-24145?focusedWorklogId=481905=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-481905
 ]

ASF GitHub Bot logged work on HIVE-24145:
-

Author: ASF GitHub Bot
Created on: 11/Sep/20 05:50
Start Date: 11/Sep/20 05:50
Worklog Time Spent: 10m 
  Work Description: rbalamohan commented on a change in pull request #1485:
URL: https://github.com/apache/hive/pull/1485#discussion_r486787799



##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/optimizer/SortedDynPartitionOptimizer.java
##
@@ -284,6 +285,11 @@ public Object process(Node nd, Stack stack, 
NodeProcessorCtx procCtx,
   // Create ReduceSink operator
   ReduceSinkOperator rsOp = getReduceSinkOp(partitionPositions, 
sortPositions, sortOrder, sortNullOrder,
   allRSCols, bucketColumns, numBuckets, fsParent, 
fsOp.getConf().getWriteType());
+  // we have to make sure not to reorder the child operators as it might 
cause weird behavior in the tasks at
+  // the same level. when there is auto stats gather at the same level as 
another operation then it might
+  // cause unnecessary preemption. Maintaining the order here to avoid 
such preemption and possible errors

Review comment:
   Plz add TEZ-3296 as ref if possible.





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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 481905)
Time Spent: 0.5h  (was: 20m)

> Fix preemption issues in reducers and file sink operators
> -
>
> Key: HIVE-24145
> URL: https://issues.apache.org/jira/browse/HIVE-24145
> Project: Hive
>  Issue Type: Bug
>Reporter: Ramesh Kumar Thangarajan
>Assignee: Ramesh Kumar Thangarajan
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> There are two issues because of preemption:
>  # Reducers are getting reordered as part of optimizations because of which 
> more preemption happen
>  # Preemption in the middle of writing can cause the file to not close and 
> lead to errors when we read the file later



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-24145) Fix preemption issues in reducers and file sink operators

2020-09-10 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-24145?focusedWorklogId=481902=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-481902
 ]

ASF GitHub Bot logged work on HIVE-24145:
-

Author: ASF GitHub Bot
Created on: 11/Sep/20 05:45
Start Date: 11/Sep/20 05:45
Worklog Time Spent: 10m 
  Work Description: rbalamohan commented on a change in pull request #1485:
URL: https://github.com/apache/hive/pull/1485#discussion_r486786544



##
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/FileSinkOperator.java
##
@@ -216,29 +216,47 @@ public FSPaths(Path specPath, boolean isMmTable, boolean 
isDirectInsert, boolean
 }
 
 public void closeWriters(boolean abort) throws HiveException {
+  Exception exception = null;
   for (int idx = 0; idx < outWriters.length; idx++) {
 if (outWriters[idx] != null) {
   try {
 outWriters[idx].close(abort);
 updateProgress();
   } catch (IOException e) {
-throw new HiveException(e);
+exception = e;
+LOG.error("Error closing " + outWriters[idx].toString(), e);
+// continue closing others
   }
 }
   }
-  try {
+  for (int i = 0; i < updaters.length; i++) {
+if (updaters[i] != null) {
+  SerDeStats stats = updaters[i].getStats();
+  // Ignore 0 row files except in case of insert overwrite
+  if (isDirectInsert && (stats.getRowCount() > 0 || 
isInsertOverwrite)) {
+outPathsCommitted[i] = updaters[i].getUpdatedFilePath();
+  }
+  try {
+updaters[i].close(abort);
+  } catch (IOException e) {
+exception = e;
+LOG.error("Error closing " + updaters[i].toString(), e);
+// continue closing others
+  }
+}
+  }
+  // Made an attempt to close all writers.
+  if (exception != null) {
 for (int i = 0; i < updaters.length; i++) {
   if (updaters[i] != null) {
-SerDeStats stats = updaters[i].getStats();
-// Ignore 0 row files except in case of insert overwrite
-if (isDirectInsert && (stats.getRowCount() > 0 || 
isInsertOverwrite)) {
-  outPathsCommitted[i] = updaters[i].getUpdatedFilePath();
+try {
+  fs.delete(updaters[i].getUpdatedFilePath(), true);
+} catch (IOException e) {
+  e.printStackTrace();

Review comment:
   LOG?





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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 481902)
Time Spent: 20m  (was: 10m)

> Fix preemption issues in reducers and file sink operators
> -
>
> Key: HIVE-24145
> URL: https://issues.apache.org/jira/browse/HIVE-24145
> Project: Hive
>  Issue Type: Bug
>Reporter: Ramesh Kumar Thangarajan
>Assignee: Ramesh Kumar Thangarajan
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> There are two issues because of preemption:
>  # Reducers are getting reordered as part of optimizations because of which 
> more preemption happen
>  # Preemption in the middle of writing can cause the file to not close and 
> lead to errors when we read the file later



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-24145) Fix preemption issues in reducers and file sink operators

2020-09-10 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-24145?focusedWorklogId=481894=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-481894
 ]

ASF GitHub Bot logged work on HIVE-24145:
-

Author: ASF GitHub Bot
Created on: 11/Sep/20 05:14
Start Date: 11/Sep/20 05:14
Worklog Time Spent: 10m 
  Work Description: ramesh0201 opened a new pull request #1485:
URL: https://github.com/apache/hive/pull/1485


   
   
   ### What changes were proposed in this pull request?
   
   
   
   ### Why are the changes needed?
   
   
   
   ### Does this PR introduce _any_ user-facing change?
   
   
   
   ### How was this patch tested?
   
   



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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 481894)
Remaining Estimate: 0h
Time Spent: 10m

> Fix preemption issues in reducers and file sink operators
> -
>
> Key: HIVE-24145
> URL: https://issues.apache.org/jira/browse/HIVE-24145
> Project: Hive
>  Issue Type: Bug
>Reporter: Ramesh Kumar Thangarajan
>Assignee: Ramesh Kumar Thangarajan
>Priority: Major
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> There are two issues because of preemption:
>  # Reducers are getting reordered as part of optimizations because of which 
> more preemption happen
>  # Preemption in the middle of writing can cause the file to not close and 
> lead to errors when we read the file later



--
This message was sent by Atlassian Jira
(v8.3.4#803005)