Skip to content

TEZ-4540: Reading proto data more than 2GB from multiple splits fails - #334

Merged
abstractdog merged 3 commits into
apache:masterfrom
Aggarwal-Raghav:proto
Jun 20, 2024
Merged

TEZ-4540: Reading proto data more than 2GB from multiple splits fails#334
abstractdog merged 3 commits into
apache:masterfrom
Aggarwal-Raghav:proto

Conversation

@Aggarwal-Raghav

Copy link
Copy Markdown
Contributor

Refer to this: HIVE-28026 and apache/hive#5033

@tez-yetus

This comment was marked as outdated.

Comment on lines +99 to +101
if (din.in != in) {
cin.resetSizeCounter();
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

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.

@tez-yetus

This comment was marked as outdated.

@zabetakzabetak left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
ContributorAuthor

@abstractdog@harishjp. Can you please help get this in tez 0.10.3

@abstractdog

Copy link
Copy Markdown
Contributor

@abstractdog@harishjp. Can you please help get this in tez 0.10.3

thanks @Aggarwal-Raghav for the patch, let me check soon
I'm really sorry but tez 0.10.3 rc1 is currently being released, so we cannot add this

@abstractdog

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
ContributorAuthor

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?

Have added a basic UT for checking cin.resetSizeCounter() is called.

@tez-yetus

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec14m 22sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+1 💚@author0m 0sThe patch does not contain any @author tags.
+1 💚test4tests0m 0sThe patch appears to include 1 new or modified test files.
_ master Compile Tests _
+1 💚mvninstall15m 10smaster passed
+1 💚compile0m 20smaster passed with JDK Ubuntu-11.0.22+7-post-Ubuntu-0ubuntu222.04.1
+1 💚compile0m 20smaster passed with JDK Private Build-1.8.0_402-8u402-ga-2ubuntu1~22.04-b06
+1 💚checkstyle1m 8smaster passed
+1 💚javadoc0m 30smaster passed with JDK Ubuntu-11.0.22+7-post-Ubuntu-0ubuntu222.04.1
+1 💚javadoc0m 15smaster passed with JDK Private Build-1.8.0_402-8u402-ga-2ubuntu1~22.04-b06
+0 🆗spotbugs1m 4sUsed deprecated FindBugs config; considering switching to SpotBugs.
+1 💚findbugs1m 2smaster passed
_ Patch Compile Tests _
+1 💚mvninstall0m 11sthe patch passed
+1 💚compile0m 12sthe patch passed with JDK Ubuntu-11.0.22+7-post-Ubuntu-0ubuntu222.04.1
+1 💚javac0m 12sthe patch passed
+1 💚compile0m 10sthe patch passed with JDK Private Build-1.8.0_402-8u402-ga-2ubuntu1~22.04-b06
+1 💚javac0m 10sthe patch passed
-0 ⚠️checkstyle0m 5stez-plugins/tez-protobuf-history-plugin: The patch generated 1 new + 7 unchanged - 0 fixed = 8 total (was 7)
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚javadoc0m 7sthe patch passed with JDK Ubuntu-11.0.22+7-post-Ubuntu-0ubuntu222.04.1
+1 💚javadoc0m 7sthe patch passed with JDK Private Build-1.8.0_402-8u402-ga-2ubuntu1~22.04-b06
+1 💚findbugs0m 27sthe patch passed
_ Other Tests _
+1 💚unit0m 27stez-protobuf-history-plugin in the patch passed.
+1 💚asflicense0m 14sThe patch does not generate ASF License warnings.
35m 49s
SubsystemReport/Notes
DockerClientAPI=1.45 ServerAPI=1.45 base: https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-334/3/artifact/out/Dockerfile
GITHUB PR#334
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs checkstyle compile
unameLinux 012dcf99c519 5.15.0-94-generic #104-Ubuntu SMP Tue Jan 9 15:25:40 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitypersonality/tez.sh
git revisionmaster / b5b6226
Default JavaPrivate Build-1.8.0_402-8u402-ga-2ubuntu1~22.04-b06
Multi-JDK versions/usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.22+7-post-Ubuntu-0ubuntu222.04.1 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_402-8u402-ga-2ubuntu1~22.04-b06
checkstylehttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-334/3/artifact/out/diff-checkstyle-tez-plugins_tez-protobuf-history-plugin.txt
Test Resultshttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-334/3/testReport/
Max. process+thread count107 (vs. ulimit of 5500)
modulesC: tez-plugins/tez-protobuf-history-plugin U: tez-plugins/tez-protobuf-history-plugin
Console outputhttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-334/3/console
versionsgit=2.34.1 maven=3.6.3 findbugs=3.0.1
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Aggarwal-Raghav

Copy link
Copy Markdown
ContributorAuthor

@abstractdog, can you please help with the review.

@abstractdog

abstractdog commented Jun 20, 2024

Copy link
Copy Markdown
Contributor

@Aggarwal-Raghav : can you fix this minor checkstyle warning?
https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-334/3/artifact/out/diff-checkstyle-tez-plugins_tez-protobuf-history-plugin.txt

  • 1 more minor comment

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();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

you can return without declaring a new variable

return cin.getTotalBytesRead();

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

fixed

@tez-yetus

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 13sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+1 💚@author0m 0sThe patch does not contain any @author tags.
+1 💚test4tests0m 0sThe patch appears to include 1 new or modified test files.
_ master Compile Tests _
+1 💚mvninstall19m 27smaster passed
+1 💚compile0m 31smaster passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu122.04.1
+1 💚compile0m 31smaster passed with JDK Private Build-1.8.0_412-8u412-ga-1~22.04.1-b08
+1 💚checkstyle1m 27smaster passed
+1 💚javadoc0m 41smaster passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu122.04.1
+1 💚javadoc0m 24smaster passed with JDK Private Build-1.8.0_412-8u412-ga-1~22.04.1-b08
+0 🆗spotbugs1m 29sUsed deprecated FindBugs config; considering switching to SpotBugs.
+1 💚findbugs1m 27smaster passed
_ Patch Compile Tests _
+1 💚mvninstall0m 17sthe patch passed
+1 💚compile0m 17sthe patch passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu122.04.1
+1 💚javac0m 17sthe patch passed
+1 💚compile0m 17sthe patch passed with JDK Private Build-1.8.0_412-8u412-ga-1~22.04.1-b08
+1 💚javac0m 17sthe patch passed
+1 💚checkstyle0m 8sthe patch passed
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚javadoc0m 9sthe patch passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu122.04.1
+1 💚javadoc0m 9sthe patch passed with JDK Private Build-1.8.0_412-8u412-ga-1~22.04.1-b08
+1 💚findbugs0m 38sthe patch passed
_ Other Tests _
+1 💚unit0m 34stez-protobuf-history-plugin in the patch passed.
+1 💚asflicense0m 17sThe patch does not generate ASF License warnings.
28m 31s
SubsystemReport/Notes
DockerClientAPI=1.45 ServerAPI=1.45 base: https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-334/4/artifact/out/Dockerfile
GITHUB PR#334
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs checkstyle compile
unameLinux c5902e3a71a8 5.15.0-106-generic #116-Ubuntu SMP Wed Apr 17 09:17:56 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitypersonality/tez.sh
git revisionmaster / e08d027
Default JavaPrivate Build-1.8.0_412-8u412-ga-1~22.04.1-b08
Multi-JDK versions/usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu122.04.1 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_412-8u412-ga-1~22.04.1-b08
Test Resultshttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-334/4/testReport/
Max. process+thread count102 (vs. ulimit of 5500)
modulesC: tez-plugins/tez-protobuf-history-plugin U: tez-plugins/tez-protobuf-history-plugin
Console outputhttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-334/4/console
versionsgit=2.34.1 maven=3.6.3 findbugs=3.0.1
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@abstractdog
abstractdog self-requested a review June 20, 2024 14:25
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@Aggarwal-Raghav@tez-yetus@abstractdog@zabetak