Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix empty logs and status messages for mmless ingestion #15527

Merged
merged 2 commits into from
Dec 11, 2023

Conversation

georgew5656
Copy link
Contributor

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:

  • been self-reviewed.
  • 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
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

Copy link
Contributor

@suneet-s suneet-s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My one hesitation with writing the log files directly is that some users may choose to configure the format of the logs that are written in their log4j.xml. If we just write this log line using StringUtils.format, users may not be able to parse their logs.

Have you considered this? Is there a way we could have this be written in the same format as the pron logs?

None of my comments are blockers, but it would be good to double check the log levels of the messages

@@ -288,7 +288,11 @@ private TaskStatus getTaskStatus(long duration)
TaskStatus.class
);
} else {
taskStatus = TaskStatus.failure(taskId.getOriginalTaskId(), "task status not found");
log.info(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
log.info(
log.warn(

Why info and not warn? This seems like it's not normal operations

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.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@georgew5656 georgew5656 merged commit 4152f1d into apache:master Dec 11, 2023
53 checks passed
@LakshSingla LakshSingla added this to the 29.0.0 milestone Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants