Skip to content

HBASE-21070 Fix SnapshotFileCache for HBase backed by S3 - #209

Merged
z-york merged 1 commit into
apache:masterfrom
z-york:snapshot
May 6, 2019
Merged

HBASE-21070 Fix SnapshotFileCache for HBase backed by S3#209
z-york merged 1 commit into
apache:masterfrom
z-york:snapshot

Conversation

@z-york

Copy link
Copy Markdown
Contributor

SnapshotFileCache depends on getting the last modified time of the
snapshot directory, however, S3 FileSystem's do not update the
last modified time of the top 'folder' when objects are added/removed.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
0reexec291Docker mode activated.
_ Prechecks _
+1hbaseanti0Patch does not have any anti-patterns.
+1@author0The patch does not contain any @author tags.
+1test4tests0The patch appears to include 1 new or modified test files.
_ master Compile Tests _
+1mvninstall271master passed
+1compile57master passed
+1checkstyle71master passed
+1shadedjars285branch has no errors when building our shaded downstream artifacts.
+1findbugs333master passed
+1javadoc59master passed
_ Patch Compile Tests _
+1mvninstall233the patch passed
+1compile49the patch passed
+1javac49the patch passed
-1checkstyle65hbase-server: The patch generated 1 new + 1 unchanged - 1 fixed = 2 total (was 2)
+1whitespace0The patch has no whitespace issues.
+1shadedjars262patch has no errors when building our shaded downstream artifacts.
+1hadoopcheck747Patch does not cause any errors with Hadoop 2.7.4 or 3.0.0.
+1findbugs226the patch passed
+1javadoc31the patch passed
_ Other Tests _
-1unit16017hbase-server in the patch failed.
+1asflicense33The patch does not generate ASF License warnings.
19113
ReasonTests
Failed junit testshadoop.hbase.master.TestAssignmentManagerMetrics
hadoop.hbase.client.TestFromClientSide3
SubsystemReport/Notes
DockerClient=17.05.0-ce Server=17.05.0-ce base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-209/1/artifact/out/Dockerfile
GITHUB PR#209
Optional Testsdupname asflicense javac javadoc unit findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux a83d97447668 4.4.0-139-generic #165-Ubuntu SMP Wed Oct 24 10:58:50 UTC 2018 x86_64 GNU/Linux
Build toolmaven
Personality/testptch/patchprocess/precommit/personality/provided.sh
git revisionmaster / 70296a2
mavenversion: Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T18:33:14Z)
Default Java1.8.0_181
findbugsv3.1.11
checkstylehttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-209/1/artifact/out/diff-checkstyle-hbase-server.txt
unithttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-209/1/artifact/out/patch-unit-hbase-server.txt
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-209/1/testReport/
Max. process+thread count4669 (vs. ulimit of 10000)
modulesC: hbase-server U: hbase-server
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-209/1/console
Powered byApache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

@z-york

Copy link
Copy Markdown
ContributorAuthor

