-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-48631][CORE][TEST] Fix test "error during accessing host local dirs for executors" #46989
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
Conversation
|
@attilapiros, could you take a look at this? |
| configureMockTransfer(Map()) | ||
| val iterator = createShuffleBlockIteratorWithDefaults( | ||
| Map(hostLocalBmId -> toBlockList(hostLocalBlocks.keys, 1L, 1)) | ||
| Map(blockManager.blockManagerId -> toBlockList(hostLocalBlocks.keys, 1L, 1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wounldn't it be treated as local blocks rather than host-local blocks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's correct. Thanks for catching!
It seems that for the original code, blockManager.hostLocalDirManager was not mocked correctly and it returns None. I'm trying to figure out how to mock it correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed the test properly... Do you mind taking a look again?
| val iterator = createShuffleBlockIteratorWithDefaults( | ||
| Map(hostLocalBmId -> toBlockList(hostLocalBlocks.keys, 1L, 1)) | ||
| Map(hostLocalBmId -> toBlockList(hostLocalBlocks.keys, 1L, 1)), | ||
| blockManager = Some(blockManager) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blockManager is actually the default value of createShuffleBlockIteratorWithDefaults(). So it looks like there is no actual difference made by this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do change the return of blockManager.hostLocalDirManager to Some(hostLocalDirManager), so that the blocks are treated as host-local.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. That makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified locally that the correct code path was reached in partitionBlocksByFetchMode. I can add an additional check to verify that mockExternalBlockStoreClient.getHostLocalDirs was called in the test.
attilapiros
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Thanks, merged to master! |
What changes were proposed in this pull request?
This change fixes test "error during accessing host local dirs for executors" in ShuffleBlockFetcherIteratorSuite, by setting up
blocksByAddresscorrectly for theShuffleBlockFetcherIteratorused in the test.Why are the changes needed?
The test is for host local blocks, but the
BlockManagerIdwas not set up correctly, soShuffleBlockFetcherIteratorwould treat those blocks as remote blocks instead.This change is to make the test valid to prevent further breaking changes.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Added an additional check in the test. Also tested locally and verified that the correct code path was reached.
Was this patch authored or co-authored using generative AI tooling?
No.