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

HADOOP-16255. Add ChecksumFs.rename(path, path, boolean) to rename crc file as well when FileContext.rename(path, path, options) is called. #1388

Closed
wants to merge 5 commits into from

Conversation

HeartSaVioR
Copy link
Contributor

Please refer https://issues.apache.org/jira/browse/HADOOP-16255 for more details.

FYI, FileContext.rename(path, path, options) leaks crc file for source of rename when CheckFs or its descendant is used as underlying filesystem. https://issues.apache.org/jira/browse/SPARK-28025 took a workaround via removing crc file manually, and we hope to get rid of workaround eventually.

@HeartSaVioR
Copy link
Contributor Author

cc. @steveloughran to ask for reviewing.

@HeartSaVioR HeartSaVioR changed the title HADOOP-16225. Add ChecksumFs.rename(path, path, boolean) to rename crc file as well when FileContext.rename(path, path, options) is called. HADOOP-16255. Add ChecksumFs.rename(path, path, boolean) to rename crc file as well when FileContext.rename(path, path, options) is called. Aug 31, 2019
…c file as well when FileContext.rename(path, path, options) is called.
@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
0 reexec 45 Docker mode activated.
_ Prechecks _
+1 dupname 0 No case conflicting files found.
+1 @author 0 The patch does not contain any @author tags.
+1 test4tests 0 The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+1 mvninstall 1097 trunk passed
+1 compile 1070 trunk passed
+1 checkstyle 48 trunk passed
+1 mvnsite 87 trunk passed
+1 shadedclient 817 branch has no errors when building and testing our client artifacts.
+1 javadoc 65 trunk passed
0 spotbugs 130 Used deprecated FindBugs config; considering switching to SpotBugs.
+1 findbugs 127 trunk passed
_ Patch Compile Tests _
+1 mvninstall 50 the patch passed
+1 compile 1021 the patch passed
+1 javac 1021 the patch passed
-0 checkstyle 50 hadoop-common-project/hadoop-common: The patch generated 10 new + 30 unchanged - 0 fixed = 40 total (was 30)
+1 mvnsite 81 the patch passed
+1 whitespace 0 The patch has no whitespace issues.
+1 shadedclient 661 patch has no errors when building and testing our client artifacts.
+1 javadoc 67 the patch passed
+1 findbugs 138 the patch passed
_ Other Tests _
+1 unit 578 hadoop-common in the patch passed.
+1 asflicense 52 The patch does not generate ASF License warnings.
6135
Subsystem Report/Notes
Docker Client=19.03.1 Server=19.03.1 base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1388/2/artifact/out/Dockerfile
GITHUB PR #1388
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle
uname Linux 33be8e4772a6 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality personality/hadoop.sh
git revision trunk / 7d998cb
Default Java 1.8.0_222
checkstyle https://builds.apache.org/job/hadoop-multibranch/job/PR-1388/2/artifact/out/diff-checkstyle-hadoop-common-project_hadoop-common.txt
Test Results https://builds.apache.org/job/hadoop-multibranch/job/PR-1388/2/testReport/
Max. process+thread count 1679 (vs. ulimit of 5500)
modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
Console output https://builds.apache.org/job/hadoop-multibranch/job/PR-1388/2/console
versions git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1
Powered by Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
0 reexec 82 Docker mode activated.
_ Prechecks _
+1 dupname 0 No case conflicting files found.
+1 @author 0 The patch does not contain any @author tags.
+1 test4tests 0 The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+1 mvninstall 1164 trunk passed
+1 compile 993 trunk passed
+1 checkstyle 42 trunk passed
+1 mvnsite 72 trunk passed
+1 shadedclient 836 branch has no errors when building and testing our client artifacts.
+1 javadoc 60 trunk passed
0 spotbugs 119 Used deprecated FindBugs config; considering switching to SpotBugs.
+1 findbugs 117 trunk passed
_ Patch Compile Tests _
+1 mvninstall 45 the patch passed
+1 compile 936 the patch passed
+1 javac 936 the patch passed
-0 checkstyle 42 hadoop-common-project/hadoop-common: The patch generated 10 new + 30 unchanged - 0 fixed = 40 total (was 30)
+1 mvnsite 69 the patch passed
+1 whitespace 0 The patch has no whitespace issues.
+1 shadedclient 716 patch has no errors when building and testing our client artifacts.
+1 javadoc 60 the patch passed
+1 findbugs 122 the patch passed
_ Other Tests _
+1 unit 537 hadoop-common in the patch passed.
+1 asflicense 43 The patch does not generate ASF License warnings.
6024
Subsystem Report/Notes
Docker Client=19.03.1 Server=19.03.1 base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1388/3/artifact/out/Dockerfile
GITHUB PR #1388
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle
uname Linux cae53e552296 4.15.0-48-generic #51-Ubuntu SMP Wed Apr 3 08:28:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality personality/hadoop.sh
git revision trunk / 7d998cb
Default Java 1.8.0_212
checkstyle https://builds.apache.org/job/hadoop-multibranch/job/PR-1388/3/artifact/out/diff-checkstyle-hadoop-common-project_hadoop-common.txt
Test Results https://builds.apache.org/job/hadoop-multibranch/job/PR-1388/3/testReport/
Max. process+thread count 1347 (vs. ulimit of 5500)
modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
Console output https://builds.apache.org/job/hadoop-multibranch/job/PR-1388/3/console
versions git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1
Powered by Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
0 reexec 41 Docker mode activated.
_ Prechecks _
+1 dupname 0 No case conflicting files found.
+1 @author 0 The patch does not contain any @author tags.
+1 test4tests 0 The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+1 mvninstall 1017 trunk passed
+1 compile 984 trunk passed
+1 checkstyle 51 trunk passed
+1 mvnsite 83 trunk passed
+1 shadedclient 824 branch has no errors when building and testing our client artifacts.
+1 javadoc 70 trunk passed
0 spotbugs 120 Used deprecated FindBugs config; considering switching to SpotBugs.
+1 findbugs 119 trunk passed
_ Patch Compile Tests _
+1 mvninstall 46 the patch passed
+1 compile 932 the patch passed
+1 javac 932 the patch passed
+1 checkstyle 50 the patch passed
+1 mvnsite 80 the patch passed
+1 whitespace 0 The patch has no whitespace issues.
+1 shadedclient 676 patch has no errors when building and testing our client artifacts.
+1 javadoc 73 the patch passed
+1 findbugs 129 the patch passed
_ Other Tests _
+1 unit 547 hadoop-common in the patch passed.
+1 asflicense 53 The patch does not generate ASF License warnings.
5869
Subsystem Report/Notes
Docker Client=19.03.1 Server=19.03.1 base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1388/4/artifact/out/Dockerfile
GITHUB PR #1388
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle
uname Linux b27028dcaf92 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality personality/hadoop.sh
git revision trunk / 7d998cb
Default Java 1.8.0_222
Test Results https://builds.apache.org/job/hadoop-multibranch/job/PR-1388/4/testReport/
Max. process+thread count 1475 (vs. ulimit of 5500)
modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
Console output https://builds.apache.org/job/hadoop-multibranch/job/PR-1388/4/console
versions git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1
Powered by Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