Updated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
0reexec265Docker mode activated.
_ Prechecks _
+1hbaseanti0Patch does not have any anti-patterns.
+1@author0The patch does not contain any @author tags.
+1test4tests0The patch appears to include 1 new or modified test files.
_ master Compile Tests _
+1mvninstall263master passed
+1compile53master passed
+1checkstyle68master passed
+1shadedjars264branch has no errors when building our shaded downstream artifacts.
+1findbugs185master passed
+1javadoc33master passed
_ Patch Compile Tests _
+1mvninstall240the patch passed
+1compile52the patch passed
+1javac52the patch passed
-1checkstyle72hbase-server: The patch generated 2 new + 1 unchanged - 1 fixed = 3 total (was 2)
+1whitespace0The patch has no whitespace issues.
+1shadedjars254patch has no errors when building our shaded downstream artifacts.
+1hadoopcheck516Patch does not cause any errors with Hadoop 2.7.4 or 3.0.0.
+1findbugs222the patch passed
+1javadoc30the patch passed
_ Other Tests _
-1unit16425hbase-server in the patch failed.
+1asflicense28The patch does not generate ASF License warnings.
19043
ReasonTests
Failed junit testshadoop.hbase.quotas.TestSpaceQuotas
SubsystemReport/Notes
DockerClient=17.05.0-ce Server=17.05.0-ce base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-209/2/artifact/out/Dockerfile
GITHUB PR#209
Optional Testsdupname asflicense javac javadoc unit findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux 8ce1b8757b3e 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 17:16:02 UTC 2018 x86_64 GNU/Linux
Build toolmaven
Personality/testptch/patchprocess/precommit/personality/provided.sh
git revisionmaster / 4379fe4
mavenversion: Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T18:33:14Z)
Default Java1.8.0_181
findbugsv3.1.11
checkstylehttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-209/2/artifact/out/diff-checkstyle-hbase-server.txt
unithttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-209/2/artifact/out/patch-unit-hbase-server.txt
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-209/2/testReport/
Max. process+thread count5055 (vs. ulimit of 10000)
modulesC: hbase-server U: hbase-server
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-209/2/console
Powered byApache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

@apurtellapurtell left a comment

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.

+1

@Apache9

Copy link
Copy Markdown
Contributor

A simple question here, does S3 FileSystem support atomic rename? If not, what if we list and read the snapshot directories during a rename processing?

@z-york

Copy link
Copy Markdown
ContributorAuthor

@Apache9 No S3 Filesystems don't support a true atomic rename (at least none that I know of :) ).

I think I have changed my mind and prefer removing the modification time since I think the performance gain is marginal. I think I will remove SnapshotFileCache changes, but leave the test so we don't regress.

SnapshotFileCache depends on getting the last modified time of the
snapshot directory, however, S3 FileSystem's do not update the
last modified time of the top 'folder' when objects are added/removed.
This commit adds a test for the previously fixed SnapshotFileCache.
@z-york

Copy link
Copy Markdown
ContributorAuthor

Updated to only include the test. Verified that it fails without this patch and passes with it.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
0reexec246Docker mode activated.
_ Prechecks _
+1hbaseanti0Patch does not have any anti-patterns.
+1@author0The patch does not contain any @author tags.
+1test4tests0The patch appears to include 1 new or modified test files.
_ master Compile Tests _
+1mvninstall269master passed
+1compile51master passed
+1checkstyle67master passed
+1shadedjars258branch has no errors when building our shaded downstream artifacts.
+1findbugs170master passed
+1javadoc32master passed
_ Patch Compile Tests _
+1mvninstall234the patch passed
+1compile55the patch passed
+1javac55the patch passed
-1checkstyle69hbase-server: The patch generated 1 new + 0 unchanged - 0 fixed = 1 total (was 0)
+1whitespace0The patch has no whitespace issues.
+1shadedjars269patch has no errors when building our shaded downstream artifacts.
+1hadoopcheck521Patch does not cause any errors with Hadoop 2.7.4 or 3.0.0.
+1findbugs217the patch passed
+1javadoc32the patch passed
_ Other Tests _
-1unit17218hbase-server in the patch failed.
+1asflicense29The patch does not generate ASF License warnings.
19819
ReasonTests
Failed junit testshadoop.hbase.regionserver.TestRegionReplicaFailover
hadoop.hbase.client.TestFromClientSideWithCoprocessor
hadoop.hbase.client.TestSnapshotDFSTemporaryDirectory
hadoop.hbase.client.TestFromClientSide
hadoop.hbase.util.TestFromClientSide3WoUnsafe
hadoop.hbase.master.TestAssignmentManagerMetrics
hadoop.hbase.client.TestFromClientSide3
hadoop.hbase.client.TestAdmin1
SubsystemReport/Notes
DockerClient=17.05.0-ce Server=17.05.0-ce base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-209/3/artifact/out/Dockerfile
GITHUB PR#209
Optional Testsdupname asflicense javac javadoc unit findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux 8cd95c908978 4.4.0-139-generic #165-Ubuntu SMP Wed Oct 24 10:58:50 UTC 2018 x86_64 GNU/Linux
Build toolmaven
Personality/testptch/patchprocess/precommit/personality/provided.sh
git revisionmaster / 68f14c1
mavenversion: Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T18:33:14Z)
Default Java1.8.0_181
findbugsv3.1.11
checkstylehttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-209/3/artifact/out/diff-checkstyle-hbase-server.txt
unithttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-209/3/artifact/out/patch-unit-hbase-server.txt
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-209/3/testReport/
Max. process+thread count4921 (vs. ulimit of 10000)
modulesC: hbase-server U: hbase-server
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-209/3/console
Powered byApache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

