qianye1001 opened a new issue, #11535: URL: https://github.com/apache/rocketmq/issues/11535
### Runtime platform environment Reproduced with real RocksDB stores on macOS arm64. ### RocketMQ version `develop` at `28960fd2f795a6903665c3d6c037501059df0760`. ### JDK Version OpenJDK 21. ### Describe the Bug `RocksDBTopicConfigManager.persist()` only flushes WAL. Broker permission updates in `AdminBrokerProcessor` and role/epoch changes in `ReplicasManager` can directly call `getDataVersion().nextVersion(...)`, modifying only the Java object. Without a later operation that writes the version record, even a graceful shutdown loses that increment and the associated state version. Related: #10604 addressed another direct version increment in the split-registration path. The remaining callers and the persistence contract still allow this restart regression. ### Steps to Reproduce 1. Load a `RocksDBTopicConfigManager` in a temporary store directory. 2. Create a topic with `updateTopicConfig(...)`, persisting version counter 1. 3. Call `manager.getDataVersion().nextVersion(42L)`, as the role-change path does. The in-memory counter is now 2 and stateVersion is 42. 4. Call `manager.persist()` and `manager.stop()`. 5. Create and load a new manager using the same directory. ### What Did You Expect to See? The reopened manager retains the counter, timestamp and stateVersion passed to `persist()`. Persisting repeatedly should not itself increment the version. ### What Did You See Instead? A disk-backed regression test fails with `expected:<2> but was:<1>` after reopening the store. Flushing WAL cannot persist a version that was never written to RocksDB. ### Suggested Fix Write the current version record before the existing optional WAL flush in `RocksDBTopicConfigManager.persist()`, preserving all version fields. Cover both separate and unified RocksDB storage and both values of `realTimePersistRocksDBConfig`. -- 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]
