Skip to content

TEZ-4061: InputAttemptIdentifier and CompositeInputAttemptIdentifier cannot be compared for equality - #326

Merged
abstractdog merged 3 commits into
apache:masterfrom
ngsg:TEZ-4061
Dec 25, 2024
Merged

TEZ-4061: InputAttemptIdentifier and CompositeInputAttemptIdentifier cannot be compared for equality#326
abstractdog merged 3 commits into
apache:masterfrom
ngsg:TEZ-4061

Conversation

@ngsg

@ngsgngsg commented Jan 19, 2024

Copy link
Copy Markdown
Contributor

@tez-yetus

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec23m 45sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+1 💚@author0m 0sThe patch does not contain any @author tags.
-1 ❌test4tests0m 0sThe patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ master Compile Tests _
+1 💚mvninstall17m 43smaster passed
+1 💚compile0m 36smaster passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu122.04
+1 💚compile0m 31smaster passed with JDK Private Build-1.8.0_392-8u392-ga-1~22.04-b08
+1 💚checkstyle1m 23smaster passed
+1 💚javadoc0m 44smaster passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu122.04
+1 💚javadoc0m 28smaster passed with JDK Private Build-1.8.0_392-8u392-ga-1~22.04-b08
+0 🆗spotbugs1m 36sUsed deprecated FindBugs config; considering switching to SpotBugs.
+1 💚findbugs1m 33smaster passed
_ Patch Compile Tests _
+1 💚mvninstall0m 23sthe patch passed
+1 💚compile0m 24sthe patch passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu122.04
+1 💚javac0m 24sthe patch passed
+1 💚compile0m 21sthe patch passed with JDK Private Build-1.8.0_392-8u392-ga-1~22.04-b08
+1 💚javac0m 21sthe patch passed
-0 ⚠️checkstyle0m 17stez-runtime-library: The patch generated 1 new + 76 unchanged - 0 fixed = 77 total (was 76)
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚javadoc0m 19sthe patch passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu122.04
+1 💚javadoc0m 17sthe patch passed with JDK Private Build-1.8.0_392-8u392-ga-1~22.04-b08
+1 💚findbugs0m 58sthe patch passed
_ Other Tests _
+1 💚unit5m 48stez-runtime-library in the patch passed.
+1 💚asflicense0m 17sThe patch does not generate ASF License warnings.
56m 51s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-326/1/artifact/out/Dockerfile
GITHUB PR#326
JIRA IssueTEZ-4061
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs checkstyle compile
unameLinux c68899f0f9ca 5.15.0-88-generic #98-Ubuntu SMP Mon Oct 2 15:18:56 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitypersonality/tez.sh
git revisionmaster / 2161124
Default JavaPrivate Build-1.8.0_392-8u392-ga-1~22.04-b08
Multi-JDK versions/usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu122.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_392-8u392-ga-1~22.04-b08
checkstylehttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-326/1/artifact/out/diff-checkstyle-tez-runtime-library.txt
Test Resultshttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-326/1/testReport/
Max. process+thread count1100 (vs. ulimit of 5500)
modulesC: tez-runtime-library U: tez-runtime-library
Console outputhttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-326/1/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.

@BsoBird

Copy link
Copy Markdown

@abstractdog
hello. can we check & merge this? Tks.


private void processInputFailedEvent(InputFailedEvent ife) {
InputAttemptIdentifier srcAttemptIdentifier = new InputAttemptIdentifier(ife.getTargetIndex(), ife.getVersion());
LOG.info("Marking obsolete input: " + inputContext.getSourceVertexName() + " " + srcAttemptIdentifier);

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.

please use {} formatting

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

return new InputAttemptIdentifier(getInputIdentifier() + inputIdentifierOffset, getAttemptNumber(), getPathComponent(), isShared(), getFetchTypeInfo(), getSpillEventId());
}

public boolean include(int thatInputIdentifier, int thatAttemptNumber) {

@abstractdogabstractdogDec 21, 2024

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.

few notes:

  1. nit: this is more like "includes" because the method answers a question like whether this composite identifier includes another one, rather than taking and action

  2. this method would be simpler with a single param:

includes(InputAttempIdentifier inputAttemptIdentifier)
  1. can you please add a method javadoc about what "includes" exactly means in this context

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.

I agree that includes is more appropriate for the method. I modified the signature of the method as well as its name, and attached a javadoc on top of it.


public boolean include(int thatInputIdentifier, int thatAttemptNumber) {
return
super.getInputIdentifier() <= thatInputIdentifier && thatInputIdentifier < (super.getInputIdentifier() + inputIdentifierCount) &&

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.

can you reuse e.g. guava's Range for better readability?
https://www.geeksforgeeks.org/range-class-guava-java/

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.

Sure, we can. Modified to use guava's Range.

}
// Avoid adding attempts which have been marked as OBSOLETE
if (isObsoleteInputAttemptIdentifier(input)) {
LOG.info("Skipping obsolete input: " + input);

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.

the original behavior didn't log when we skip an obsolete input, is this an intentional change?

I can see that we still don't log anything in ShuffleScheduler when the same happens, so this is more like a LOG.debug, or back to

if (alreadyCompleted || isObsoleteInputAttemptIdentifier(input)) {

which one do you prefer?

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.

I think it would be better to synchronize the behaviour of ShuffleManager and ShuffleScheduler. Modified to use a single if clause.

@abstractdog

Copy link
Copy Markdown
Contributor

thanks a lot for this patch @ngsg, sorry that we forgot about that
I left some comments, it looks good overall

@ngsg

ngsg commented Dec 23, 2024

Copy link
Copy Markdown
ContributorAuthor

@abstractdog , Thank you for your review. I’ve updated the patch to address your comments. Could you please review the changes? Thank you.

@tez-yetus

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec32m 24sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 1sNo case conflicting files found.
+1 💚@author0m 0sThe patch does not contain any @author tags.
-1 ❌test4tests0m 0sThe patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ master Compile Tests _
+1 💚mvninstall9m 1smaster passed
+1 💚compile0m 38smaster passed with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu122.04
+1 💚compile0m 38smaster passed with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu222.04-ga
+1 💚checkstyle1m 0smaster passed
+1 💚javadoc0m 41smaster passed with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu122.04
+1 💚javadoc0m 30smaster passed with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu222.04-ga
+0 🆗spotbugs1m 14sUsed deprecated FindBugs config; considering switching to SpotBugs.
+1 💚findbugs1m 12smaster passed
_ Patch Compile Tests _
+1 💚mvninstall0m 24sthe patch passed
+1 💚compile0m 25sthe patch passed with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu122.04
+1 💚javac0m 25sthe patch passed
+1 💚compile0m 21sthe patch passed with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu222.04-ga
+1 💚javac0m 21sthe patch passed
+1 💚checkstyle0m 19sthe patch passed
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚javadoc0m 21sthe patch passed with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu122.04
+1 💚javadoc0m 18sthe patch passed with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu222.04-ga
+1 💚findbugs1m 1sthe patch passed
_ Other Tests _
+1 💚unit6m 9stez-runtime-library in the patch passed.
+1 💚asflicense0m 10sThe patch does not generate ASF License warnings.
56m 44s
SubsystemReport/Notes
DockerClientAPI=1.47 ServerAPI=1.47 base: https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-326/2/artifact/out/Dockerfile
GITHUB PR#326
JIRA IssueTEZ-4061
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs checkstyle compile
unameLinux 3359de30970d 5.15.0-124-generic #134-Ubuntu SMP Fri Sep 27 20:20:17 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitypersonality/tez.sh
git revisionmaster / b95defc
Default JavaPrivate Build-1.8.0_432-8u432-gaus1-0ubuntu222.04-ga
Multi-JDK versions/usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu122.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_432-8u432-gaus1-0ubuntu222.04-ga
Test Resultshttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-326/2/testReport/
Max. process+thread count2100 (vs. ulimit of 5500)
modulesC: tez-runtime-library U: tez-runtime-library
Console outputhttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-326/2/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 commented Dec 23, 2024

Copy link
Copy Markdown
Contributor

thanks @ngsg for addressing the comments! I believe this is quite close to be merged
can you please add a simple unit test for the includes method that validates the range including open/closed end? I think it can go to:
https://github.com/apache/tez/blob/master/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/TestInputIdentifiers.java

@ngsg

ngsg commented Dec 25, 2024

Copy link
Copy Markdown
ContributorAuthor

@abstractdog , I've added a unit test that checks the boundary of the range inside CompositeInputAttemptIdentifier#includes. The test shows that [1, 1+2) includes only 1 and 2 from the set {0, 1, 2, 3}. Could you review the added test? Thank you.

@tez-yetus

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 40sDocker 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 44smaster passed
+1 💚compile0m 36smaster passed with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu122.04
+1 💚compile0m 33smaster passed with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu222.04-ga
+1 💚checkstyle1m 29smaster passed
+1 💚javadoc0m 44smaster passed with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu122.04
+1 💚javadoc0m 29smaster passed with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu222.04-ga
+0 🆗spotbugs1m 31sUsed deprecated FindBugs config; considering switching to SpotBugs.
+1 💚findbugs1m 29smaster passed
_ Patch Compile Tests _
+1 💚mvninstall0m 22sthe patch passed
+1 💚compile0m 21sthe patch passed with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu122.04
+1 💚javac0m 21sthe patch passed
+1 💚compile0m 20sthe patch passed with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu222.04-ga
+1 💚javac0m 20sthe patch passed
+1 💚checkstyle0m 16sthe patch passed
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚javadoc0m 17sthe patch passed with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu122.04
+1 💚javadoc0m 17sthe patch passed with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu222.04-ga
+1 💚findbugs0m 56sthe patch passed
_ Other Tests _
+1 💚unit5m 54stez-runtime-library in the patch passed.
+1 💚asflicense0m 17sThe patch does not generate ASF License warnings.
31m 49s
SubsystemReport/Notes
DockerClientAPI=1.47 ServerAPI=1.47 base: https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-326/3/artifact/out/Dockerfile
GITHUB PR#326
JIRA IssueTEZ-4061
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs checkstyle compile
unameLinux 08a9a8dfa872 5.15.0-124-generic #134-Ubuntu SMP Fri Sep 27 20:20:17 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitypersonality/tez.sh
git revisionmaster / d39603c
Default JavaPrivate Build-1.8.0_432-8u432-gaus1-0ubuntu222.04-ga
Multi-JDK versions/usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu122.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_432-8u432-gaus1-0ubuntu222.04-ga
Test Resultshttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-326/3/testReport/
Max. process+thread count2100 (vs. ulimit of 5500)
modulesC: tez-runtime-library U: tez-runtime-library
Console outputhttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-326/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.

@abstractdog
abstractdog self-requested a review December 25, 2024 08:43
@abstractdog
abstractdog merged commit c77d37e into apache:masterDec 25, 2024
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

@ngsg@tez-yetus@BsoBird@abstractdog