Skip to content

Adds --dry-run option to Merge#6437

Open
ddanielr wants to merge 2 commits into
apache:2.1from
ddanielr:feature/6414-add-dry-run-flag
Open

Adds --dry-run option to Merge#6437
ddanielr wants to merge 2 commits into
apache:2.1from
ddanielr:feature/6414-add-dry-run-flag

Conversation

@ddanielr

Copy link
Copy Markdown
Contributor

Adds the --dry-run option to both the Shell's MergeCommand and the Merge utility code.

Fixes an issue where MergeExceptions were being wrapped needlessly.

Adds Mock tests for MergeCommand.
Adds MergeIT tests.

Adds explicit failure message for attempting to merge the accumulo.root table instead of just silently doing nothing.

Adds explicit message if the goalSize is invalid.

closes #6414

Adds the --dry-run option to both the Shell's MergeCommand and the Merge
utility code.

Fixes an issue where MergeExceptions were being wrapped needlessly.

Adds Mock tests for MergeCommand.
Adds MergeIT tests.

Adds explicit failure message for attempting to merge the accumulo.root
table instead of just silently doing nothing.
@ddanielr ddanielr added this to the 2.1.5 milestone Jun 18, 2026
@ddanielr ddanielr linked an issue Jun 18, 2026 that may be closed by this pull request
Comment on lines +119 to +122
long newGoalSize = tableConfig.getAsBytes(Property.TABLE_SPLIT_THRESHOLD);
message("Invalid goal size: " + opts.goalSize + " Using the "
+ Property.TABLE_SPLIT_THRESHOLD.getKey() + " value of : " + newGoalSize);
opts.goalSize = newGoalSize;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This gives more information for the current behavior and doesn't change the current behavior. However, I keep thinking that a goal size of 0 is entirely valid, and makes much more sense than a goal size of 1 when trying to merge away consecutive empty tablets.

Having a goal size of zero auto-magically readjust to the tablet split threshold seems nonsensical to me when an empty size is valid.

I'm glad that this message was added, but I think it might be nice to change the behavior so that you don't have to do -s 1 to get an effective goal size of 0.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A behavior change could be done later, 4.0 rather than change 2.1

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.

Yes I agree that a size of 0 should be a valid value, but I thought that would be a large behavior change in a patch release.

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.

2.1 could support a behavior change by adding a new MergeTablets command in the shell.
The old MergeCommand behavior is preserved but we can support a new command with different behavior.

Comment thread shell/src/main/java/org/apache/accumulo/shell/commands/MergeCommand.java Outdated
Comment thread shell/src/test/java/org/apache/accumulo/shell/commands/MergeCommandTest.java Outdated
Fixes imports for EasyMock and changes description message
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.

Add --dry-run flag to merge command in shell

2 participants