Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Dec 25, 2024

Conversation

ngsg
Copy link
Contributor

@ngsg ngsg commented Jan 19, 2024

@tez-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 23m 45s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The 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 💚 mvninstall 17m 43s master passed
+1 💚 compile 0m 36s master passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu122.04
+1 💚 compile 0m 31s master passed with JDK Private Build-1.8.0_392-8u392-ga-1~22.04-b08
+1 💚 checkstyle 1m 23s master passed
+1 💚 javadoc 0m 44s master passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu122.04
+1 💚 javadoc 0m 28s master passed with JDK Private Build-1.8.0_392-8u392-ga-1~22.04-b08
+0 🆗 spotbugs 1m 36s Used deprecated FindBugs config; considering switching to SpotBugs.
+1 💚 findbugs 1m 33s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 0m 23s the patch passed
+1 💚 compile 0m 24s the patch passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu122.04
+1 💚 javac 0m 24s the patch passed
+1 💚 compile 0m 21s the patch passed with JDK Private Build-1.8.0_392-8u392-ga-1~22.04-b08
+1 💚 javac 0m 21s the patch passed
-0 ⚠️ checkstyle 0m 17s tez-runtime-library: The patch generated 1 new + 76 unchanged - 0 fixed = 77 total (was 76)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 javadoc 0m 19s the patch passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu122.04
+1 💚 javadoc 0m 17s the patch passed with JDK Private Build-1.8.0_392-8u392-ga-1~22.04-b08
+1 💚 findbugs 0m 58s the patch passed
_ Other Tests _
+1 💚 unit 5m 48s tez-runtime-library in the patch passed.
+1 💚 asflicense 0m 17s The patch does not generate ASF License warnings.
56m 51s
Subsystem Report/Notes
Docker ClientAPI=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 Issue TEZ-4061
Optional Tests dupname asflicense javac javadoc unit spotbugs findbugs checkstyle compile
uname Linux 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 tool maven
Personality personality/tez.sh
git revision master / 2161124
Default Java Private 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
checkstyle https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-326/1/artifact/out/diff-checkstyle-tez-runtime-library.txt
Test Results https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-326/1/testReport/
Max. process+thread count 1100 (vs. ulimit of 5500)
modules C: tez-runtime-library U: tez-runtime-library
Console output https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-326/1/console
versions git=2.34.1 maven=3.6.3 findbugs=3.0.1
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@BsoBird
Copy link

BsoBird commented Oct 24, 2024

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

@@ -282,6 +282,7 @@ private void processShufflePayload(DataMovementEventPayloadProto shufflePayload,

private void processInputFailedEvent(InputFailedEvent ife) {
InputAttemptIdentifier srcAttemptIdentifier = new InputAttemptIdentifier(ife.getTargetIndex(), ife.getVersion());
LOG.info("Marking obsolete input: " + inputContext.getSourceVertexName() + " " + srcAttemptIdentifier);
Copy link
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
Contributor Author

Choose a reason for hiding this comment

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

fixed

@@ -50,6 +50,12 @@ public InputAttemptIdentifier expand(int inputIdentifierOffset) {
return new InputAttemptIdentifier(getInputIdentifier() + inputIdentifierOffset, getAttemptNumber(), getPathComponent(), isShared(), getFetchTypeInfo(), getSpillEventId());
}

public boolean include(int thatInputIdentifier, int thatAttemptNumber) {
Copy link
Contributor

@abstractdog abstractdog Dec 21, 2024

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
Contributor Author

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.

@@ -50,6 +50,12 @@ public InputAttemptIdentifier expand(int inputIdentifierOffset) {
return new InputAttemptIdentifier(getInputIdentifier() + inputIdentifierOffset, getAttemptNumber(), getPathComponent(), isShared(), getFetchTypeInfo(), getSpillEventId());
}

public boolean include(int thatInputIdentifier, int thatAttemptNumber) {
return
super.getInputIdentifier() <= thatInputIdentifier && thatInputIdentifier < (super.getInputIdentifier() + inputIdentifierCount) &&
Copy link
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
Contributor Author

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
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
Contributor Author

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
Contributor

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

@ngsg
Copy link
Contributor Author

ngsg commented Dec 23, 2024

@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

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 32m 24s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 1s No case conflicting files found.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The 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 💚 mvninstall 9m 1s master passed
+1 💚 compile 0m 38s master passed with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu122.04
+1 💚 compile 0m 38s master passed with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu222.04-ga
+1 💚 checkstyle 1m 0s master passed
+1 💚 javadoc 0m 41s master passed with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu122.04
+1 💚 javadoc 0m 30s master passed with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu222.04-ga
+0 🆗 spotbugs 1m 14s Used deprecated FindBugs config; considering switching to SpotBugs.
+1 💚 findbugs 1m 12s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 0m 24s the patch passed
+1 💚 compile 0m 25s the patch passed with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu122.04
+1 💚 javac 0m 25s the patch passed
+1 💚 compile 0m 21s the patch passed with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu222.04-ga
+1 💚 javac 0m 21s the patch passed
+1 💚 checkstyle 0m 19s the patch passed
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 javadoc 0m 21s the patch passed with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu122.04
+1 💚 javadoc 0m 18s the patch passed with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu222.04-ga
+1 💚 findbugs 1m 1s the patch passed
_ Other Tests _
+1 💚 unit 6m 9s tez-runtime-library in the patch passed.
+1 💚 asflicense 0m 10s The patch does not generate ASF License warnings.
56m 44s
Subsystem Report/Notes
Docker ClientAPI=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 Issue TEZ-4061
Optional Tests dupname asflicense javac javadoc unit spotbugs findbugs checkstyle compile
uname Linux 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 tool maven
Personality personality/tez.sh
git revision master / b95defc
Default Java Private 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 Results https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-326/2/testReport/
Max. process+thread count 2100 (vs. ulimit of 5500)
modules C: tez-runtime-library U: tez-runtime-library
Console output https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-326/2/console
versions git=2.34.1 maven=3.6.3 findbugs=3.0.1
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@abstractdog
Copy link
Contributor

abstractdog commented Dec 23, 2024

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
Copy link
Contributor Author

ngsg commented Dec 25, 2024

@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

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 40s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ master Compile Tests _
+1 💚 mvninstall 15m 44s master passed
+1 💚 compile 0m 36s master passed with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu122.04
+1 💚 compile 0m 33s master passed with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu222.04-ga
+1 💚 checkstyle 1m 29s master passed
+1 💚 javadoc 0m 44s master passed with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu122.04
+1 💚 javadoc 0m 29s master passed with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu222.04-ga
+0 🆗 spotbugs 1m 31s Used deprecated FindBugs config; considering switching to SpotBugs.
+1 💚 findbugs 1m 29s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 0m 22s the patch passed
+1 💚 compile 0m 21s the patch passed with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu122.04
+1 💚 javac 0m 21s the patch passed
+1 💚 compile 0m 20s the patch passed with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu222.04-ga
+1 💚 javac 0m 20s the patch passed
+1 💚 checkstyle 0m 16s the patch passed
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 javadoc 0m 17s the patch passed with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu122.04
+1 💚 javadoc 0m 17s the patch passed with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu222.04-ga
+1 💚 findbugs 0m 56s the patch passed
_ Other Tests _
+1 💚 unit 5m 54s tez-runtime-library in the patch passed.
+1 💚 asflicense 0m 17s The patch does not generate ASF License warnings.
31m 49s
Subsystem Report/Notes
Docker ClientAPI=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 Issue TEZ-4061
Optional Tests dupname asflicense javac javadoc unit spotbugs findbugs checkstyle compile
uname Linux 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 tool maven
Personality personality/tez.sh
git revision master / d39603c
Default Java Private 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 Results https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-326/3/testReport/
Max. process+thread count 2100 (vs. ulimit of 5500)
modules C: tez-runtime-library U: tez-runtime-library
Console output https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-326/3/console
versions git=2.34.1 maven=3.6.3 findbugs=3.0.1
Powered by Apache 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:master Dec 25, 2024
4 checks passed
Sign up for free to 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