You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@uniffle.apache.org by GitBox <gi...@apache.org> on 2022/08/09 14:00:03 UTC

[GitHub] [incubator-uniffle] sfwang218 opened a new pull request, #152: [BUGFIX] Fix flush event bug which cause app resource delete not clean

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
   ![图片](https://user-images.githubusercontent.com/16055211/183663082-3bf4bd63-5e8f-44b7-a171-353730a6cdc0.png)
   - as shown below, both them check is valid in the method ShuffleFlushManager.flushToFile
   ![图片](https://user-images.githubusercontent.com/16055211/183661104-bdcc70da-ac1d-4c2b-b6dc-1ab2ffc3f7fe.png)
   - suppose the writeHandler is instance of HdfsShuffleWriteHandler, when the first event execute method write the second event will be block
   ![图片](https://user-images.githubusercontent.com/16055211/183665166-a3b4ac41-1c72-4932-9760-92166635c700.png)
   - 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: issues-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] sfwang218 commented on pull request #152: [BUGFIX] Fix flush event bug which cause app resource delete not clean

Posted by GitBox <gi...@apache.org>.
sfwang218 commented on PR #152:
URL: https://github.com/apache/incubator-uniffle/pull/152#issuecomment-1211522357

   > If we remove the app, the progress run at the line
   > 
   > https://github.com/apache/incubator-uniffle/blob/d5cb8ccf47fec2e90ed24d97e4fd687d07f0bcd4/storage/src/main/java/org/apache/uniffle/storage/handler/impl/LocalFileWriteHandler.java#L100
   > , we won't delete the shuffle file totally.
   
   Yes, It seems that this situation exists, do you have any suggestions?


-- 
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: issues-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] sfwang218 commented on pull request #152: [BUGFIX] Fix flush event bug which cause app resource delete not clean

Posted by GitBox <gi...@apache.org>.
sfwang218 commented on PR #152:
URL: https://github.com/apache/incubator-uniffle/pull/152#issuecomment-1210065492

   > Em....if we remove the app after we judge whether the event is valid, some app resource still won't be deleted. I feel that this pr don't solve the problems totally.
   
   In this case, there two situations: 
   
   1. We judge the event is valid and the 'write' method is finished, and then we remove the app. In this way, the app resource will be deleted cleanly
   2. We judge the event is valid and the 'write' method is not finished, and then we remove the app. In this way, the 'write' method will throw exception, and will retry later as shown below
   ![图片](https://user-images.githubusercontent.com/16055211/183793266-dd532937-31b1-4da5-a450-00a95de58326.png)
   when the event retry, we will judge whether it is valid again as shown below
   ![图片](https://user-images.githubusercontent.com/16055211/183793671-312d24e5-caae-46e7-a2d5-de31741f1d5a.png)
   
   In summary, i think this pr can solve the problems totally, I don't know if I'm right, Please correct.


-- 
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: issues-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] sfwang218 commented on pull request #152: [BUGFIX] Fix flush event bug which cause app resource delete not clean

Posted by GitBox <gi...@apache.org>.
sfwang218 commented on PR #152:
URL: https://github.com/apache/incubator-uniffle/pull/152#issuecomment-1211875743

   
   
   
   
   > @sfwang218 For such problem, how about to check `basePath` before write, it was created when init handler and will be removed if app expired. I think it still will have the problem you mentioned caused by multi threads in some cases, but it's better to make the writer handler more independent. I prefer to add easy way for handler to check if the data should be written.
   
   OK, It seems like a good idea, thx.


-- 
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: issues-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] sfwang218 commented on pull request #152: [BUGFIX] Fix flush event bug which cause app resource delete not clean

Posted by GitBox <gi...@apache.org>.
sfwang218 commented on PR #152:
URL: https://github.com/apache/incubator-uniffle/pull/152#issuecomment-1293448484

   > @sfwang218 Do you want to continue this pr? I raise a new issue #282 according to the problem which this pr mentioned. If you want to continue this pr, I will assign this issue to you.
   
   OK, I want try


-- 
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: issues-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] sfwang218 commented on pull request #152: [BUGFIX] Fix flush event bug which cause app resource delete not clean

