Skip to content
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

added validate method into TabletMetadata #5340

Open
wants to merge 5 commits into
base: 3.1
Choose a base branch
from

Conversation

ArbaazKhan1
Copy link
Contributor

closes issue #5242

Created a Validate method inside Tablet Metadata to check overlap of files and tablet ranges.

@ctubbsii ctubbsii added this to the 3.1.0 milestone Mar 5, 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.

These changes seem good, it would be nice to add some unit test to TabletMetadataTest

@@ -558,6 +559,26 @@ private static Optional<TServerInstance> checkServer(ClientContext context, Stri
.map(address -> new TServerInstance(address, stat.getEphemeralOwner()));
}

public static void validate(TabletMetadata tm) {
if (!tm.fetchedCols.contains(ColumnType.FILES) || !tm.sawPrevEndRow) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If we fetched files, may not see any files for a tablet can avoid some work by checking if the set is empty. The sawPrevEndRow is more for error checking. If we fetched the PREV_ROW then its always expeced that it will be seen, so can check if it was fetched. Other code will throw an error if prev row was fetched and not seen.

Suggested change
if (!tm.fetchedCols.contains(ColumnType.FILES) || !tm.sawPrevEndRow) {
if (files.isEmpty() || !tm.fetchedCols.contains(ColumnType.PREV_ROW)) {

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.

4 participants