Frun1na opened a new issue, #6083: URL: https://github.com/apache/rocketmq-dashboard/issues/6083
### Before Creating the Bug Report - [x] I have searched the [open issues](https://github.com/apache/rocketmq-dashboard/issues) of this repository and believe that this is not a duplicate. - [x] This is a defect in RocketMQ Studio, not a usage question and not a defect in another Apache RocketMQ repository. - [x] I can reproduce this on the current `rocketmq-studio` branch, or I have stated the exact version I am running below. ### Studio Version branch: `rocketmq-studio` git commit id: `5e4c39b0` deployed as: reproduced with a stubbed Aliyun client in a unit test against that commit ### Runtime Environment OS: Ubuntu on WSL2 MySQL: not applicable — the defect is in the Aliyun cloud catalog paging loop browser (for UI issues): not applicable ### Connected RocketMQ Cluster RocketMQ version: not applicable — the defect is reproduced with a stubbed Aliyun Cloud SDK client access mode: not applicable deployment: ApsaraMQ for RocketMQ 5.x (Aliyun) instance catalog, exercised through `AliyunClientFactory` stubs ### Describe the Bug `AliyunCatalogService.fetchAllInstances` (the implementation behind `listCloudInstances`, used by the "import cloud instance" picker) ends its `ListInstances` paging loop on a page shorter than the requested `PAGE_SIZE` without consulting the `TotalCount` the same response carries: - `AliyunCatalogService.java:140-144` — `if (list.size() < AliyunConverters.PAGE_SIZE || totalCount != null && all.size() >= totalCount || ...) break;` the short-page test is evaluated first, so the scan stops even when `TotalCount` says more instances exist. - The only consistency check present is for a negative `TotalCount` (`AliyunCatalogService.java:137-139`), which a short page does not trigger. With `TotalCount = 2` and a one-row first page the method returns that single instance as the complete catalog, so instances that fall past the truncated page cannot be seen or selected in the UI. The Tencent sibling (`TencentCatalogService.listCloudInstances`) was fixed for exactly this shape in #4529 (`d24f58b8`, `fix(tencent): reject incomplete catalog pages`), which added `isIncompletePage` and fails closed with 502; the Aliyun catalog was not brought to the same shape. ### Steps to Reproduce The defect is pinned by a unit test; no live cloud account is needed: ``` cd server mvn -B -ntp test -DforkCount=1 -Dtest=AliyunCatalogServiceTest ``` `listCloudInstancesShouldRejectIncompletePageWhenTotalCountRequiresMoreTest` stubs a `ListInstances` response with one row and `TotalCount = 2`, and asserts the catalog rejects the contradictory page instead of returning it. Before the fix the single instance is returned and the assertion fails with `Expecting code to raise a throwable.` ### What Did You Expect to See? A short page that contradicts a non-negative `TotalCount` should be rejected (502, "Aliyun instance catalog returned an incomplete page"), the way the Tencent catalog already does it. An empty page must still end the scan so an empty catalog resolves to an empty list, and the existing negative-`TotalCount` rejection must stay. ### What Did You See Instead? `listCloudInstances` returns the short page as the complete cloud instance catalog, so the picker silently hides the remaining instances. ### Additional Context A fix with a regression test follows in a pull request. -- 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]
