You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Apache9 (via GitHub)" <gi...@apache.org> on 2023/09/22 13:25:17 UTC
[GitHub] [hbase] Apache9 commented on a diff in pull request #5426: HBASE-28105 NPE in QuotaCache if Table is dropped from cluster
Apache9 commented on code in PR #5426:
URL: https://github.com/apache/hbase/pull/5426#discussion_r1334378481
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaCache.java:
##########
@@ -371,19 +371,21 @@ private void updateQuotaFactors() {
// Update table machine quota factors
for (TableName tableName : tableQuotaCache.keySet()) {
- double factor = 1;
- try {
- long regionSize = tableRegionStatesCount.get(tableName).getOpenRegions();
- if (regionSize == 0) {
- factor = 0;
- } else {
- int localRegionSize = rsServices.getRegions(tableName).size();
- factor = 1.0 * localRegionSize / regionSize;
+ if (tableRegionStatesCount.containsKey(tableName)) {
Review Comment:
Are we under a lock here? Otherwise it is still possible that when testing containsKey, the map returns false but then the kv pair is removed from the map and cause NPE below...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org