Skip to content

Conversation

@bozhang2820
Copy link
Contributor

@bozhang2820 bozhang2820 commented Jun 14, 2024

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 blocksByAddress correctly for the ShuffleBlockFetcherIterator used in the test.

Why are the changes needed?

The test is for host local blocks, but the BlockManagerId was not set up correctly, so ShuffleBlockFetcherIterator would 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.

@github-actions github-actions bot added the CORE label Jun 14, 2024
@bozhang2820
Copy link
Contributor Author

@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))
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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)
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Contributor

@attilapiros attilapiros left a comment

Choose a reason for hiding this comment

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

LGTM

@Ngone51 Ngone51 closed this in f077759 Jun 21, 2024
@Ngone51
Copy link
Member

Ngone51 commented Jun 21, 2024

Thanks, merged to master!

@bozhang2820 bozhang2820 deleted the spark-48631 branch June 21, 2024 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants