ai-yang opened a new pull request, #10814: URL: https://github.com/apache/rocketmq/pull/10814
### Which Issue(s) This PR Fixes - Fixes #10813 ### Brief Description This PR reduces temporary allocation in the LMQ append path without changing public APIs or the persisted message format. - Build `PROPERTY_INNER_MULTI_QUEUE_OFFSET` with `StringBuilder.append(long)` instead of a boxed `Long[]` plus `StringUtils.join`. - Parse the multi-dispatch queue names once on a normal append and reuse them when increasing LMQ offsets. - Serialize the message properties once on the normal path while preserving the legacy `WAIT_STORE_MSG_OK` property order and exact encoded bytes. - Keep the mapped-file `END_OF_FILE` retry safe: offsets are increased only after a successful physical append and never twice. - Preserve the public `LmqDispatch` methods and existing RocksDB/generic consume-queue exception mapping. #### Compatibility There are no public API, configuration, protocol, or persistence-format changes. Mixed LMQ/non-LMQ queues, disabled LMQ, `WAIT_STORE_MSG_OK`, and encoded retry behavior remain compatible. #### Performance Paired JMH results on `develop` at `2daf0e2ca91a1592d18235d43e5d709d1c35d15f`: | LMQ queues | Baseline B/op | This PR B/op | Saved B/op | Saved | Median paired throughput change | | ---: | ---: | ---: | ---: | ---: | ---: | | 1 | 1376.000 | 704.000 | 672.000 | 48.837% | +63.107% | | 4 | 3016.001 | 1536.000 | 1504.000 | 49.867% | +82.696% | Environment: OpenJDK 8u492, JMH 1.36, Linux x86_64, Intel Xeon Gold 6133. Five independent alternating baseline-to-patched pairs were run. Each variant used one fork per pair, five 1-second warmup iterations, ten 1-second measurement iterations, throughput mode, and `-prof gc`. Allocation decreased in 5/5 pairs for both queue counts; the minimum reduction was 648 B/op. Throughput improved in every pair, with a minimum paired gain of 46.723%. ### How Did You Test This Change? All Maven gates used JDK 8. - `LmqDispatchTest`: 20 independent Maven/Surefire processes, 100/100 tests passed, 0 failures/errors/skips. - `mvn -DskipITs -pl store -am test`: BUILD SUCCESS; 733 tests, 0 failures/errors, 4 existing skips. - `mvn -DskipITs -pl '!namesrv' package`: all 18 selected reactor modules SUCCESS in 42:07, including store (318 tests), broker, controller (72 tests), proxy (303 tests, 3 existing skips), and container. - The host already had an unrelated process bound to namesrv port 9876. On the same baseline SHA, an isolated `mvn -DskipITs -pl namesrv package` passed 116/116 tests. The patched tree also passed namesrv package with tests skipped, Checkstyle 0, and SpotBugs 0. This PR only changes store, which is outside the namesrv dependency graph. - Affected-reactor Checkstyle: 0 violations. - Affected-reactor SpotBugs: `BugInstance=0`, `Error=0`. - `mvn -DskipTests apache-rat:check`: all 19 reactor modules SUCCESS, 0 unapproved/unknown files. - `git diff --check`: passed. Regression coverage includes mixed queue names, disabled LMQ, exact legacy property bytes, successful append, `END_OF_FILE` retry, exactly-once offset increments, RocksDB failure mapping, and generic consume-queue failure mapping. -- 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]
