Skip to content

HBASE-23176 delete_all_snapshot does not work with regex - #725

Merged
guangxuCheng merged 4 commits into
apache:masterfrom
karthikhw:HBASE-23176
Oct 17, 2019
Merged

HBASE-23176 delete_all_snapshot does not work with regex#725
guangxuCheng merged 4 commits into
apache:masterfrom
karthikhw:HBASE-23176

Conversation

@karthikhw

Copy link
Copy Markdown
Contributor

Delete_all_snapshot.rb is using deprecated method SnapshotDescription#getTable but this method is already removed in 3.0.x.

@karthikhw

karthikhw commented Oct 15, 2019

Copy link
Copy Markdown
ContributorAuthor

I am really not sure if we need testcase. I added general test case for this issue. Just realized, similar testcase exists already.

Testcase will pass even without this fix. The reason I could not add testcase because delete_all_snapshot.rb#command(regex) accept only one argument and second argument will get it from user ('y/n') at runtime, for confirming delete.

But here I don't think I can pass argument at runtime.

@karthikhw

Copy link
Copy Markdown
ContributorAuthor

I tried passing args at runtime but test case hungs ever. I don't think we need test case for init script.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
💙reexec6m 29sDocker mode activated.
_ Prechecks _
💚dupname0m 0sNo case conflicting files found.
💚@author0m 0sThe patch does not contain any @author tags.
💚test4tests0m 0sThe patch appears to include 1 new or modified test files.
_ master Compile Tests _
💚mvninstall6m 37smaster passed
💚javadoc0m 15smaster passed
_ Patch Compile Tests _
💚mvninstall6m 6sthe patch passed
💚rubocop0m 9sThere were no new rubocop issues.
💚whitespace0m 0sThe patch has no whitespace issues.
💚javadoc0m 15sthe patch passed
_ Other Tests _
💔unit13m 44shbase-shell in the patch failed.
💚asflicense0m 13sThe patch does not generate ASF License warnings.
35m 6s
ReasonTests
Failed junit testshadoop.hbase.client.TestAdminShell
SubsystemReport/Notes
DockerClient=19.03.2 Server=19.03.2 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-725/1/artifact/out/Dockerfile
GITHUB PR#725
Optional Testsdupname asflicense javac javadoc unit rubocop
unameLinux bf49f0f4e578 4.15.0-65-generic #74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-725/out/precommit/personality/provided.sh
git revisionmaster / 7924ba3
Default Java1.8.0_181
unithttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-725/1/artifact/out/patch-unit-hbase-shell.txt
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-725/1/testReport/
Max. process+thread count2680 (vs. ulimit of 10000)
modulesC: hbase-shell U: hbase-shell
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-725/1/console
versionsgit=2.11.0 maven=2018-06-17T18:33:14Z) rubocop=0.75.1
Powered byApache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.

@karthikhw

Copy link
Copy Markdown
ContributorAuthor

Removed this test-case, as similar functionality test exist already.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
💙reexec0m 0sDocker mode activated.
💔docker0m 1sDocker failed to build yetus/hbase:1cb4f687c1.
SubsystemReport/Notes
GITHUB PR#725
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-725/2/console
versionsgit=2.17.1
Powered byApache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
💙reexec1m 8sDocker mode activated.
_ Prechecks _
💚dupname0m 0sNo case conflicting files found.
💚@author0m 0sThe patch does not contain any @author tags.
💚test4tests0m 0sThe patch appears to include 1 new or modified test files.
_ master Compile Tests _
💚mvninstall6m 11smaster passed
💚javadoc0m 14smaster passed
_ Patch Compile Tests _
💚mvninstall5m 34sthe patch passed
💚rubocop0m 9sThere were no new rubocop issues.
💚whitespace0m 0sThe patch has no whitespace issues.
💚javadoc0m 12sthe patch passed
_ Other Tests _
💚unit10m 23shbase-shell in the patch passed.
💚asflicense0m 13sThe patch does not generate ASF License warnings.
25m 0s
SubsystemReport/Notes
DockerClient=19.03.3 Server=19.03.3 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-725/3/artifact/out/Dockerfile
GITHUB PR#725
Optional Testsdupname asflicense javac javadoc unit rubocop
unameLinux b4b1bb25dfbe 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-725/out/precommit/personality/provided.sh
git revisionmaster / 7924ba3
Default Java1.8.0_181
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-725/3/testReport/
Max. process+thread count2630 (vs. ulimit of 10000)
modulesC: hbase-shell U: hbase-shell
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-725/3/console
versionsgit=2.11.0 maven=2018-06-17T18:33:14Z) rubocop=0.75.1
Powered byApache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.

