yyqdbngt opened a new pull request, #2945:
URL: https://github.com/apache/rocketmq-dashboard/pull/2945
## Summary
- `ClusterService.parseFlushDiskType` matched the `FlushDiskType` enum with
a case-sensitive,
whitespace-sensitive `valueOf`, so valid values like `" async_flush "` or
`"Sync_Flush"` were
rejected with a 400 before any broker was touched.
- It now trims and compares case-insensitively against the enum names.
- `buildBrokerPropertyMap` now sends the canonical enum name (e.g.
`ASYNC_FLUSH`) to the broker,
so the broker-side `FlushDiskType.valueOf` accepts the property even when
the client sent a
case variant.
- Genuinely invalid values still fail fast with the same 400 `Invalid
flushDiskType: ...` message.
## Why
The config update/preview endpoints take the flush disk type as a free-form
string. A strict
`valueOf` makes the API brittle to casing and padding that is otherwise
irrelevant, and without
canonicalizing the property value a lenient parse would forward a value the
broker itself
rejects, leaving preview and update inconsistent with what the broker
applies.
## Testing
- `mvn -Dtest=ClusterServiceTest test`: Tests run: 41, Failures: 0, Errors:
0, Skipped: 0.
- New tests
`updateConfigShouldAcceptCaseAndWhitespaceInsensitiveFlushDiskType` and
`previewConfigShouldNormalizeFlushDiskTypeForBrokerProperty` verified to
fail on the unfixed
code with `BusinessException: Invalid flushDiskType: async_flush ` (Tests
run: 2, Errors: 2).
--
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]