renameOpt = Options.Rename.OVERWRITE;
}
final Options.Rename opt = renameOpt;
renameInternal(src, dst, (s, d) -> getMyFs().rename(s, d, opt));
Copy link

@skonto skonto Aug 31, 2019

Choose a reason for hiding this comment

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

Would it be wrong to delegate to myFs like here:


Just curious. What is the concrete class of the AbastractFileSystem field?

Copy link
Contributor Author

@HeartSaVioR HeartSaVioR Sep 1, 2019

Choose a reason for hiding this comment

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

ChecksumFs should deal with checksum file by itself (others even don't have to know the existence of checksum - once all operations are pass through ChecksumFs's override methods): that's why the method should be override. Just delegating rename would have same result, checksum file leak.

What is the concrete class of the AbastractFileSystem field?

If the source file is from local filesystem, I think it's RawLocalFs. It could be DelegateToFileSystem, but it will redirect to RawLocalFs eventually.

Copy link
Contributor

Choose a reason for hiding this comment

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

Looking at this, its the more elegant functional API. Which is nice for hadoop 3+. But I fear its probably going to lose all that elegance on branch-2 (assuming you do want a backport). If you do, then simply copying the existing renameInternal to one with a new signature is going to be the simplest

@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
0 reexec 42 Docker mode activated.
_ Prechecks _
+1 dupname 0 No case conflicting files found.
+1 @author 0 The patch does not contain any @author tags.
+1 test4tests 0 The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+1 mvninstall 1409 trunk passed
+1 compile 1339 trunk passed
+1 checkstyle 52 trunk passed
+1 mvnsite 105 trunk passed
+1 shadedclient 1008 branch has no errors when building and testing our client artifacts.
+1 javadoc 75 trunk passed
0 spotbugs 153 Used deprecated FindBugs config; considering switching to SpotBugs.
+1 findbugs 149 trunk passed
_ Patch Compile Tests _
+1 mvninstall 64 the patch passed
+1 compile 1264 the patch passed
+1 javac 1264 the patch passed
+1 checkstyle 51 the patch passed
+1 mvnsite 87 the patch passed
+1 whitespace 0 The patch has no whitespace issues.
+1 shadedclient 909 patch has no errors when building and testing our client artifacts.
+1 javadoc 81 the patch passed
+1 findbugs 172 the patch passed
_ Other Tests _
+1 unit 620 hadoop-common in the patch passed.
+1 asflicense 54 The patch does not generate ASF License warnings.
7558
Subsystem Report/Notes
Docker Client=19.03.1 Server=19.03.1 base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1388/5/artifact/out/Dockerfile
GITHUB PR #1388
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle
uname Linux a373622f7857 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality personality/hadoop.sh
git revision trunk / 915cbc9
Default Java 1.8.0_222
Test Results https://builds.apache.org/job/hadoop-multibranch/job/PR-1388/5/testReport/
Max. process+thread count 1453 (vs. ulimit of 5500)
modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
Console output https://builds.apache.org/job/hadoop-multibranch/job/PR-1388/5/console
versions git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1
Powered by Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

