Skip to content

Cleanup recovery code#6261

Open
ddanielr wants to merge 2 commits intoapache:mainfrom
ddanielr:feature/reduce-serverContext-usages
Open

Cleanup recovery code#6261
ddanielr wants to merge 2 commits intoapache:mainfrom
ddanielr:feature/reduce-serverContext-usages

Conversation

@ddanielr
Copy link
Copy Markdown
Contributor

Fixes log message formats.
Removes serverContext from method signatures where they aren't needed.
Removes unused VolumeManager from method signature.

Removes ServerContext from being passed around since a tserver object is
already set within the logger.

Also removed a reference to a VolumeManager that was not being used.
@ddanielr ddanielr added this to the 4.0.0 milestone Mar 27, 2026
Copy link
Copy Markdown
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.

I think the changes are good, but I'm not sure we want to log stack traces on these warnings.

// ignore
} catch (IOException | RuntimeException ex) {
log.error("Unable to cleanly close log " + currentLog.getLogEntry() + ": " + ex, ex);
log.error("Unable to cleanly close log {}: {}", currentLog.getLogEntry(), ex, ex);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think the first ex can just be removed. This is going to log the entire stack trace.

return HostAndPort.fromString(managers.iterator().next().toHostPortString());
} catch (Exception e) {
log.warn("Failed to obtain manager host " + e);
log.warn("Failed to obtain manager host", e);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If this prints the entire stack trace, then I think this is a behavior change. Previously this would print Exception.toString, not the entire stack trace. Suggest adding a placeholder to the message {}.

return new TServerInstance(getAdvertiseAddress().toString(), lockSessionId);
} catch (Exception ex) {
log.warn("Unable to read session from tablet server lock" + ex);
log.warn("Unable to read session from tablet server lock", ex);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same comment here about behavior change.

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.

2 participants