Skip to content

Conversation

dlmarion
Copy link
Contributor

Filters on TabletMetadata were not being applied to the root tablet metadata causing an exception in in Manager.shouldCleanupMigration. The code was applying a filter to only return tablet metadata that contained a migration, then checking that the migration was not null. Because the filter was not being applied to the root tablet, it was being returned as matching the filter but with no migration.

Applying the fix in TabletsMetadata to run the filter on the root tablet metadata caused a subsequent issue in the GcWalsFilter where acceptTablet() would return null. Modified TabletMetadataFilter to protect against this condition.

Closes #5643

Filters on TabletMetadata were not being applied to the root tablet
metadata causing an exception in in Manager.shouldCleanupMigration.
The code was applying a filter to only return tablet metadata that
contained a migration, then checking that the migration was not
null. Because the filter was not being applied to the root tablet,
it was being returned as matching the filter but with no migration.

Applying the fix in TabletsMetadata to run the filter on the root
tablet metadata caused a subsequent issue in the GcWalsFilter where
acceptTablet() would return null. Modified TabletMetadataFilter
to protect against this condition.

Closes apache#5643
private TabletsMetadata buildRoot(AccumuloClient client) throws IOException {
final RootTabletMetadata rtm = getRootMetadata(client);
if (!tabletMetadataFilters.isEmpty()) {
final SortedMapIterator iter = new SortedMapIterator(rtm.toKeyValues());
Copy link
Contributor

Choose a reason for hiding this comment

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

probably need to use ColumnFamilySkippingIterator to skip column fams

for (DataLevel level : groupedExtents.keySet()) {
if (level == DataLevel.ROOT) {
iterables.add(() -> Iterators.singletonIterator(getRootMetadata((ClientContext) client)));
iterables.add(() -> Iterators
Copy link
Contributor

Choose a reason for hiding this comment

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

should this use the new buildroot function?

@dlmarion dlmarion merged commit 3edcfb9 into apache:main Jun 17, 2025
8 checks passed
@dlmarion dlmarion deleted the 5643-run-filters-on-root branch June 17, 2025 17:17
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.

Error checking if migration should be cleaned up

3 participants