Uh oh!
There was an error while loading. Please reload this page.
TEZ-4540: Reading proto data more than 2GB from multiple splits fails - #334
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
| if (din.in != in) { | ||
| cin.resetSizeCounter(); | ||
| } |
There was a problem hiding this comment.
The javadoc of CodedInputStream#setSizeLimit says the following:
If you want to read several messages from a single CodedInputStream, you could call resetSizeCounter() after each one to avoid hitting the size limit.
Based on that I would be inclined to reset the counter after every single message otherwise it still seems feasible to hit the same error if the DataInput is sufficiently large.
There was a problem hiding this comment.
Thanks for the review @zabetak.
I missed this Java doc statement. I was suspecting that resetting the totalBytesRetired after every message read might have unexpected impact therefore, I resetted it after every hdfs split read. But based on the Javadoc, I think we can reset the counter after every mesage read. Will modify the patch.
Thanks.
This comment was marked as outdated.
This comment was marked as outdated.
zabetak
left a comment
There was a problem hiding this comment.
LGTM, thanks for pushing this forward @Aggarwal-Raghav ! My approval is not binding so you will have to ping a Tez committer to merge this.
Aggarwal-Raghav
commented
Feb 6, 2024
@abstractdog@harishjp. Can you please help get this in tez 0.10.3 |
abstractdog
commented
Feb 6, 2024
thanks @Aggarwal-Raghav for the patch, let me check soon |
abstractdog
commented
Apr 23, 2024
CodedInputStream.totalBytesRetired can be easily checked by CodedInputStream.getTotalBytesRead(), so can you include a unit test that reads at least twice with ProtoMessageWritable and validates that cin.resetSizeCounter() was indeed called? |
Aggarwal-Raghav
commented
Apr 25, 2024
Have added a basic UT for checking cin.resetSizeCounter() is called. |
tez-yetus
commented
Apr 25, 2024
🎊 +1 overall
This message was automatically generated. |
Aggarwal-Raghav
commented
May 22, 2024
@abstractdog, can you please help with the review. |
@Aggarwal-Raghav : can you fix this minor checkstyle warning?
other than that this LGTM |
| CodedInputStream cin = (CodedInputStream) c.get(writable); | ||
| // Goal is to get value of: reader.writable.cin.getTotalBytesRead() | ||
| int totalBytesRead = cin.getTotalBytesRead(); |
There was a problem hiding this comment.
you can return without declaring a new variable
return cin.getTotalBytesRead();
tez-yetus
commented
Jun 20, 2024
🎊 +1 overall
This message was automatically generated. |
Refer to this: HIVE-28026 and apache/hive#5033