[Improvement] Ignore partial failure on initializing local storage in shuffle server side by zuston · Pull Request #102 · apache/uniffle · GitHub
Skip to content

[Improvement] Ignore partial failure on initializing local storage in shuffle server side#102

Merged
roryqi merged 4 commits into
apache:masterfrom
zuston:pr101
Jul 29, 2022
Merged

[Improvement] Ignore partial failure on initializing local storage in shuffle server side#102
roryqi merged 4 commits into
apache:masterfrom
zuston:pr101

Conversation

@zuston

@zuston zuston commented Jul 29, 2022

Copy link
Copy Markdown
Member

What changes were proposed in this pull request?

Ignore partial failure on initializing local storage in shuffle server side

Why are the changes needed?

When setting multiple storage paths, only one disk is insufficient capacity, shuffle server will directly throw exception. We hope it can be ignored, because bad disks are more common in production environments

Does this PR introduce any user-facing change?

No

How was this patch tested?

UT

@codecov-commenter

codecov-commenter commented Jul 29, 2022

Copy link
Copy Markdown

assertEquals(2, localStorageManager.getStorages().size());
}

public static class MockedLocalStorageBuilder extends LocalStorage.Builder {

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.

Could we use a path which don't exist instead of MockedLocalStorageBuilder? Such as we use a path named /xxx/yyy, but /xxx don't exist.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Got it.
But i can't understand why this mockBuilder is not appropriate.

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.

Got it. But i can't understand why this mockBuilder is not appropriate.

The Builder some fields and method become protected. I feel it's not necessary.

@zuston zuston Jul 29, 2022

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

If the public modifier is not appropriate, i could change to protected. And provide a method of getBasePath().
What do u think so?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Updated. Remove this class @jerqi

LOGGER.error("Initializing the storage path of {} failed.", storagePath, exception);
}
}
if (localStorages.size() <= 0) {

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.

Should we introduce a configOption that if the broken disks are more than the value, the start shuffle will fail to start.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Make sense.

zuston added 2 commits July 29, 2022 17:21
…ng multiple local storage paths in shuffle server client
}

localStorages = Arrays.asList(localStorageArray);
localStorages = Arrays.stream(localStorageArray).filter(Objects::nonNull).collect(Collectors.toList());

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fix the bug introduced by #72 .

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 #72, it's not a bug.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The localStorageArray maybe exist the null in some index, this will make the localStorages exist the null element when using the Arrays.asList(localStorageArray)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oh, my fault. Ignore this

}

localStorages = Arrays.asList(localStorageArray);
localStorages = Arrays.stream(localStorageArray).filter(Objects::nonNull).collect(Collectors.toList());

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 #72, it's not a bug.

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.

Could you add a new line? Because there are a warning if we don't have a newline at the end of the file

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done.

@roryqi roryqi left a comment

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.

LGTM

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.

3 participants