Fix Cannot mark an unqueryable datasource's segments used / unused#16127
Merged
abhishekrb19 merged 4 commits intoapache:masterfrom Mar 15, 2024
Merged
Fix Cannot mark an unqueryable datasource's segments used / unused#16127abhishekrb19 merged 4 commits intoapache:masterfrom
abhishekrb19 merged 4 commits intoapache:masterfrom
Conversation
Contributor
|
Good catch 👍 It's also probably worth mentioning in the PR description that this bug exists only when users are marking segments as used by interval or by segment ids for a datasource that contains no used segments. In other words, users can still recover a datasource by marking all segments as used, via |
abhishekrb19
added a commit
to abhishekrb19/incubator-druid
that referenced
this pull request
Mar 15, 2024
abhishekrb19
approved these changes
Mar 15, 2024
| Assert.assertEquals(ImmutableMap.of("numChangedSegments", 0), response.getEntity()); | ||
| EasyMock.verify(segmentsMetadataManager); | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
Is there a similar test for markAsUnused API where there are no used segments or only used segments in the deep storage, and the operation still proceeds now that we have removed the short circuit? If not, I can add a test in this patch #16136
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #16125
Description
This fixes an issue in which a datasource that does not have any segments loaded on historicals, cannot have its segments mark used or unused. Such a datasource may arise because all of it's segments were previously marked as unused, or if all of its segments are cold. This bug effectively did not allow a user to recover or hard-delete a datasource in this state unless they used the apis to mark ALL segments used / unused.
The issue was that there was a check that short circuits the work to mark segments used / unused if it thinks that the datasource does not exist; this check was equated to whether the datasource had any segments presently loaded on any historicals. The issue was fixed by removing this short circuit check.
Release note
Fixed bug that dissallowed marking segment by id / specific interval as used or unused if the datasource doest not have any segments loaded on historicals.
Key changed/added classes in this PR
This PR has: