Skip to content

adds trace logging of tablet state computations#5290

Merged
keith-turner merged 2 commits intoapache:mainfrom
keith-turner:tablet-trace-logging
Feb 1, 2025
Merged

adds trace logging of tablet state computations#5290
keith-turner merged 2 commits intoapache:mainfrom
keith-turner:tablet-trace-logging

Conversation

@keith-turner
Copy link
Contributor

Adds trace level logging of the tablet state and tablet goal state. This logging will help understand why the manager is making the decisions it does regarding a particular tablet. For example if the manager is not assigning a tablet that one would expect to be assigned turning on this logging could help. Because the manager uses an iterator to filter tablet metadata in the tablet server, may need to look in the log of manager and tablet servers serving root and metadata tables to see it.

Manually tested this by enabling the trace level logging and runnin some ITs. Found a bug with calling TableMetadata.getExtent() in this testing and corrected that.

Adds trace level logging of the tablet state and tablet goal state. This
logging will help understand why the manager is making the decisions it
does regarding a particular tablet.  For example if the manager is not
assigning a tablet that one would expect to be assigned turning on this
logging could help.  Because the manager uses an iterator to filter
tablet metadata in the tablet server, may need to look in the log of
manager and tablet servers serving root and metadata tables to see it.

Manually tested this by enabling the trace level logging and runnin some
ITs.  Found a bug with calling TableMetadata.getExtent() in this testing
and corrected that.
@keith-turner keith-turner added this to the 4.0.0 milestone Jan 28, 2025
Comment on lines +59 to +60
log.trace("Computed state of {} for {}", tabletState,
TabletsSection.encodeRow(tm.getTableId(), tm.getEndRow()));
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this should be wrapped with log.isTraceEnabled(). This will always call TabletsSection.encodeRow, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah it should, would be good to avoid calling encodeRow().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in 74efc33. Also updated TabletGoalState as it had the same problem.

@keith-turner keith-turner merged commit e37cae1 into apache:main Feb 1, 2025
8 checks passed
@keith-turner keith-turner deleted the tablet-trace-logging branch February 1, 2025 21:15
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