@apache apache deleted a comment from hadoop-yetus Sep 3, 2019
* Defines a functional interface having two inputs which throws IOException.
*/
@FunctionalInterface
public interface CheckedBiFunction<LEFT, RIGHT, THROWABLE extends IOException> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Cute! I never knew you could do that with templates and exceptions!

  1. can you put into org.apache.hadoop.fs.impl where the other internal-for-fs-only lambda stuff is going.
  2. be advised that for backports to branch 2 we will have to make things compile on Java 8. Mostly this is just using the IDE to convert things to callables. Doesn't mean they shouldn't be used, only that once you get sufficiently advanced things become unbackportable. This patch looks fine

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually CheckedBiFunction is already available in other place (HDDS) - I feel these interfaces/classes would be better to be moved into common module when Hadoop could forget about JDK7.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, they should. I'm doing in new code that I know isn't going to be backportable into jdk7, not now we have to worry about jdk11

@steveloughran
Copy link
Contributor

core patch LGTM for a branch 3+ patch; made some minor comments about tests and imports

If you want this in branch-2 then I think a copy-and-paste solution is the simpler one

@HeartSaVioR
Copy link
Contributor Author

HeartSaVioR commented Sep 3, 2019

Sigh... I forgot Hadoop 2.x runs on JDK 7+. Actually I just did copy-and-paste and expected review comment on deduplication, hence taking this way but forgot about that.

Thanks for reminding! I'll just roll back to copy-and-paste solution.

@HeartSaVioR
Copy link
Contributor Author

Thanks for reviewing. I addressed review comments, including rolling back to the copy-and-paste approach. Please take a look.

@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
0 reexec 35 Docker mode activated.
_ Prechecks _
+1 dupname 0 No case conflicting files found.
+1 @author 0 The patch does not contain any @author tags.
+1 test4tests 0 The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+1 mvninstall 1237 trunk passed
+1 compile 1193 trunk passed
+1 checkstyle 48 trunk passed
+1 mvnsite 91 trunk passed
+1 shadedclient 948 branch has no errors when building and testing our client artifacts.
+1 javadoc 70 trunk passed
0 spotbugs 146 Used deprecated FindBugs config; considering switching to SpotBugs.
+1 findbugs 143 trunk passed
_ Patch Compile Tests _
+1 mvninstall 55 the patch passed
+1 compile 1173 the patch passed
+1 javac 1173 the patch passed
+1 checkstyle 49 the patch passed
+1 mvnsite 79 the patch passed
+1 whitespace 0 The patch has no whitespace issues.
+1 shadedclient 810 patch has no errors when building and testing our client artifacts.
+1 javadoc 68 the patch passed
+1 findbugs 161 the patch passed
_ Other Tests _
+1 unit 641 hadoop-common in the patch passed.
+1 asflicense 53 The patch does not generate ASF License warnings.
6909
Subsystem Report/Notes
Docker Client=19.03.1 Server=19.03.1 base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1388/6/artifact/out/Dockerfile
GITHUB PR #1388
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle
uname Linux 98f6ca19ebf6 4.15.0-60-generic #67-Ubuntu SMP Thu Aug 22 16:55:30 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality personality/hadoop.sh
git revision trunk / 337e9b7
Default Java 1.8.0_222
Test Results https://builds.apache.org/job/hadoop-multibranch/job/PR-1388/6/testReport/
Max. process+thread count 1327 (vs. ulimit of 5500)
modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
Console output https://builds.apache.org/job/hadoop-multibranch/job/PR-1388/6/console
versions git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1
Powered by Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

@steveloughran
Copy link
Contributor

all is good, +1 for trunk and I'll actually pull into 3.2 as well. For branch-2 I'll give you the homework of the cherrypick and retest before it goes in.

@steveloughran
Copy link
Contributor

Ok, committed to branch-3.2 and trunk.

@HeartSaVioR
Copy link
Contributor Author

Thanks for reviewing and merging! I'll create separate PR for branch-2. Thanks for the guide.

@steveloughran
Copy link
Contributor

great!

FWIW you made the 3.2 branch about 8h before the 3.2.1 branch was made, so this will be in that release. Please help test those RCs to make sure they do the right thing for you

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