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

Backport HBASE-23553 to branch-2.1 #1230

Closed
wants to merge 3 commits into from

Conversation

karthikhw
Copy link
Contributor

HBASE-23553 Snapshot referenced data files are deleted in some case

HBASE-23553 Snapshot referenced data files are deleted in some case
@Apache-HBase

This comment has been minimized.

@busbey
Copy link
Contributor

busbey commented Mar 1, 2020

Are you sure the test still has coverage for the issue in HBASE-23553?

If I apply the changes locally the test passes with and without the relevant changes to SnapshotReferenceUtil.

Copy link
Member

@joshelser joshelser left a comment

Choose a reason for hiding this comment

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

Looks good overall. Need to look at Yi Mei's original patch, too.

Nice work Karthik.

Path rootDir = UTIL.getHBaseCluster().getMaster().getMasterFileSystem().getRootDir();
long timeout = 20000; // 20s
try (Admin admin = UTIL.getAdmin()) {
List<String> serverList = admin.getRegionServers().stream().map(sn -> sn.getServerName())
Copy link
Member

Choose a reason for hiding this comment

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

Unused

return false;
}
});
// run catalog janitor to clean and wait for parent regions are archived
Copy link
Member

Choose a reason for hiding this comment

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

Nit: IIRC, we call the input to a merge the "daughters" of a merge which come together to make one "parent". It's like split (e.g one parent, two daughters), but in reverse.

}
});
// set file modify time and then run cleaner
long time = System.currentTimeMillis() - TimeToLiveHFileCleaner.DEFAULT_TTL * 1000;
Copy link
Member

Choose a reason for hiding this comment

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

Can we pull the actual TTL out of the configuration instead of relying on this default ttl variable?

} catch (Exception e) {
LOG.error("scan snapshot error", e);
Assert.fail("Should not throw FileNotFoundException");
Assert.assertTrue(e.getCause() != null);
Copy link
Member

Choose a reason for hiding this comment

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

Dead code here.

}
} catch (Exception e) {
LOG.error("scan snapshot error", e);
Assert.fail("Should not throw FileNotFoundException");
Copy link
Member

Choose a reason for hiding this comment

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

Don't you really want to make sure just the TableSnapshotScanner doesnt' throw a FileNotFoundException? Like, maybe lift this catch up into that try block specifically?

@busbey
Copy link
Contributor

busbey commented Mar 2, 2020

note for committers if I'm not the one who pushes this, the following commit message should be used:

    HBASE-23553 Snapshot referenced data files are deleted in some case
    
    Backport to branch-2.1 via HBASE-23915 by Karthik P. Differs from
    original by skipping test-only need for the "turn compaction on/off"
    feature.
    Closes #1230
    
    Co-authored-by: Karthik Palanisamy <kpalanisamy@hortonworks.com>

Karthik I used the email address associated with your github account above. let us know if you'd prefer a different one.

@karthikhw
Copy link
Contributor Author

karthikhw commented Mar 2, 2020

Sorry @joshelser. Its my bad! I simply back-ported theses changes, just only excluding compactionSwitch in the code. I should have done review before committing. Pls review the latest commit.

||Are you sure the test still has coverage for the issue in HBASE-23553?
Yes @busbey This test covers HBASE-23553.

Usually, we don't need compactionSwitch in this test case, as we know it never triggers compaction since it only loads less data with no manual compaction and only an individual test.

Copy link
Member

@joshelser joshelser left a comment

Choose a reason for hiding this comment

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

I think this is fine by me.

Do you want to take a look, @busbey ?

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 2m 28s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+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.
_ branch-2.1 Compile Tests _
+1 💚 mvninstall 7m 30s branch-2.1 passed
+1 💚 compile 1m 13s branch-2.1 passed
+1 💚 checkstyle 1m 41s branch-2.1 passed
+1 💚 shadedjars 5m 1s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 47s branch-2.1 passed
+0 🆗 spotbugs 3m 29s Used deprecated FindBugs config; considering switching to SpotBugs.
+1 💚 findbugs 3m 27s branch-2.1 passed
_ Patch Compile Tests _
+1 💚 mvninstall 6m 20s the patch passed
+1 💚 compile 1m 16s the patch passed
+1 💚 javac 1m 16s the patch passed
+1 💚 checkstyle 1m 42s the patch passed
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 shadedjars 5m 7s patch has no errors when building our shaded downstream artifacts.
+1 💚 hadoopcheck 27m 4s Patch does not cause any errors with Hadoop 2.7.7 2.8.5 or 3.0.3 3.1.2.
+1 💚 javadoc 0m 43s the patch passed
+1 💚 findbugs 3m 28s the patch passed
_ Other Tests _
-1 ❌ unit 250m 37s hbase-server in the patch failed.
+1 💚 asflicense 0m 28s The patch does not generate ASF License warnings.
326m 55s
Reason Tests
Failed junit tests hadoop.hbase.replication.TestReplicationDisableInactivePeer
hadoop.hbase.replication.TestReplicationSmallTests
hadoop.hbase.replication.TestReplicationKillSlaveRS
hadoop.hbase.replication.TestReplicationKillSlaveRSWithSeparateOldWALs
hadoop.hbase.replication.regionserver.TestRegionReplicaReplicationEndpoint
hadoop.hbase.regionserver.TestSplitTransactionOnCluster
Subsystem Report/Notes
Docker Client=19.03.6 Server=19.03.6 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1230/2/artifact/out/Dockerfile
GITHUB PR #1230
Optional Tests dupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
uname Linux 047a8be2e5b1 4.15.0-74-generic #84-Ubuntu SMP Thu Dec 19 08:06:28 UTC 2019 x86_64 GNU/Linux
Build tool maven
Personality /home/jenkins/jenkins-slave/workspace/Base-PreCommit-GitHub-PR_PR-1230/out/precommit/personality/provided.sh
git revision branch-2.1 / 5b3e59e
Default Java 1.8.0_181
unit https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1230/2/artifact/out/patch-unit-hbase-server.txt
Test Results https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1230/2/testReport/
Max. process+thread count 4805 (vs. ulimit of 10000)
modules C: hbase-server U: hbase-server
Console output https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1230/2/console
versions git=2.11.0 maven=2018-06-17T18:33:14Z) findbugs=3.1.11
Powered by Apache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@busbey
Copy link
Contributor

busbey commented Mar 3, 2020

If there's test coverage then how do I run a unit test to get a failure prior to the fix?

On the original backport I applied just the test changes and then ran those tests. They passed. What am I missing?

Copy link
Contributor

@busbey busbey left a comment

Choose a reason for hiding this comment

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

I grabbed things as of 7055189 and now I get a failure of the new test without the fix as expected.

I'll go ahead and merge. Thanks @karthikhw and thanks @joshelser for the additional review.

asfgit pushed a commit that referenced this pull request Mar 3, 2020
Backport to branch-2.1 via HBASE-23915 by Karthik P. Differs from
original by skipping test-only need for the "turn compaction on/off"
feature.
Closes #1230

Co-authored-by: Karthik Palanisamy <kpalanisamy@hortonworks.com>
Signed-off-by: Josh Elser <elserj@apache.org>
Signed-off-by: Sean Busbey <busbey@apache.org>
@busbey busbey closed this Mar 3, 2020
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.

5 participants