zjncs opened a new pull request, #5532:
URL: https://github.com/apache/rocketmq-dashboard/pull/5532

   ## Problem
   
   `AliyunConverters.toTraceRecord` passed the cloud's raw status strings 
straight into `TraceNodeVO.status`:
   
   ```java
   .status(record.getProduceStatus())      // "SUCCESS"
   .status(record.getConsumeStatus())      // "CONSUME_FAIL" / "CONSUME_SUCCESS"
   ```
   
   The frontend `mapTraceNodeStatus` (`web/src/api/message.ts:150`) only 
recognizes **`finish|failed|process|error|wait`** and maps *anything else* to 
`'wait'`. Consequences on an Aliyun instance, all verified by running both ends:
   
   - every trace step renders as **waiting** in the Ant Steps timeline;
   - a **failed consume is graded as a warning** (`WAITING_TRACE_NODE`, score 
−8) instead of critical (`FAILED_TRACE_NODE`, −24), and `failedNodeCount` stays 
**0** — while the consumer-status table on the *same screen* correctly shows 
the failure in red via the `deliveryStatus` mapping (`consumerStatus()`, lines 
325-336) in the same file. The same screen contradicting itself.
   
   The repo itself knows the cloud domain isn't the 5-value set: 
`docs/api-spec.md:1418` documents the passthrough, and the delivery-table path 
normalizes. The Apache provider emits `finish/failed` and Tencent explicitly 
maps into the frontend domain (`toConsumeTraceStatus`, with a comment citing 
it) — **Aliyun is the odd one out**.
   
   ## Fix
   
   Normalize in `toTraceRecord` via `toTraceNodeStatus` — the same 
contains-based mapping already used for `DeliveryStatus` in this file 
(`SUCCESS/OK → finish`, `FAIL → failed`, else `process`), mirroring Tencent's 
`toConsumeTraceStatus`. Applied at all three status sites (producer records, 
no-records consumer summary, consumer records). Broker-operation nodes carry no 
status and are untouched.
   
   ## Verification
   
   New JUnit case `toTraceRecordShouldNormalizeCloudStatusIntoTheTraceDomain` 
(fixtures use the real SDK model shapes):
   
   - **before**: `["SUCCESS", "CONSUME_FAIL", "CONSUME_SUCCESS"]` — raw 
passthrough, the test fails exactly as the UI does (failed → 'wait');
   - **after**: `["finish", "failed", "finish"]` — **2/2 in 
`AliyunConvertersTraceElementsTest`**;
   - **mutation** (revert the converter): back to 1 failed with the passthrough 
evidence; restore: green;
   - regression: `AliyunConvertersLagTest` + `AliyunConvertersMessageKeysTest` 
— **5/5** across the three classes; frontend `messageTraceDiagnostics` suite 
unchanged (the fix is entirely server-side normalization).
   
   Cross-end evidence chain (scout-verified, reproducible): `CONSUME_FAIL` → 
`mapTraceNodeStatus('CONSUME_FAIL')` → `'wait'` vs Apache control `'failed'` → 
`'error'`.


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