You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "georgew5656 (via GitHub)" <gi...@apache.org> on 2023/12/08 20:26:38 UTC

[PR] Fix empty logs and status messages for mmless ingestion (druid)

georgew5656 opened a new pull request, #15527:
URL: https://github.com/apache/druid/pull/15527

   ### Description
   It is occasionally possible for a task running with the KubernetesTaskRunner to unsuccessfully push its status.json or for K8s to delete the log of the task before the overlord can pull it.
   
   This can happen if a pod is evicted due to memory or disk pressure. The thing to do in response to this is check K8s events/metrics but the error messages in druid are not very clear.
   
   Additionaly, when the overlord is unable to pull task logs, it uploads a empty log file which never gets deleted b/c the log file deleter ignores empty files.
   
   #### Fixed the bug ...
   #### Renamed the class ...
   #### Added a forbidden-apis entry ...
   
   - Update error taskStatus when status.json is not found.
   - Push a explanatory log if the task log is not found.
   
   #### Release note
   - Some QOL changes to mmless ingestion
   
   ##### Key changed/added classes in this PR
    * `KubernetesPeonLifecycle`
   
   
   This PR has:
   
   - [X] been self-reviewed.
      - [ ] using the [concurrency checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md) (Remove this item if the PR doesn't have any relation to concurrency.)
   - [ ] added documentation for new or modified features or behaviors.
   - [ ] a release note entry in the PR description.
   - [ ] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
   - [ ] added or updated version, license, or notice information in [licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
   - [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
   - [X] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for [code coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md) is met.
   - [ ] added integration tests.
   - [X] been tested in a test Druid cluster.
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] Fix empty logs and status messages for mmless ingestion (druid)

Posted by "suneet-s (via GitHub)" <gi...@apache.org>.
suneet-s commented on code in PR #15527:
URL: https://github.com/apache/druid/pull/15527#discussion_r1422924053


##########
extensions-contrib/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/KubernetesPeonLifecycle.java:
##########
@@ -329,6 +333,15 @@ protected void saveLogs()
           FileUtils.copyInputStreamToFile(logWatch.getOutput(), file.toFile());
         } else {
           log.debug("Log stream not found for %s", taskId.getOriginalTaskId());
+          FileUtils.writeStringToFile(
+              file.toFile(),
+              StringUtils.format(
+                  "Peon for task [%s] did not report any logs. Check k8s metrics and events for the pod to see what happened.",

Review Comment:
   Should the log line on 335 be updated to include this information. Also is there a reason that log message isnot warn?



##########
extensions-contrib/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/KubernetesPeonLifecycle.java:
##########
@@ -288,7 +288,11 @@ private TaskStatus getTaskStatus(long duration)
             TaskStatus.class
         );
       } else {
-        taskStatus = TaskStatus.failure(taskId.getOriginalTaskId(), "task status not found");
+        log.info(

Review Comment:
   ```suggestion
           log.warn(
   ```
   
   Why info and not warn? This seems like it's not normal operations



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] Fix empty logs and status messages for mmless ingestion (druid)

Posted by "georgew5656 (via GitHub)" <gi...@apache.org>.
georgew5656 merged PR #15527:
URL: https://github.com/apache/druid/pull/15527


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org