gavinchou commented on PR #61845:
URL: https://github.com/apache/doris/pull/61845#issuecomment-4147650563
## Review: Cloud Mode Not Handled
**Critical Bug: Cloud mode not handling partition near-limit metrics**
The PR changes only update `TabletStatMgr.java`, but
**`CloudTabletStatMgr.java` is missing the same changes**. In cloud mode, Doris
uses `CloudTabletStatMgr` instead of `TabletStatMgr` (see
`CloudEnvFactory.java:198-199`).
### The Issue
`CloudTabletStatMgr.updateStatInfo()` (lines 156-334) has nearly identical
logic to `TabletStatMgr.runAfterCatalogReady()`, but it is missing:
1. **Counter variables** (lines 131-132 in TabletStatMgr):
```java
long autoPartitionNearLimitCount = 0L;
long dynamicPartitionNearLimitCount = 0L;
```
2. **Partition limit check logic** (lines 167-181 in TabletStatMgr):
```java
int tablePartitionNum = allPartitions.size();
partitionCount += tablePartitionNum;
// Check if this table's partition count is near the limit (>80%)
if (olapTable.getPartitionInfo().enableAutomaticPartition()) {
int limit = Config.max_auto_partition_num;
if (tablePartitionNum > limit * 8L / 10) {
autoPartitionNearLimitCount++;
}
}
if (olapTable.dynamicPartitionExists()
&&
olapTable.getTableProperty().getDynamicPartitionProperty().getEnable()) {
int limit = Config.max_dynamic_partition_num;
if (tablePartitionNum > limit * 8L / 10) {
dynamicPartitionNearLimitCount++;
}
}
```
3. **Gauge metric updates** (lines 314-315 in TabletStatMgr):
```java
MetricRepo.GAUGE_AUTO_PARTITION_NEAR_LIMIT.setValue(autoPartitionNearLimitCount);
MetricRepo.GAUGE_DYNAMIC_PARTITION_NEAR_LIMIT.setValue(dynamicPartitionNearLimitCount);
```
### Impact
- **Non-cloud mode**: Metrics work correctly (updated by `TabletStatMgr`)
- **Cloud mode**: Metrics stay at 0 forever (never updated by
`CloudTabletStatMgr`)
This defeats the purpose of the PR for cloud deployments, as users cannot
monitor tables approaching partition limits.
### Fix Required
Apply the same changes to `CloudTabletStatMgr.updateStatInfo()`:
- Add the counter variables
- Add the partition limit check logic inside the table iteration loop
- Add the gauge metric updates before the logging statement
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]