@guangxuCheng

Copy link
Copy Markdown
Member

formatter.row([snapshot.getName,snapshot.getTable + ' (' + creation_time + ')'])

Also need to be modified here

@karthikhw

Copy link
Copy Markdown
ContributorAuthor

Thank you very much @guangxuCheng for checking this. There are 3 commits here, the first commit changes for delete_all_snapshot.rb.

@guangxuCheng

guangxuCheng commented Oct 17, 2019

Copy link
Copy Markdown
Member

defcommand(regex)
formatter.header(['SNAPSHOT','TABLE + CREATION TIME'])
list=admin.list_snapshot(regex)
count=list.size
list.eachdo |snapshot|
creation_time=Time.at(snapshot.getCreationTime / 1000).to_s
formatter.row([snapshot.getName,snapshot.getTable + ' (' + creation_time + ')'])
end
puts"\nDelete the above #{count} snapshots (y/n)?"unlesscount == 0
answer='n'
answer=gets.chompunlesscount == 0
puts"No snapshots matched the regex #{regex}"ifcount == 0
returnunlessanswer =~ /y.*/i
@start_time=Time.now
admin.delete_all_snapshot(regex)
@end_time=Time.now
list=admin.list_snapshot(regex)
leftOverSnapshotCount=list.size
successfullyDeleted=count - leftOverSnapshotCount
puts"#{successfullyDeleted} snapshots successfully deleted."unlesssuccessfullyDeleted == 0
returnifleftOverSnapshotCount == 0
puts"\nFailed to delete the below #{leftOverSnapshotCount} snapshots."
formatter.header(['SNAPSHOT','TABLE + CREATION TIME'])
list.eachdo |snapshot|
creation_time=Time.at(snapshot.getCreationTime / 1000).to_s
formatter.row([snapshot.getName,snapshot.getTable + ' (' + creation_time + ')'])
end
end

@karthikhw There are two places in delete_all_snapshot.rb (L37 and L56) that need to be modified, but you only modified one of them.

@karthikhw

Copy link
Copy Markdown
ContributorAuthor

Thank you @guangxuCheng highlighting missing one. Sorry, I somehow missed it.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
💙reexec1m 11sDocker mode activated.
_ Prechecks _
💚dupname0m 0sNo case conflicting files found.
💚@author0m 0sThe patch does not contain any @author tags.
💚test4tests0m 0sThe patch appears to include 1 new or modified test files.
_ master Compile Tests _
💚mvninstall6m 52smaster passed
💚javadoc0m 14smaster passed
_ Patch Compile Tests _
💚mvninstall5m 29sthe patch passed
💚rubocop0m 10sThere were no new rubocop issues.
💚whitespace0m 0sThe patch has no whitespace issues.
💚javadoc0m 13sthe patch passed
_ Other Tests _
💚unit10m 17shbase-shell in the patch passed.
💚asflicense0m 13sThe patch does not generate ASF License warnings.
25m 35s
SubsystemReport/Notes
DockerClient=19.03.3 Server=19.03.3 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-725/4/artifact/out/Dockerfile
GITHUB PR#725
Optional Testsdupname asflicense javac javadoc unit rubocop
unameLinux f34471f58eee 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-725/out/precommit/personality/provided.sh
git revisionmaster / 0043dfe
Default Java1.8.0_181
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-725/4/testReport/
Max. process+thread count2621 (vs. ulimit of 10000)
modulesC: hbase-shell U: hbase-shell
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-725/4/console
versionsgit=2.11.0 maven=2018-06-17T18:33:14Z) rubocop=0.75.1
Powered byApache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.

@guangxuChengguangxuCheng left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1

@guangxuCheng
guangxuCheng merged commit 0f910f0 into apache:masterOct 17, 2019
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.

3 participants

@karthikhw@Apache-HBase@guangxuCheng