charlesconnell commented on code in PR #8792:
URL: https://github.com/apache/hbase/pull/8792#discussion_r4495733597
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/TruncateTableProcedure.java:
##########
@@ -148,6 +148,14 @@ protected Flow executeFromState(final MasterProcedureEnv
env, TruncateTableState
break;
case TRUNCATE_TABLE_ADD_TO_META:
regions = CreateTableProcedure.addTableToMeta(env, tableDescriptor,
regions);
+ // Reconcile the namespace quota cache with the new region layout
(HBASE-30483).
+ // Replica regions do not count toward the namespace region quota.
This state has no
+ // rollback, so an IOException here makes the procedure retry the
whole state; both
+ // addTableToMeta and the absolute count update are idempotent, so
retrying is safe.
+ int defaultRegionCount =
+ (int)
regions.stream().filter(RegionReplicaUtil::isDefaultReplica).count();
+ ProcedureSyncWait.getMasterQuotaManager(env)
+ .setTableRegionCountForTruncate(getTableName(),
defaultRegionCount);
Review Comment:
Makes sense, thanks
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]