charlesconnell commented on code in PR #8792:
URL: https://github.com/apache/hbase/pull/8792#discussion_r4460101013


##########
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:
   I think the main design choices in this PR are:
   - Do you make the quota stuff its own step in this procedure?
   - If so, do you make that step call into a subprocedure?
   
   I'm not saying you should change this from how it is now, necessarily. I'm 
just asking if you could talk through your design choice.



-- 
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]

Reply via email to