You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "zekai-li (via GitHub)" <gi...@apache.org> on 2023/08/17 07:31:10 UTC

[GitHub] [spark] zekai-li opened a new pull request, #42529: [SPARK-44845][YARN][DEPLOY]Fixed file system uri comparison function

zekai-li opened a new pull request, #42529:
URL: https://github.com/apache/spark/pull/42529

   
   
   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
     2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a faster review.
     7. If you want to add a new configuration, please read the guideline first for naming configurations in
        'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
     8. If you want to add or modify an error type or message, please read the guideline first in
        'core/src/main/resources/error/README.md'.
   -->
   
   ### What changes were proposed in this pull request?
   What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   In the org.apache.spark.deploy.yarn.Client#compareUri method, hdfs://hadoop81:8020 and hdfs://192.168.0.81:8020 are regarded as different file systems (hadoop81 corresponds to 192.168.0.81). The specific reason is that in the last pr, different URIs of user information are also regarded as different file systems. Uri.getauthority is used to determine the user information, but authority contains the host so the URI above must be different from authority. To determine whether the user authentication information is different, you only need to determine URI.getUserInfo.
   
    
   
   the last pr and issue link:
   https://issues.apache.org/jira/browse/SPARK-22587
   
   https://github.com/apache/spark/pull/19885
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   If benchmark tests were added, please run the benchmarks in GitHub Actions for the consistent environment, and the instructions could accord to: https://spark.apache.org/developer-tools.html#github-workflow-benchmarks.
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] zekai-li commented on a diff in pull request #42529: [SPARK-44845][YARN][DEPLOY] Fix file system uri comparison function

Posted by "zekai-li (via GitHub)" <gi...@apache.org>.
zekai-li commented on code in PR #42529:
URL: https://github.com/apache/spark/pull/42529#discussion_r1315273750


##########
resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala:
##########
@@ -1618,9 +1618,9 @@ private[spark] object Client extends Logging {
       return false
     }
 
