Skip to content

HDFS-17922 rename2 in the router asynchronous RPC is missing an async path#8500

Open
dParikesit wants to merge 1 commit into
apache:trunkfrom
dParikesit:5-RouterAsync-rename2
Open

HDFS-17922 rename2 in the router asynchronous RPC is missing an async path#8500
dParikesit wants to merge 1 commit into
apache:trunkfrom
dParikesit:5-RouterAsync-rename2

Conversation

@dParikesit
Copy link
Copy Markdown
Contributor

Description of PR

JIRA: HDFS-17922

In RouterAsyncClientProtocol:rename2, there is a path that returns synchronously if we have empty locations if (locs.isEmpty).

@Override
  public void rename2(
      final String src, final String dst,
      final Options.Rename... options) throws IOException {
    ...
    if (locs.isEmpty()) {
      rbfRename.routerFedRename(src, dst, srcLocations, dstLocations);
      // Missing async handling
      return;
    }
    ...
    asyncApply((AsyncApplyFunction<Boolean, Boolean>) isMultiDestDirectory -> {
      if (isMultiDestDirectory) {
        ...
        rpcClient.invokeConcurrent(locs, method);
      } else {
        rpcClient.invokeSequential(locs, method, null, null);
      }
    });
  }

There are other paths that behave similarly, such as msync()

@Override
  public void msync() throws IOException {
    rpcServer.checkOperation(NameNode.OperationCategory.READ, true);
    ...
    if (namespacesEligibleForObserverReads.isEmpty()) {
      asyncCompleteWith(CompletableFuture.completedFuture(null));
      return;
    }
    rpcClient.invokeConcurrent(namespacesEligibleForObserverReads, method);
  } 

We propose to add a patch to add asyncComplete(null); before the return.

How was this patch tested?

mvn -am -pl hadoop-hdfs-project/hadoop-hdfs-rbf -Dtest=TestRouterAsyncFederationRename test

@dParikesit
Copy link
Copy Markdown
Contributor Author

Hello @KeeProMise , would you be able to help review this PR? This is similar to the router async rpc problem in #8297. Thank you very much!

@hadoop-yetus
Copy link
Copy Markdown

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 22s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 2 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 26m 11s trunk passed
+1 💚 compile 0m 43s trunk passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 compile 0m 51s trunk passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 checkstyle 0m 38s trunk passed
+1 💚 mvnsite 0m 55s trunk passed
+1 💚 javadoc 0m 38s trunk passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javadoc 0m 42s trunk passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 spotbugs 1m 25s trunk passed
+1 💚 shadedclient 16m 21s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 33s the patch passed
+1 💚 compile 0m 24s the patch passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javac 0m 24s the patch passed
+1 💚 compile 0m 29s the patch passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 javac 0m 29s the patch passed
+1 💚 blanks 0m 1s The patch has no blanks issues.
+1 💚 checkstyle 0m 15s the patch passed
+1 💚 mvnsite 0m 36s the patch passed
+1 💚 javadoc 0m 20s the patch passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javadoc 0m 20s the patch passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 spotbugs 1m 10s the patch passed
+1 💚 shadedclient 16m 8s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 37m 28s hadoop-hdfs-rbf in the patch passed.
+1 💚 asflicense 0m 26s The patch does not generate ASF License warnings.
108m 5s
Subsystem Report/Notes
Docker ClientAPI=1.54 ServerAPI=1.54 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8500/1/artifact/out/Dockerfile
GITHUB PR #8500
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux abcd4210301e 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / a8427ee
Default Java Ubuntu-17.0.18+8-Ubuntu-124.04.1
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.10+7-Ubuntu-124.04 /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.18+8-Ubuntu-124.04.1
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8500/1/testReport/
Max. process+thread count 4338 (vs. ulimit of 10000)
modules C: hadoop-hdfs-project/hadoop-hdfs-rbf U: hadoop-hdfs-project/hadoop-hdfs-rbf
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8500/1/console
versions git=2.43.0 maven=3.9.15 spotbugs=4.9.7
Powered by Apache Yetus 0.14.1 https://yetus.apache.org

This message was automatically generated.

Copy link
Copy Markdown
Member

@KeeProMise KeeProMise left a comment

Choose a reason for hiding this comment

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

LGTM. @hfutatzhanghb if you have time, please help to take a look at this PR, thanks!

Copy link
Copy Markdown
Member

@hfutatzhanghb hfutatzhanghb left a comment

Choose a reason for hiding this comment

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

@KeeProMise Thanks a lot for involving me. Thanks @dParikesit report this issue, make sense to me. But i suggest to update the unit test case to better clarify the bug. When i drop asyncComplete(null);, the unit test you submit can also pass.

@dParikesit
Copy link
Copy Markdown
Contributor Author

Hello, @hfutatzhanghb Thanks for reviewing the pr.

When i drop asyncComplete(null);, the unit test you submit can also pass.

Interesting. Can you elaborate more about your setup and how you run the test? I'm testing it on an Intel Xeon Silver 4310 with Ubuntu 22.04. It passed with the asyncComplete, and gave this assertion error without the asyncComplete.

image

@hfutatzhanghb
Copy link
Copy Markdown
Member

Hello, @hfutatzhanghb Thanks for reviewing the pr.

When i drop asyncComplete(null);, the unit test you submit can also pass.

Interesting. Can you elaborate more about your setup and how you run the test? I'm testing it on an Intel Xeon Silver 4310 with Ubuntu 22.04. It passed with the asyncComplete, and gave this assertion error without the asyncComplete.

image

LGTM. +1
I compile and run the unit test again, it behavied as expected.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants