You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "zjncs (via GitHub)" <gi...@apache.org> on 2026/10/03 13:27:40 UTC
[PR] fix(web): recognize all three backend consistency value domains [rocketmq-dashboard]
zjncs opened a new pull request, #5499:
URL: https://github.com/apache/rocketmq-dashboard/pull/5499
## Defect
`SubscriptionEntry.consistency` is a **free-form string** produced by three different backend converters, and the frontend only understood one of them (plus the mock values):
| Producer | Value form | Evidence |
|---|---|---|
| Apache (`RocketMQMetadataProvider`) | `consistent` / `inconsistent` / null | `RocketMQMetadataProvider.java:758` |
| Aliyun (`AliyunConverters`) | `String.valueOf(Boolean)` → `true` / `false` | `AliyunConverters.java:223`; `AliyunConvertersTest.java:48` asserts `.consistency(true)` |
| Tencent (`TencentInstanceProvider`) | `String.valueOf(Long)` → `1` / `0` | `TencentInstanceProvider.java:1036`; `TencentInstanceProviderTest.java:693` asserts `setConsistency(0L)` |
The frontend checks in `consumerGroupDiagnostics.ts:123-127` and `consumer.tsx:167-171` only matched `['consistent', '一致']` / `['inconsistent', '不一致']`. On an Aliyun or Tencent instance every subscription therefore fell into `SUBSCRIPTION_UNKNOWN` (warning, −12 health points each), and **a genuine inconsistency (`false` / `0`) never escalated to `SUBSCRIPTION_INCONSISTENT` (critical)** — the most important signal the health check exists to raise. The tag color mapping additionally displayed the raw `true` / `0` strings.
Verified on master with vitest: `analyzeConsumerGroupHealth` with `consistency: 'false'` produces `SUBSCRIPTION_UNKNOWN`, not `SUBSCRIPTION_INCONSISTENT`.
## Fix
Add all three value domains (`true`/`false`, `1`/`0`) to the consistent/inconsistent buckets in **both** copies of the check (the diagnostics util and the consumer page, which has its own local copy for the tag colors).
## Tests
New `web/src/utils/__tests__/consistencyDomains.test.ts` (6 cases, driving the real `analyzeConsumerGroupHealth` signature):
- `'true'` → no subscription issue (failed on master: SUBSCRIPTION_UNKNOWN)
- `'false'` → SUBSCRIPTION_INCONSISTENT **critical** (failed on master: SUBSCRIPTION_UNKNOWN warning)
- `'1'` → consistent; `'0'` → critical inconsistent (both failed on master)
- `'consistent'` / `'inconsistent'` controls unchanged; `'later'` still SUBSCRIPTION_UNKNOWN
Verification: fail-before (4 failed) → pass-after (6/6) → mutation (reverting the diagnostics value lists) → 4 failures return → existing `consumerGroupDiagnostics.test.ts` stays green (36/36).
## Collision check
No open PR touches `consumerGroupDiagnostics.ts` or the consistency checks in `consumer.tsx`. #5198 (mine, open) touches `consumer.tsx` in the subscription-verdict refresh area — different lines, no overlapping hunks.
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(web): recognize all three backend consistency value domains [rocketmq-dashboard]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins closed pull request #5499: fix(web): recognize all three backend consistency value domains
URL: https://github.com/apache/rocketmq-dashboard/pull/5499
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(web): recognize all three backend consistency value domains [rocketmq-dashboard]
Posted by "zjncs (via GitHub)" <gi...@apache.org>.
zjncs commented on PR #5499:
URL: https://github.com/apache/rocketmq-dashboard/pull/5499#issuecomment-6082835487
Thank you for the correction — all three points taken: my line numbers were from a pre-#4884 snapshot, the Tencent polarity is inverted relative to `fromCode` (0 = consistent), and the test count I quoted was from the wrong tree. With `SubscriptionConsistency` owning the vocabulary on trunk, no resubmission from me; closing this out was right.
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(web): recognize all three backend consistency value domains [rocketmq-dashboard]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins commented on PR #5499:
URL: https://github.com/apache/rocketmq-dashboard/pull/5499#issuecomment-6076050044
This one is already fixed on the trunk, in the opposite direction. #4884 (3b9e35fe4, 2026-09-24)
added common/util/SubscriptionConsistency, so AliyunConverters:235 and TencentInstanceProvider:1076
now emit "consistent"/"inconsistent"/null and never leak true/false or 0/1 - its javadoc states
that the studio vocabulary "is the only vocabulary the console understands" and that cloud
providers must translate rather than leak. Your cited line numbers (AliyunConverters:223,
TencentInstanceProvider:1036, RocketMQMetadataProvider:758) are from a pre-#4884 snapshot, and
the test assertions you quote (.consistency(true), setConsistency(0L)) are SDK inputs, not outputs.
Note also that your mapping is inverted relative to fromCode: Tencent 0 means consistent and 1
means inconsistent, while you put '1' in CONSISTENT_VALUES. Finally, consumerGroupDiagnostics.test.ts
has 4 tests, not 36 - please re-verify against apache/rocketmq-studio before resubmitting.
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org