Details
Description
In SnapshotManager#restoreSnapshot, the table and region quota will be checked and updated as:
try { // Table already exist. Check and update the region quota for this table namespace checkAndUpdateNamespaceRegionQuota(manifest, tableName); restoreSnapshot(snapshot, snapshotTableDesc); } catch (IOException e) { this.master.getMasterQuotaManager().removeTableFromNamespaceQuota(tableName); LOG.error("Exception occurred while restoring the snapshot " + snapshot.getName() + " as table " + tableName.getNameAsString(), e); throw e; }
The 'checkAndUpdateNamespaceRegionQuota' will fail if regions in the snapshot make the region count quota exceeded, then, the table will be removed in the 'catch' block. This will make the current table count and region count decrease, following table creation or region split will succeed even if the actual quota is exceeded.