Fix multithread writing for fragment result cache#16546
Fix multithread writing for fragment result cache#16546shixuan-fan merged 1 commit intoprestodb:masterfrom
Conversation
4df400f to
3dbb9c0
Compare
|
@shixuan-fan @kaikalur @highker @ajaygeorge @tdcmeehan |
|
@shixuan-fan can you help me merge the code |
shixuan-fan
left a comment
There was a problem hiding this comment.
Thanks for fixing this. Overall looks good just some nits.
presto-main/src/main/java/com/facebook/presto/operator/FileFragmentResultCacheManager.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Curious: Does it make sense that instead of creating PagesSerde every time, we create only once in the constructor, and directly replace current pagesSerde
There was a problem hiding this comment.
Alternatively, you could use something similar to the changes I made in Trino trinodb/trino#5545 which (mostly) puts the not thread safe buffers into a context object that can be created / released. I say "mostly" here because I didn't move the Compressor instance in which you would need to do in order to use it that way.
Another thing worth pointing out is that this implementation, as written, doesn't support encryption of the serialized pages.
There was a problem hiding this comment.
@shixuan-fan i have delete the write compress buffer and relation code.I find it not work.Can you help me approve
@pettyjamesm thanks for you advice .
There was a problem hiding this comment.
@shixuan-fan i have delete the write compress buffer and relation code.I find it not work.Can you help me approve
I'm trying to understand this. Do you mean you tried @pettyjamesm 's suggestion but it does not work?
8807909 to
c31a85c
Compare
There was a problem hiding this comment.
You don’t want to catch Throwable here- since “should be fatal” members of the Error subheirarchy like OutOfMemoryError are not what you want to catch here. Seems like catching Exception would be sufficient instead.
There was a problem hiding this comment.
Yes,I lack consideration.I hava fixed
There was a problem hiding this comment.
Should we consider only extending it to RuntimeException? I don't think we should cover checked exception here.
Also, does it make sense to catch this separately from IOException and UncheckedIOException? There are legit reasons for them to happen, but maybe not for other exceptions?
c31a85c to
1b51083
Compare
There was a problem hiding this comment.
Should we consider only extending it to RuntimeException? I don't think we should cover checked exception here.
Also, does it make sense to catch this separately from IOException and UncheckedIOException? There are legit reasons for them to happen, but maybe not for other exceptions?
presto-main/src/main/java/com/facebook/presto/operator/FileFragmentResultCacheManager.java
Outdated
Show resolved
Hide resolved
|
Also, it might be great to add a test in |
936a293 to
2bf3c72
Compare
shixuan-fan
left a comment
There was a problem hiding this comment.
Some nits on test. Mostly look good!
presto-main/src/main/java/com/facebook/presto/operator/FileFragmentResultCacheManager.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
nit: threadCount. We don't use abbreviation in presto :)
There was a problem hiding this comment.
i hava add comment
and delete threadCnt
There was a problem hiding this comment.
Let's remove this? It's useful for debugging but not useful as a unit test.
There was a problem hiding this comment.
sorry ,i hava deleted
There was a problem hiding this comment.
How about just returning true and false?
There was a problem hiding this comment.
How about just checking if every future returns "success" (or true if applying previous comment). It might look neater :)
There was a problem hiding this comment.
Let's not move this method?
There was a problem hiding this comment.
Let's create this as a local variable in the test method?
There was a problem hiding this comment.
This is purely nit, but maybe for (int i = 0; i < 10; i++) would be clearer? This way we don't need to declare i and threadCnt outside of the loop.
There was a problem hiding this comment.
Curious: is %s,%s enough?
There was a problem hiding this comment.
i name it test write content,thread %s,%s,that i think it more clear
2bf3c72 to
a1ab2db
Compare
|
thank you for reviewing my code.I am the first time to commit code ,which wasting your time. |
a1ab2db to
5c0f19f
Compare
shixuan-fan
left a comment
There was a problem hiding this comment.
LGTM.
No need to apologize, you are the one doing the hard work and helping fixing stuff. We really appreciate that :)
There was a problem hiding this comment.
Maybe revert the changes here and for SPLIT_2 if they are unintended.
|
Also, I'm wondering if we should change the commit and PR title to: "Fix multithread writing for fragment result cache" |
5c0f19f to
5176668
Compare
ok ,i have changed |
|
Merged. Thanks for the help identifying/fixing bugs :) |
Uh oh!
There was an error while loading. Please reload this page.