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

remove problems reports #5019

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

keith-turner
Copy link
Contributor

@keith-turner keith-turner commented Oct 28, 2024

Removes problem reports and replaces them with log messages that identifies the file and table that had the error.

Removes problem reports and replaces them with log messages that
identify the file and table that had the error.
@keith-turner keith-turner added this to the 4.0.0 milestone Oct 28, 2024
@keith-turner keith-turner linked an issue Oct 28, 2024 that may be closed by this pull request
Copy link
Contributor

@dlmarion dlmarion left a comment

Choose a reason for hiding this comment

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

No issue with these changes. But I'm wondering if all of the log messages that occur next to the removed ProblemReport should all go to a centralized Logger, including the ProblemReportingIterator.

@keith-turner
Copy link
Contributor Author

No issue with these changes. But I'm wondering if all of the log messages that occur next to the removed ProblemReport should all go to a centralized Logger, including the ProblemReportingIterator.

I will take a pass at improving the log messages logger, may be able to use the table files logger in some cases.

@ddanielr
Copy link
Contributor

No issue with these changes. But I'm wondering if all of the log messages that occur next to the removed ProblemReport should all go to a centralized Logger, including the ProblemReportingIterator.

I will take a pass at improving the log messages logger, may be able to use the table files logger in some cases.

We've discussed having an "event" type logger. Not sure if that makes things simpler vs having a dedicated logger for problems. Using MDC (Mapped Diagnostic Context) might make this easier.
We currently use slf4j which has a noop MDC https://www.slf4j.org/api/org/slf4j/MDC.html but I believe both log4j and logback support MDC.

Copy link
Member

@ctubbsii ctubbsii left a comment

Choose a reason for hiding this comment

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

Overall, I really like this change. I think it simplifies a lot of custom problem reporting that is better handled with logging or other system monitoring that the user might deploy.

I would like to apply this change to the 3.1 branch, and I think we should add a notice about it being removed in the 2.1.4 release.

…n/FileCompactor.java

Co-authored-by: Christopher Tubbs <[email protected]>
@ctubbsii
Copy link
Member

Using MDC (Mapped Diagnostic Context) might make this easier

I don't think it would make it easier. slf4j, log4j 1.2, and log4j2 all have different thread-local context concepts, and it requires a converter to switch between them. It really introduces a lot of complexity, from using more of the slf4j API rather than treating it as a simple logging facade, to adding extra configuration and possibly code to convert between them, and modifying the logging templates to include the map context. It also forces developers to think about thread-local views of the context, every time you want to include thread-local context in a log message, and is likely going to lead to a lot of programmer errors with regard to logging (like not realizing that a log message originating from a class executed in an executor won't inherit the context, when refactoring code that logs).

It'd be much easier to just avoid MDC and ThreadLocalContext for logging, and limit our use of slf4j to a very simple logging facade for the basic log level methods logger.info(), logger.error(), etc. If we want to log additional contextual details, it's much easier to maintain if we just pass around the contextual data we want to log, and include it directly in the message string. MDC/ThreadLocalContext is really best used for general-purpose context information you want to include in every log message, but aren't directly related to what is being logged (like the client IP address and username associated with a request, in a server-side error message that handles the request - not directly related to the error, but perhaps useful to know who is triggering it or who is impacted by it). I don't think that's quite the use case we have here.

@keith-turner
Copy link
Contributor Author

No issue with these changes. But I'm wondering if all of the log messages that occur next to the removed ProblemReport should all go to a centralized Logger, including the ProblemReportingIterator.

I will take a pass at improving the log messages logger, may be able to use the table files logger in some cases.

@dlmarion updated the logging to use some of the existing named loggers for tablet events in 111a7e5

Comment on lines -178 to -180
if (e.getMessage() != null) {
log.warn("{}", e.getMessage());
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These lines seemed kinda pointless so I removed them. Not sure if I am missing something.

Copy link
Member

Choose a reason for hiding this comment

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

Removing it looks right to me.

@keith-turner
Copy link
Contributor Author

I would like to apply this change to the 3.1 branch, and I think we should add a notice about it being removed in the 2.1.4 release.

@ctubbsii if you want to apply this change to the 3.1 branch that is fine with me. I am finished making changes with this branch so feel free to do whatever you think is best to get these changes to 3.1.

@ctubbsii
Copy link
Member

I would like to apply this change to the 3.1 branch, and I think we should add a notice about it being removed in the 2.1.4 release.

@ctubbsii if you want to apply this change to the 3.1 branch that is fine with me. I am finished making changes with this branch so feel free to do whatever you think is best to get these changes to 3.1.

Okay. Please hold off on merging it, then. I'll rebase it onto the 3.1 branch, and move the upgrade code to the 3.1 upgrade code. The notice on the 2.1 monitor can be added in a subsequent change. But, I don't want this merged, because the target upgrade code will be different, and it will cause unnecessary conflicts if merged to main first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Removal of Problem Reports and replacement with problem log
4 participants