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

catches exceptions and logs when planning compactions #4435

Open
wants to merge 3 commits into
base: elasticity
Choose a base branch
from

Conversation

keith-turner
Copy link
Contributor

No description provided.

String cacheKey = tablet.getTableId() + " " + e.getClass().getName();
// This check defends against every tablet in a table having the same problem and therefore
// generating an enormous amount of spam for the logs.
var last = generateJobsErrorCache.getIfPresent(cacheKey);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you might be able to just call Cache.get(Key,Function) here and last will be null if it doesn't exist.

Suggested change
var last = generateJobsErrorCache.getIfPresent(cacheKey);
if (generateJobsErrorCache.get(cacheKey, () -> System.currentTimeMillis) == null) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looking at the docs for get it will return the computed value if absent. Can get the prev value w/ putIfAbsent. Made that change in d246ee8

"Failed to generate compaction jobs for {}. Other tablets may be experiencing the"
+ " same error, this log message is temporarily suppressed for the entire table.",
tablet.getExtent(), e);
generateJobsErrorCache.put(cacheKey, System.currentTimeMillis());
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this if you apply my suggestion above.

Suggested change
generateJobsErrorCache.put(cacheKey, System.currentTimeMillis());

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

Successfully merging this pull request may close these issues.

None yet

2 participants