-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-22146 SpaceQuotaViolationPolicy Disable is not working in Names… #1935
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
Changes from all commits
3720342
5805f27
e2ba125
d1874e3
69e7e89
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -266,6 +266,14 @@ private static void deleteQuotas(final Connection connection, final byte[] rowKe | |
| if (qualifier != null) { | ||
| delete.addColumns(QUOTA_FAMILY_INFO, qualifier); | ||
| } | ||
| if (isNamespaceRowKey(rowKey)) { | ||
| String ns = getNamespaceFromRowKey(rowKey); | ||
| Quotas namespaceQuota = getNamespaceQuota(connection,ns); | ||
| if (namespaceQuota != null && namespaceQuota.hasSpace()) { | ||
| // When deleting namespace space quota, also delete table usage(u:p) snapshots | ||
| deleteTableUsageSnapshotsForNamespace(connection, ns); | ||
| } | ||
| } | ||
| doDelete(connection, delete); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What would happen if we get an exception trying to delete a quota? Would it be necessary to retry the operation again?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Thanks for reviewing Esteban. I am doing null checks everywhere to avoid NPEs. I tested this code with a namespace quota on a namespace both without any tables, and with tables and the code worked fine. I see that in line 282 connection.getAdmin().listTableNamesByNamespace(ns) can throw IOException. I can add try-catch around my new code to avoid the final doDelete() for the namespace getting impacted from any exception in the new code.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I checked more usages of this method and other files where getAdmin().listTableNamesByNamespace(ns) is used and in case of error they let the calling method handle it and allow the user to decide to retry the operation. The call for deleteQuotas() also mentions about throwing IOException like other methods: |
||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.