d-wang-commit opened a new pull request, #19132:
URL: https://github.com/apache/iotdb/pull/19132

   ## Description
   
   When a node enters read-only mode, the exception message is copied into its 
status reason. A message such as `disk\r\n\t  write failed` splits a row of 
`SHOW CLUSTER` across two lines, and indentation can consume the message limit 
before useful text is reached.
   
   Collapse whitespace and control characters to a single space before applying 
the existing 256 UTF-16 unit limit. Keep the exception class name when the 
message has no visible text. Append `...` only if text is omitted, and keep 
surrogate pairs intact. Also normalize reasons received from older nodes or 
restored from persisted state, so all consumers of the node statistics see a 
single line.
   
   ### Tests
   
   - UT: updated `CommonConfigTest` for multiline and blank messages, exact-fit 
and over-limit messages, and a supplementary character at the cutoff. Added a 
`NodeCacheTest` case for recovery and a subsequent legacy heartbeat. All 23 
tests in these classes passed in the full reactor; test compilation also passed 
with `-Pwith-zh-locale`.
   - Reproduced the multiline output with the previous implementation. With a 
synthetic RPC response, verified identical single-line values from the result 
builders for `SHOW CLUSTER`, `SHOW CLUSTER DETAILS`, `SHOW CONFIGNODES`, `SHOW 
DATANODES`, and `information_schema.nodes`.
   - IT: no cluster integration test was added or run.
   
   ### Side effects and risks
   
   Whitespace in the displayed error is no longer verbatim. Original exceptions 
and their stack traces are unchanged. Content already truncated by an older 
node cannot be recovered. The producer bounds the output buffer; status 
priorities, other reason types and RPC layouts are unchanged.
   
   <hr>
   
   This PR has:
   - [x] been self-reviewed.
   - [x] added unit tests or modified existing tests to cover new code paths.
   
   <hr>
   
   ##### Key changed/added classes (or packages if there are too many classes) 
in this PR
   
   - `UnrecoverableErrorStatusReason` formats exception text and normalizes 
previously reported reasons.
   - `CommonConfig` uses the formatter when recording an unrecoverable error; 
`NodeStatistics` applies normalization to incoming and recovered reasons.
   


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