sfwang218 opened a new pull request, #152:
URL: https://github.com/apache/incubator-uniffle/pull/152
<!--
Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines:
https://github.com/Tencent/Firestorm/blob/master/CONTRIBUTING.md
2. Ensure you have added or run the appropriate tests for your PR
3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP]XXXX
Your PR title ...'.
4. Be sure to keep the PR description updated to reflect all changes.
5. Please write your PR title to summarize what this PR proposes.
6. If possible, provide a concise example to reproduce the issue for a
faster review.
-->
### What changes were proposed in this pull request?
Modify the interface ShuffleWriteHandler
- change the method "write", add a param "valid" which check whether the
shuffleBlocks is valid
### Why are the changes needed?
There is a bug when multi thread which use the same ShuffleWriteHandler
flush event to storage concurrently.
for example:
- there are two event with the same appId、shuffleId and partitionId in
ShuffleFlushManager.flushQueue
- because the same appId、shuffleId and partitionId, two event will get the
same ShuffleWriteHandler in method ShuffleFlushManager.flushToFile

- as shown below, both them check is valid in the method
ShuffleFlushManager.flushToFile

- suppose the writeHandler is instance of HdfsShuffleWriteHandler, when the
first event execute method write the second event will be block

- the first event is executing write method while the app is expire, so the
hdfs path will be deleted
- then the second event will execute write method. Normally the
shuffleBlocks of the second event will be Marked as invalid, but we don't check
in this method, so the hdfs path will be recreated, and the second event will
still flush to hdfs
to fix this bug, we should double chech the valid of the event, so I add add
a param "valid" which check whether the shuffleBlocks is valid in method
ShuffleWriteHandler.write.
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
No need
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]