Posted by GitBox <gi...@apache.org>.
sfwang218 commented on PR #152:
URL: https://github.com/apache/incubator-uniffle/pull/152#issuecomment-1293446872

   > 
   
   Okey, 
   
   > @sfwang218 Do you want to continue this pr? I raise a new issue #282 according to the problem which this pr mentioned. If you want to continue this pr, I will assign this issue to you.
   
   OK, I wang try


-- 
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: issues-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] jerqi commented on pull request #152: [BUGFIX] Fix flush event bug which cause app resource delete not clean

Posted by GitBox <gi...@apache.org>.
jerqi commented on PR #152:
URL: https://github.com/apache/incubator-uniffle/pull/152#issuecomment-1210748788

   If we remove the app, the progress run at the line https://github.com/apache/incubator-uniffle/blob/d5cb8ccf47fec2e90ed24d97e4fd687d07f0bcd4/storage/src/main/java/org/apache/uniffle/storage/handler/impl/LocalFileWriteHandler.java#L100, we won't delete the shuffle file totally.


-- 
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: issues-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] jerqi commented on pull request #152: [BUGFIX] Fix flush event bug which cause app resource delete not clean

Posted by GitBox <gi...@apache.org>.
jerqi commented on PR #152:
URL: https://github.com/apache/incubator-uniffle/pull/152#issuecomment-1209520869

   Em....if we remove the app after we judge whether the event is valid, some app resource still won't be deleted.  I feel that this pr don't solve the problems totally.


-- 
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: issues-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] colinmjj commented on pull request #152: [BUGFIX] Fix flush event bug which cause app resource delete not clean

Posted by GitBox <gi...@apache.org>.
colinmjj commented on PR #152:
URL: https://github.com/apache/incubator-uniffle/pull/152#issuecomment-1211520881

   @sfwang218 For such problem, how about to check `basePath` before write, it was created when init handler and will be removed if app expired. I think it's still will have the problem you mentioned caused by multi threads, but it's better to make the writer handler more independent. I prefer to add easy way for handler to check if the data should be written.


-- 
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: issues-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] jerqi commented on pull request #152: [BUGFIX] Fix flush event bug which cause app resource delete not clean

Posted by GitBox <gi...@apache.org>.
jerqi commented on PR #152:
URL: https://github.com/apache/incubator-uniffle/pull/152#issuecomment-1293450497

   > > @sfwang218 Do you want to continue this pr? I raise a new issue #282 according to the problem which this pr mentioned. If you want to continue this pr, I will assign this issue to you.
   > 
   > OK, I want try
   
    You need to comment the issue https://github.com/apache/incubator-uniffle/issues/282, otherwise  I can't assign to you.


-- 
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: issues-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] jerqi commented on pull request #152: [BUGFIX] Fix flush event bug which cause app resource delete not clean

Posted by GitBox <gi...@apache.org>.
jerqi commented on PR #152:
URL: https://github.com/apache/incubator-uniffle/pull/152#issuecomment-1293116728

   @sfwang218 Do you want to continue this pr? I raise a new issue according to the problem which this pr mentioned. If you want to continue this pr, I will assign this issue to you.


-- 
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: issues-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] sfwang218 commented on pull request #152: [BUGFIX] Fix flush event bug which cause app resource delete not clean

Posted by GitBox <gi...@apache.org>.
sfwang218 commented on PR #152:
URL: https://github.com/apache/incubator-uniffle/pull/152#issuecomment-1293447508

   > @sfwang218 Do you want to continue this pr? I raise a new issue #282 according to the problem which this pr mentioned. If you want to continue this pr, I will assign this issue to you.
   
   OK, I wang try


-- 
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: issues-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] sfwang218 closed pull request #152: [BUGFIX] Fix flush event bug which cause app resource delete not clean

Posted by GitBox <gi...@apache.org>.
sfwang218 closed pull request #152: [BUGFIX] Fix flush event bug which cause app resource delete not clean
URL: https://github.com/apache/incubator-uniffle/pull/152


-- 
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: issues-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org