@Apache9

Copy link
Copy Markdown
Contributor

@z-york If S3 does not support atomic rename, then I think there are problems here... Maybe we could see an empty directory when refreshing cache?

@Apache9

Copy link
Copy Markdown
Contributor

Anyway, I think the test here is good. Maybe we can commit the test first, and open new issue to address the atomic rename related problems. In general, I think we'd better not rely on any non-trivial behavior of filesystem so we can build HBase on any possible filesystems. Of course the WAL file system is an exception.

@z-york

Copy link
Copy Markdown
ContributorAuthor

@Apache9 I took a look at the code base and do not think there is an issue with atomic rename here. The issue would be: The snapshotDir exists, but the snapshot info hasn't been copied over which will fail here: https://github.com/apache/hbase/blob/master/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotDescriptionUtils.java#L361 which will throw. refresh cache is called by the RefreshCacheTask (which will clear on IOException), trigger refresh for testing, and getUnreferencedFiles. GetUnreferencedFiles will return no files for deletion if a corruptSnapshotException is thrown and it will be picked up the next time it is ran: https://github.com/apache/hbase/blob/master/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/SnapshotHFileCleaner.java#L70

So I think it is safe.

@z-york

Copy link
Copy Markdown
ContributorAuthor

Anyways, I will merge this for now. Feel free to open a JIRA and tag me if you feel there are other cases this doesn't cover.

@z-york
z-york merged commit 67c937f into apache:masterMay 6, 2019
@z-york
z-york deleted the snapshot branch May 6, 2019 18:52
asfgit pushed a commit that referenced this pull request May 6, 2019
SnapshotFileCache depends on getting the last modified time of the
snapshot directory, however, S3 FileSystem's do not update the
last modified time of the top 'folder' when objects are added/removed.
This commit adds a test for the previously fixed SnapshotFileCache.
asfgit pushed a commit that referenced this pull request May 7, 2019
SnapshotFileCache depends on getting the last modified time of the
snapshot directory, however, S3 FileSystem's do not update the
last modified time of the top 'folder' when objects are added/removed.
This commit adds a test for the previously fixed SnapshotFileCache.
infraio pushed a commit to infraio/hbase that referenced this pull request Aug 17, 2020
…ache#209)
SnapshotFileCache depends on getting the last modified time of the
snapshot directory, however, S3 FileSystem's do not update the
last modified time of the top 'folder' when objects are added/removed.
This commit adds a test for the previously fixed SnapshotFileCache.
stoty pushed a commit to stoty/hbase that referenced this pull request Nov 22, 2025
…pache#209)
* CDPD-71667: Revert "HBASE-24764: Add support of adding default peer configs via hbase-site.xml for all replication peers. (apache#2284)"
This reverts commit 7df1b92.
Change-Id: I2b4570a3ab1bca6c573c669a54ef67008438bd95
* CDPD-71667: Revert "HBASE-24743 Reject to add a peer which replicate to itself earlier (apache#2124)"
This reverts commit 70ab0dc.
Change-Id: I6d508ff3aacf2d48e00f903afe7bca21d34f3247
---------
Co-authored-by: Wellington Ramos Chevreuil <wchevreuil@apache.org>
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

@z-york@Apache-HBase@Apache9@apurtell