-    val srcAuthority = srcUri.getAuthority()
-    val dstAuthority = dstUri.getAuthority()
-    if (srcAuthority != null && !srcAuthority.equalsIgnoreCase(dstAuthority)) {
+    val srcUserInfo = srcUri.getUserInfo()
+    val dstUserInfo = dstUri.getUserInfo()
+    if (srcUserInfo != null && !srcUserInfo.equalsIgnoreCase(dstUserInfo)) {

Review Comment:
   srcUserInfo == null && dstUserInfo ! = null is fine in this case。equalsIgnoreCase I'm not sure if this is correct, but I'm going to follow the same logic as before。But the use of equal is more rigorous。



##########
resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala:
##########
@@ -1618,9 +1618,9 @@ private[spark] object Client extends Logging {
       return false
     }
 
-    val srcAuthority = srcUri.getAuthority()
-    val dstAuthority = dstUri.getAuthority()
-    if (srcAuthority != null && !srcAuthority.equalsIgnoreCase(dstAuthority)) {
+    val srcUserInfo = srcUri.getUserInfo()
+    val dstUserInfo = dstUri.getUserInfo()
+    if (srcUserInfo != null && !srcUserInfo.equalsIgnoreCase(dstUserInfo)) {

Review Comment:
   srcUserInfo == null && dstUserInfo ! = null is fine in this case。equalsIgnoreCase I'm not sure if this is correct, but I'm going to follow the same logic as before。But the use of equal is more rigorous。



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun commented on a diff in pull request #42529: [SPARK-44845][YARN][DEPLOY]Fixed file system uri comparison function

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on code in PR #42529:
URL: https://github.com/apache/spark/pull/42529#discussion_r1299091005


##########
resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/ClientSuite.scala:
##########
@@ -685,9 +685,9 @@ class ClientSuite extends SparkFunSuite with Matchers {
     ("files URI unmatch test1", "file:///file1", "file://host/file2"),
     ("files URI unmatch test2", "file://host/file1", "file:///file2"),
     ("files URI unmatch test3", "file://host/file1", "file://host2/file2"),
-    ("wasb URI unmatch test1", "wasb://bucket1@user", "wasb://bucket2@user/"),
-    ("wasb URI unmatch test2", "wasb://bucket1@user", "wasb://bucket1@user2/"),
-    ("s3 URI unmatch test", "s3a://user@pass:bucket1/", "s3a://user2@pass2:bucket1/"),
+    ("wasb URI unmatch test1", "wasb://user@bucket1", "wasb://user@bucket2/"),
+    ("wasb URI unmatch test2", "wasb://user@bucket1", "wasb://user2@bucket1/"),
+    ("s3 URI unmatch test", "s3a://user:pass@bucket1/", "s3a://user2:pass2@bucket1/"),
     ("hdfs URI unmatch test1", "hdfs://namenode1/path1", "hdfs://namenode1:8080/path2"),
     ("hdfs URI unmatch test2", "hdfs://namenode1:8020/path1", "hdfs://namenode1:8080/path2")

Review Comment:
   Hi, @zekai-li . There is no additional test coverage for your reported case. Do you think you can add one to prevent the future regression?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] zekai-li commented on a diff in pull request #42529: [SPARK-44845][YARN][DEPLOY]Fixed file system uri comparison function

Posted by "zekai-li (via GitHub)" <gi...@apache.org>.
zekai-li commented on code in PR #42529:
URL: https://github.com/apache/spark/pull/42529#discussion_r1299645037


##########
resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/ClientSuite.scala:
##########
@@ -685,9 +685,9 @@ class ClientSuite extends SparkFunSuite with Matchers {
     ("files URI unmatch test1", "file:///file1", "file://host/file2"),
     ("files URI unmatch test2", "file://host/file1", "file:///file2"),
     ("files URI unmatch test3", "file://host/file1", "file://host2/file2"),
-    ("wasb URI unmatch test1", "wasb://bucket1@user", "wasb://bucket2@user/"),
-    ("wasb URI unmatch test2", "wasb://bucket1@user", "wasb://bucket1@user2/"),
-    ("s3 URI unmatch test", "s3a://user@pass:bucket1/", "s3a://user2@pass2:bucket1/"),
+    ("wasb URI unmatch test1", "wasb://user@bucket1", "wasb://user@bucket2/"),
+    ("wasb URI unmatch test2", "wasb://user@bucket1", "wasb://user2@bucket1/"),
+    ("s3 URI unmatch test", "s3a://user:pass@bucket1/", "s3a://user2:pass2@bucket1/"),
     ("hdfs URI unmatch test1", "hdfs://namenode1/path1", "hdfs://namenode1:8080/path2"),
     ("hdfs URI unmatch test2", "hdfs://namenode1:8020/path1", "hdfs://namenode1:8080/path2")

Review Comment:
   I added a test data for match:hdfs://localhost:8080 hdfs://127.0.0.1:8080



##########
resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/ClientSuite.scala:
##########
@@ -685,9 +685,9 @@ class ClientSuite extends SparkFunSuite with Matchers {
     ("files URI unmatch test1", "file:///file1", "file://host/file2"),
     ("files URI unmatch test2", "file://host/file1", "file:///file2"),
     ("files URI unmatch test3", "file://host/file1", "file://host2/file2"),
-    ("wasb URI unmatch test1", "wasb://bucket1@user", "wasb://bucket2@user/"),
-    ("wasb URI unmatch test2", "wasb://bucket1@user", "wasb://bucket1@user2/"),
-    ("s3 URI unmatch test", "s3a://user@pass:bucket1/", "s3a://user2@pass2:bucket1/"),
+    ("wasb URI unmatch test1", "wasb://user@bucket1", "wasb://user@bucket2/"),
+    ("wasb URI unmatch test2", "wasb://user@bucket1", "wasb://user2@bucket1/"),
+    ("s3 URI unmatch test", "s3a://user:pass@bucket1/", "s3a://user2:pass2@bucket1/"),
     ("hdfs URI unmatch test1", "hdfs://namenode1/path1", "hdfs://namenode1:8080/path2"),
     ("hdfs URI unmatch test2", "hdfs://namenode1:8020/path1", "hdfs://namenode1:8080/path2")

Review Comment:
   I added a test data for match:hdfs://localhost:8080 hdfs://127.0.0.1:8080



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] mridulm commented on pull request #42529: [SPARK-44845][YARN][DEPLOY]Fixed file system uri comparison function

Posted by "mridulm (via GitHub)" <gi...@apache.org>.
mridulm commented on PR #42529:
URL: https://github.com/apache/spark/pull/42529#issuecomment-1694726401

   (Sorry for the delay on responding to this)
   Just a minor comment, this does look like the right fix.
   
   +CC @tgravescs as well


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] zekai-li commented on a diff in pull request #42529: [SPARK-44845][YARN][DEPLOY] Fix file system uri comparison function

Posted by "zekai-li (via GitHub)" <gi...@apache.org>.
zekai-li commented on code in PR #42529:
URL: https://github.com/apache/spark/pull/42529#discussion_r1315276443


##########
resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala:
##########
@@ -1618,9 +1618,9 @@ private[spark] object Client extends Logging {
       return false
     }
 
-    val srcAuthority = srcUri.getAuthority()
-    val dstAuthority = dstUri.getAuthority()
-    if (srcAuthority != null && !srcAuthority.equalsIgnoreCase(dstAuthority)) {
+    val srcUserInfo = srcUri.getUserInfo()
+    val dstUserInfo = dstUri.getUserInfo()
+    if (srcUserInfo != null && !srcUserInfo.equalsIgnoreCase(dstUserInfo)) {

Review Comment:
   Last pr discussion:https://github.com/apache/spark/pull/19885#discussion_r154819072  



##########
resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala:
##########
@@ -1618,9 +1618,9 @@ private[spark] object Client extends Logging {
       return false
     }
 
-    val srcAuthority = srcUri.getAuthority()
-    val dstAuthority = dstUri.getAuthority()
-    if (srcAuthority != null && !srcAuthority.equalsIgnoreCase(dstAuthority)) {
+    val srcUserInfo = srcUri.getUserInfo()
+    val dstUserInfo = dstUri.getUserInfo()
+    if (srcUserInfo != null && !srcUserInfo.equalsIgnoreCase(dstUserInfo)) {

Review Comment:
   Last pr discussion:https://github.com/apache/spark/pull/19885#discussion_r154819072  



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] mridulm closed pull request #42529: [SPARK-44845][YARN][DEPLOY] Fix file system uri comparison function

Posted by "mridulm (via GitHub)" <gi...@apache.org>.
mridulm closed pull request #42529: [SPARK-44845][YARN][DEPLOY] Fix file system uri comparison function
URL: https://github.com/apache/spark/pull/42529


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] mridulm commented on a diff in pull request #42529: [SPARK-44845][YARN][DEPLOY] Fix file system uri comparison function

Posted by "mridulm (via GitHub)" <gi...@apache.org>.
mridulm commented on code in PR #42529:
URL: https://github.com/apache/spark/pull/42529#discussion_r1316224064


##########
resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala:
##########
@@ -1618,9 +1618,9 @@ private[spark] object Client extends Logging {
       return false
     }
 
-    val srcAuthority = srcUri.getAuthority()
-    val dstAuthority = dstUri.getAuthority()
-    if (srcAuthority != null && !srcAuthority.equalsIgnoreCase(dstAuthority)) {
+    val srcUserInfo = srcUri.getUserInfo()
+    val dstUserInfo = dstUri.getUserInfo()
+    if (srcUserInfo != null && !srcUserInfo.equalsIgnoreCase(dstUserInfo)) {

Review Comment:
   `getAuthority` is not null since it includes the host - `getUserInfo` can be `null`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun commented on pull request #42529: [SPARK-44845][YARN][DEPLOY]Fixed file system uri comparison function

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #42529:
URL: https://github.com/apache/spark/pull/42529#issuecomment-1685725824

   cc @mridulm 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] zekai-li commented on pull request #42529: [SPARK-44845][YARN][DEPLOY] Fix file system uri comparison function

Posted by "zekai-li (via GitHub)" <gi...@apache.org>.
zekai-li commented on PR #42529:
URL: https://github.com/apache/spark/pull/42529#issuecomment-1705835097

   > Hi, @zekai-li .
   > 
   > It seems that you didn't address the previous review comment yet. WDYT?
   > 
   > [#42529 (comment)](https://github.com/apache/spark/pull/42529#discussion_r1306701075)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun commented on a diff in pull request #42529: [SPARK-44845][YARN][DEPLOY]Fixed file system uri comparison function

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on code in PR #42529:
URL: https://github.com/apache/spark/pull/42529#discussion_r1299090841


##########
resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala:
##########
@@ -1618,9 +1618,9 @@ private[spark] object Client extends Logging {
       return false
     }
 
-    val srcAuthority = srcUri.getAuthority()
-    val dstAuthority = dstUri.getAuthority()
-    if (srcAuthority != null && !srcAuthority.equalsIgnoreCase(dstAuthority)) {

Review Comment:
   According to the description, this is a behavior since Apache Spark 2.3.0?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun commented on a diff in pull request #42529: [SPARK-44845][YARN][DEPLOY]Fixed file system uri comparison function

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on code in PR #42529:
URL: https://github.com/apache/spark/pull/42529#discussion_r1299648837


##########
resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/ClientSuite.scala:
##########
@@ -685,9 +685,9 @@ class ClientSuite extends SparkFunSuite with Matchers {
     ("files URI unmatch test1", "file:///file1", "file://host/file2"),
     ("files URI unmatch test2", "file://host/file1", "file:///file2"),
     ("files URI unmatch test3", "file://host/file1", "file://host2/file2"),
-    ("wasb URI unmatch test1", "wasb://bucket1@user", "wasb://bucket2@user/"),
-    ("wasb URI unmatch test2", "wasb://bucket1@user", "wasb://bucket1@user2/"),
-    ("s3 URI unmatch test", "s3a://user@pass:bucket1/", "s3a://user2@pass2:bucket1/"),
+    ("wasb URI unmatch test1", "wasb://user@bucket1", "wasb://user@bucket2/"),
+    ("wasb URI unmatch test2", "wasb://user@bucket1", "wasb://user2@bucket1/"),
+    ("s3 URI unmatch test", "s3a://user:pass@bucket1/", "s3a://user2:pass2@bucket1/"),
     ("hdfs URI unmatch test1", "hdfs://namenode1/path1", "hdfs://namenode1:8080/path2"),
     ("hdfs URI unmatch test2", "hdfs://namenode1:8020/path1", "hdfs://namenode1:8080/path2")

Review Comment:
   Thanks, @zekai-li . Does it fail before this patch?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] mridulm commented on pull request #42529: [SPARK-44845][YARN][DEPLOY] Fix file system uri comparison function

Posted by "mridulm (via GitHub)" <gi...@apache.org>.
mridulm commented on PR #42529:
URL: https://github.com/apache/spark/pull/42529#issuecomment-1709450545

   Merged to master.
   Thanks for fixing this @zekai-li !
   Thanks for the reviews @yaooqinn, @dongjoon-hyun, @tgravescs :)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] zekai-li closed pull request #42529: [SPARK-44845][YARN][DEPLOY] Fix file system uri comparison function

Posted by "zekai-li (via GitHub)" <gi...@apache.org>.
zekai-li closed pull request #42529: [SPARK-44845][YARN][DEPLOY] Fix file system uri comparison function
URL: https://github.com/apache/spark/pull/42529


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] zekai-li commented on pull request #42529: [SPARK-44845][YARN][DEPLOY] Fix file system uri comparison function

Posted by "zekai-li (via GitHub)" <gi...@apache.org>.
zekai-li commented on PR #42529:
URL: https://github.com/apache/spark/pull/42529#issuecomment-1704480296

   @tgravescs take a check


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] mridulm commented on a diff in pull request #42529: [SPARK-44845][YARN][DEPLOY] Fix file system uri comparison function

Posted by "mridulm (via GitHub)" <gi...@apache.org>.
mridulm commented on code in PR #42529:
URL: https://github.com/apache/spark/pull/42529#discussion_r1318062399


##########
resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala:
##########
@@ -1618,9 +1618,10 @@ private[spark] object Client extends Logging {
       return false
     }
 
-    val srcAuthority = srcUri.getAuthority()
-    val dstAuthority = dstUri.getAuthority()
-    if (srcAuthority != null && !srcAuthority.equalsIgnoreCase(dstAuthority)) {
+    val srcUserInfo = Option(srcUri.getUserInfo).getOrElse("")
+    val dstUserInfo = Option(dstUri.getUserInfo).getOrElse("")
+
+    if (!srcUserInfo.equals(dstUserInfo)) {

Review Comment:
   This is stricter, and better !
   We could have just made it `srcUserInfo != dstUserInfo` btw :)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] mridulm commented on a diff in pull request #42529: [SPARK-44845][YARN][DEPLOY] Fix file system uri comparison function

Posted by "mridulm (via GitHub)" <gi...@apache.org>.
mridulm commented on code in PR #42529:
URL: https://github.com/apache/spark/pull/42529#discussion_r1318062399


##########
resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala:
##########
@@ -1618,9 +1618,10 @@ private[spark] object Client extends Logging {
       return false
     }
 
-    val srcAuthority = srcUri.getAuthority()
-    val dstAuthority = dstUri.getAuthority()
-    if (srcAuthority != null && !srcAuthority.equalsIgnoreCase(dstAuthority)) {
+    val srcUserInfo = Option(srcUri.getUserInfo).getOrElse("")
+    val dstUserInfo = Option(dstUri.getUserInfo).getOrElse("")
+
+    if (!srcUserInfo.equals(dstUserInfo)) {

Review Comment:
   This is stricter, and better !



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] yaooqinn commented on a diff in pull request #42529: [SPARK-44845][YARN][DEPLOY]Fixed file system uri comparison function

Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on code in PR #42529:
URL: https://github.com/apache/spark/pull/42529#discussion_r1299116501


##########
resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/ClientSuite.scala:
##########
@@ -670,7 +670,7 @@ class ClientSuite extends SparkFunSuite with Matchers {
     ("files URI match test1", "file:///file1", "file:///file2"),
     ("files URI match test2", "file:///c:file1", "file://c:file2"),
     ("files URI match test3", "file://host/file1", "file://host/file2"),
-    ("wasb URI match test", "wasb://bucket1@user", "wasb://bucket1@user/"),
+    ("wasb URI match test", "wasb://user@bucket1", "wasb://user@bucket1/"),

Review Comment:
   According to the Hadoop doc, https://hadoop.apache.org/docs/current/hadoop-azure/index.html#Accessing_wasb_URLs, the original uri is reasonable?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] yaooqinn commented on a diff in pull request #42529: [SPARK-44845][YARN][DEPLOY]Fixed file system uri comparison function

Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on code in PR #42529:
URL: https://github.com/apache/spark/pull/42529#discussion_r1299116754


##########
resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/ClientSuite.scala:
##########
@@ -685,9 +685,9 @@ class ClientSuite extends SparkFunSuite with Matchers {
     ("files URI unmatch test1", "file:///file1", "file://host/file2"),
     ("files URI unmatch test2", "file://host/file1", "file:///file2"),
     ("files URI unmatch test3", "file://host/file1", "file://host2/file2"),
-    ("wasb URI unmatch test1", "wasb://bucket1@user", "wasb://bucket2@user/"),
-    ("wasb URI unmatch test2", "wasb://bucket1@user", "wasb://bucket1@user2/"),
-    ("s3 URI unmatch test", "s3a://user@pass:bucket1/", "s3a://user2@pass2:bucket1/"),
+    ("wasb URI unmatch test1", "wasb://user@bucket1", "wasb://user@bucket2/"),

Review Comment:
   ditto



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] zekai-li commented on a diff in pull request #42529: [SPARK-44845][YARN][DEPLOY]Fixed file system uri comparison function

Posted by "zekai-li (via GitHub)" <gi...@apache.org>.
zekai-li commented on code in PR #42529:
URL: https://github.com/apache/spark/pull/42529#discussion_r1299656621


##########
resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/ClientSuite.scala:
##########
@@ -685,9 +685,9 @@ class ClientSuite extends SparkFunSuite with Matchers {
     ("files URI unmatch test1", "file:///file1", "file://host/file2"),
     ("files URI unmatch test2", "file://host/file1", "file:///file2"),
     ("files URI unmatch test3", "file://host/file1", "file://host2/file2"),
-    ("wasb URI unmatch test1", "wasb://bucket1@user", "wasb://bucket2@user/"),
-    ("wasb URI unmatch test2", "wasb://bucket1@user", "wasb://bucket1@user2/"),
-    ("s3 URI unmatch test", "s3a://user@pass:bucket1/", "s3a://user2@pass2:bucket1/"),
+    ("wasb URI unmatch test1", "wasb://user@bucket1", "wasb://user@bucket2/"),
+    ("wasb URI unmatch test2", "wasb://user@bucket1", "wasb://user2@bucket1/"),
+    ("s3 URI unmatch test", "s3a://user:pass@bucket1/", "s3a://user2:pass2@bucket1/"),
     ("hdfs URI unmatch test1", "hdfs://namenode1/path1", "hdfs://namenode1:8080/path2"),
     ("hdfs URI unmatch test2", "hdfs://namenode1:8020/path1", "hdfs://namenode1:8080/path2")

Review Comment:
   It was a failure. As described by my pr. It's too sketchy to tell by uri.getauthority



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] mridulm commented on a diff in pull request #42529: [SPARK-44845][YARN][DEPLOY]Fixed file system uri comparison function

Posted by "mridulm (via GitHub)" <gi...@apache.org>.
mridulm commented on code in PR #42529:
URL: https://github.com/apache/spark/pull/42529#discussion_r1306701075


##########
resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala:
##########
@@ -1618,9 +1618,9 @@ private[spark] object Client extends Logging {
       return false
     }
 
-    val srcAuthority = srcUri.getAuthority()
-    val dstAuthority = dstUri.getAuthority()
-    if (srcAuthority != null && !srcAuthority.equalsIgnoreCase(dstAuthority)) {
+    val srcUserInfo = srcUri.getUserInfo()
+    val dstUserInfo = dstUri.getUserInfo()
+    if (srcUserInfo != null && !srcUserInfo.equalsIgnoreCase(dstUserInfo)) {

Review Comment:
   This does not handle the case of `srcUserInfo == null && dstUserInfo != null`
   Also, I am not sure if `equalsIgnoreCase` is right here btw ... 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] mridulm commented on a diff in pull request #42529: [SPARK-44845][YARN][DEPLOY]Fixed file system uri comparison function

Posted by "mridulm (via GitHub)" <gi...@apache.org>.
mridulm commented on code in PR #42529:
URL: https://github.com/apache/spark/pull/42529#discussion_r1306701075


##########
resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala:
##########
@@ -1618,9 +1618,9 @@ private[spark] object Client extends Logging {
       return false
     }
 
-    val srcAuthority = srcUri.getAuthority()
-    val dstAuthority = dstUri.getAuthority()
-    if (srcAuthority != null && !srcAuthority.equalsIgnoreCase(dstAuthority)) {
+    val srcUserInfo = srcUri.getUserInfo()
+    val dstUserInfo = dstUri.getUserInfo()
+    if (srcUserInfo != null && !srcUserInfo.equalsIgnoreCase(dstUserInfo)) {

Review Comment:
   This does not handle the case of `srcUserInfo == null && dstUserInfo != null`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] tgravescs commented on pull request #42529: [SPARK-44845][YARN][DEPLOY] Fix file system uri comparison function

Posted by "tgravescs (via GitHub)" <gi...@apache.org>.
tgravescs commented on PR #42529:
URL: https://github.com/apache/spark/pull/42529#issuecomment-1708448136

   looks fine to me


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] zekai-li commented on a diff in pull request #42529: [SPARK-44845][YARN][DEPLOY] Fix file system uri comparison function

Posted by "zekai-li (via GitHub)" <gi...@apache.org>.
zekai-li commented on code in PR #42529:
URL: https://github.com/apache/spark/pull/42529#discussion_r1315274264


##########
resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala:
##########
@@ -1618,9 +1618,9 @@ private[spark] object Client extends Logging {
       return false
     }
 
-    val srcAuthority = srcUri.getAuthority()
-    val dstAuthority = dstUri.getAuthority()
-    if (srcAuthority != null && !srcAuthority.equalsIgnoreCase(dstAuthority)) {
+    val srcUserInfo = srcUri.getUserInfo()
+    val dstUserInfo = dstUri.getUserInfo()
+    if (srcUserInfo != null && !srcUserInfo.equalsIgnoreCase(dstUserInfo)) {

Review Comment:
   We don't need to do this adaptation for the user!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] zekai-li commented on pull request #42529: [SPARK-44845][YARN][DEPLOY] Fix file system uri comparison function

Posted by "zekai-li (via GitHub)" <gi...@apache.org>.
zekai-li commented on PR #42529:
URL: https://github.com/apache/spark/pull/42529#issuecomment-1705837097

   > Hi, @zekai-li .
   > 
   > It seems that you didn't address the previous review comment yet. WDYT?
   > 
   > [#42529 (comment)](https://github.com/apache/spark/pull/42529#discussion_r1306701075)
   Sorry, I didn't notice. This is something you need to decide for equalsIgnoreCase
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] zekai-li commented on a diff in pull request #42529: [SPARK-44845][YARN][DEPLOY]Fixed file system uri comparison function

Posted by "zekai-li (via GitHub)" <gi...@apache.org>.
zekai-li commented on code in PR #42529:
URL: https://github.com/apache/spark/pull/42529#discussion_r1299504495


##########
resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/ClientSuite.scala:
##########
@@ -670,7 +670,7 @@ class ClientSuite extends SparkFunSuite with Matchers {
     ("files URI match test1", "file:///file1", "file:///file2"),
     ("files URI match test2", "file:///c:file1", "file://c:file2"),
     ("files URI match test3", "file://host/file1", "file://host/file2"),
-    ("wasb URI match test", "wasb://bucket1@user", "wasb://bucket1@user/"),
+    ("wasb URI match test", "wasb://user@bucket1", "wasb://user@bucket1/"),

Review Comment:
   It makes sense that wasb is a special case for host, but it does not violate the original uri. The main problem I'm referring to is that s3 writes the password in the wrong place, and I can't find a way to write it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] zekai-li commented on a diff in pull request #42529: [SPARK-44845][YARN][DEPLOY]Fixed file system uri comparison function

Posted by "zekai-li (via GitHub)" <gi...@apache.org>.
zekai-li commented on code in PR #42529:
URL: https://github.com/apache/spark/pull/42529#discussion_r1299512887


##########
resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/ClientSuite.scala:
##########
@@ -670,7 +670,7 @@ class ClientSuite extends SparkFunSuite with Matchers {
     ("files URI match test1", "file:///file1", "file:///file2"),
     ("files URI match test2", "file:///c:file1", "file://c:file2"),
     ("files URI match test3", "file://host/file1", "file://host/file2"),
-    ("wasb URI match test", "wasb://bucket1@user", "wasb://bucket1@user/"),
+    ("wasb URI match test", "wasb://user@bucket1", "wasb://user@bucket1/"),

Review Comment:
   wasb I'm going back to the standard format



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org