Skip to content

Move checks to the MergeCommand class#6431

Draft
ddanielr wants to merge 4 commits into
apache:2.1from
ddanielr:feature/move-metadata-table-check
Draft

Move checks to the MergeCommand class#6431
ddanielr wants to merge 4 commits into
apache:2.1from
ddanielr:feature/move-metadata-table-check

Conversation

@ddanielr

Copy link
Copy Markdown
Contributor

Move the metadata table name check into the shell's MergeCommand and allow it to be ran with a confirmation prompt.

Merging the metadata table is a legitimate operation for cleaning up empty split points from delete markers (~del), scan server entries (~sserv), deleted tables or error messages (~err).

Relates to #6414 as the current merge code should be refactored into two distinct utilities.

Move the metadata table name check into the shell's MergeCommand and
allow it to be ran with a confirmation prompt.

Merging the metadata table is a legitimate operation for cleaning up
empty split points from delete markers (~del), scan server entries (~sserv), deleted
tables or error messages (~err).
@ddanielr ddanielr added this to the 2.1.5 milestone Jun 16, 2026
@ddanielr ddanielr requested a review from dlmarion June 16, 2026 19:08
Comment on lines +62 to +63
" Warning!!! Merging the " + MetadataTable.NAME + " table incorrectly can result in "
+ "system instability. Are you REALLY sure you want to merge?!?!?!")

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.

Merge will lock the metadata table for write and then unhost the tablets in the range for some period of time while the merge occurs. The metadata tablets could be unhosted under normal balance conditions, but the system will try to host them immediately. I certainly think we should add a test case for this in MergeIT or some other merge related IT. And I'm wondering if we should add a merge of the metadata table during some Fate operations in some Fate IT.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added test cases for merge operations in MergeIT.

For the FateITs it sounds like you want to see what system interruptions might occur if merging the metadata table happened while other fate operation are ongoing.

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.

For the FateITs it sounds like you want to see what system interruptions might occur if merging the metadata table happened while other fate operation are ongoing.

Exactly. It should be fine as metadata tablets can become unhosted during normal balancing, but it would be good to test this case since we are changing the behavior of merge for the metadata table late in the development cycle in a patch release. In fact, we may want to add that something to the message to say that it's experimental if only to get users to test it first.

ddanielr added 2 commits June 16, 2026 19:58
Adds three test cases for merge operations.

Metadata table merge
Metadata table merge with 1 byte size option.
Unsupported root table merge.
@ddanielr ddanielr force-pushed the feature/move-metadata-table-check branch from 61219a1 to 6e3a5fa Compare June 18, 2026 04:37
AccumuloConfiguration tableConfig =
new ConfigurationCopy(client.tableOperations().getConfiguration(opts.tableName));
opts.goalSize = tableConfig.getAsBytes(Property.TABLE_SPLIT_THRESHOLD);
long newGoalSize = tableConfig.getAsBytes(Property.TABLE_SPLIT_THRESHOLD);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This code would previously just output a Merging tablets in table <table> to <size> bytes message but would not explicitly state that the size has changed from what was instructed.

The new code change provides a message describing the change in the size selector.

tablets = TabletsMetadata.builder(context).scanMetadataTable()
tableId = context.getTableId(tableName);
DataLevel dataLevel = DataLevel.of(tableId);
tablets = TabletsMetadata.builder(context).scanTable(dataLevel.metaTable())

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Using the dataLevel of the current table instead of .scanMetadataTable allows the Merge Utility to perform merges against the metadata table.

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