unbridled-41 opened a new pull request, #11038:
URL: https://github.com/apache/rocketmq/pull/11038
### Problem / Evidence
`ScheduleMessageService#messageTimeUp` encodes the delivered delay message's
`propertiesString` **before** the internal properties are cleared (encode at
the top of the method, `clearProperty` for `DELAY_TIME_LEVEL` /
`TIMER_DELIVER_MS` / `TIMER_DELAY_SEC` afterwards). `propertiesString` is what
gets persisted in the commitlog and decoded by consumers, so every delay-level
message still carries those internal properties on the wire while the
broker-side property map no longer does — the two disagree, and SQL92 filtering
/ user code see stale internal properties.
This is the exact defect class fixed for the timer-wheel path by #10972
(commit e533b663f, `TimerMessageStore#convertMessage` now encodes after
clearing). The identical pattern in `messageTimeUp` predates it (the 2022-era
unmerged PR #4190 attempted the same cleanup) and was not covered.
Regression test
`ScheduleMessageServiceTest#testMessageTimeUpPropertiesStringMatchesProperties`
fails before the fix (propertiesString contains
`DELAY_TIME_LEVEL`/`TIMER_DELIVER_MS` and differs from re-encoding the cleared
map) and passes after.
### Root cause / Fix
Move the `setPropertiesString(...)` call after the `clearProperty(...)`
calls and encode `msgInner.getProperties()` — mirroring the upstream-accepted
fix in `TimerMessageStore#convertMessage`.
### Priority
PRIORITY = 74:影响 28(延迟消息是核心特性,每条延迟投递消息的线上属性与 broker 端属性不一致,内部属性泄漏给消费者)+ 波及范围
12(单方法,全部延迟消息)+ 可复现性 20(确定性单元测试)+ 维护价值 14(与上游刚合并的 #10972
同类修复,先例明确)。FIX_CONFIDENCE = 95(一行位置调整,镜像上游已接受的同型修复)。
### Tests
- `mvn -pl broker test
-Dtest=ScheduleMessageServiceTest#testMessageTimeUpPropertiesStringMatchesProperties`
- before fix (commit ff8f6f74c + test only): `Tests run: 1, Failures: 1`
(AssertionError at line 298)
- after fix: `Tests run: 1, Failures: 0`
- `mvn -pl broker test -Dtest=ScheduleMessageServiceTest`: `Tests run: 5,
Failures: 0, Errors: 0`
### Risk
Low. The only behavior change is that the persisted `propertiesString` of
delivered delay messages no longer contains the three internal keys — this is
what the property map already said since those lines existed, and matches the
timer-path fix accepted in #10972. Consumers relying on the leaked internal
keys would see them disappear, which is the documented intended behavior.
--
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]