Skip to content

Send error back from TabletManagementIterator on invalid metadata #5668

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dlmarion
Copy link
Contributor

Modified the TabletManagementIterator to invoke getPrevEndRow() on the constructed TabletMetadata object to catch a the raised IllegalStateException and return it to the Manager. The existing try/catch around computeTabletManagementActions would likely throw the IllegalStateException when tm.getExtent is called when trying to log an error, preventing the error from being retured to the Manager.

There is an existing test case, TabletMetadataTest.testAbsentPrevRow, which demonstrates that an IllegalStateException is raised when TabletMetadata.convertRow is called on a set of keys that don't contain a prevEndRow.

Closes #5658

Modified the TabletManagementIterator to invoke getPrevEndRow()
on the constructed TabletMetadata object to catch a the raised
IllegalStateException and return it to the Manager. The existing
try/catch around computeTabletManagementActions would likely
throw the IllegalStateException when tm.getExtent is called
when trying to log an error, preventing the error from being
retured to the Manager.

There is an existing test case, TabletMetadataTest.testAbsentPrevRow,
which demonstrates that an IllegalStateException is raised when
TabletMetadata.convertRow is called on a set of keys that don't
contain a prevEndRow.

Closes apache#5658
@dlmarion dlmarion added this to the 4.0.0 milestone Jun 20, 2025
@dlmarion dlmarion requested a review from keith-turner June 20, 2025 18:09
@dlmarion dlmarion self-assigned this Jun 20, 2025
Copy link
Contributor

@keith-turner keith-turner left a comment

Choose a reason for hiding this comment

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

Would be really nice to add some tests to TabletManagementIteratorIT to cover a few cases and ensure that the tablets that are ok are returned and the ones that have illegal metadata are reported. Maybe something like the following?

Maybe something like the following

  1. ok tablet that needs split
  2. tablet w/ missing end row
  3. ok tablet
  4. tablet w/ invalid json in the file column
  5. ok tablet
  6. tablet w/ valid json w/ a range that does not overlap that tablet (not sure this will cause a failure)
  7. What other busted tablet metadata situations could we cover?

} catch (Exception e) {
LOG.error("Error computing tablet management actions for extent: {}", tm.getExtent(), e);
// Validate that a minimum set of keys were seen to create a valid tablet
tm.getPrevEndRow();
Copy link
Contributor

Choose a reason for hiding this comment

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

A few lines up there is a call to TabletMetadata.convertRow() that could possibly fail. If it does it would be nice to handle that propogating back an error and log keys.get(0).getRow() to point to the row of the busted tablet.

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.

Improve error reporting for illegal data in accumulo.metadata seen during manager metadata scan
2 participants