[ISSUE #10651] Upgrade DLedger to 0.3.3-SNAPSHOT#10650
Conversation
106f01a to
a64b081
Compare
|
I will change the version number after Dledger releases the version. |
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review by github-manager-bot
Summary
Upgrades DLedger dependency from 0.3.2 to 0.3.3-SNAPSHOT and adapts RocketMQ to the resulting API changes (package reorganization, method renames, removed APIs). Also removes the fastjson v1 dependency in favor of fastjson2.
Findings
-
[Warning]
remoting/src/test/java/.../RemotingSerializableCompatTest.java— ThecheckCompatiblemethod was originally designed to verify cross-version serialization: serialize with fastjson v1, deserialize with fastjson v2. After this change, both serialization and deserialization use fastjson2, so the test no longer validates fastjson v1 → v2 backward compatibility. If backward compatibility with data previously serialized by fastjson v1 is still a concern, consider using pre-serialized JSON string fixtures instead of relying on the fastjson v1 library at runtime. -
[Warning]
store/src/main/java/.../DLedgerCommitLog.java— The newgetCommittedPos()method catchesThrowable, which is overly broad. Consider catchingExceptioninstead to avoid masking JVM-level errors (e.g.,OutOfMemoryError). Additionally, this method performs aDLedgerStorelookup on every call and is invoked from multiple paths (getMaxOffset,truncate,getData). IfgetCommittedIndex()is cheap but the subsequent entry fetch is not, consider documenting the performance characteristics or caching the committed position. -
[Info]
pom.xml— The DLedger version is set to0.3.3-SNAPSHOT. Ensure this SNAPSHOT is published to a reliable Maven repository and that the PR is not merged until DLedger 0.3.3 is officially released (or the SNAPSHOT is stable). -
[Info]
controller/src/main/java/.../DLedgerControllerStateMachine.java— The migration fromCommittedEntryIteratortoApplyEntryIteratorlooks correct. TheApplyEntry.getEntry()call properly retrieves the underlyingDLedgerEntry.
Suggestions
- Consider adding a brief comment on
getCommittedPos()explaining why it was introduced (upstream API removal) to help future maintainers understand the indirection. - The fastjson v1 removal is clean. If this is the last usage of fastjson v1 in the project, consider also removing the
fastjson.versionproperty from the parent POM if it exists.
Automated review by github-manager-bot
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review by github-manager-bot
Summary
Upgrades DLedger from 0.3.2 to 0.3.3-SNAPSHOT, adapting to API changes in the DLedger library. Also removes the legacy fastjson v1 dependency (replaced by fastjson2), and changes how committed position is calculated.
Findings
- [Warning]
pom.xml:125— Using0.3.3-SNAPSHOTfor a production dependency is risky. SNAPSHOT versions are mutable and not suitable for release branches. Ensure this is tracked to be updated to a release version before the next RocketMQ release. - [Warning]
DLedgerCommitLog.java:159-175— The newgetCommittedPos()method derives committed position fromcommittedIndex→ entry lookup →pos + size. This is more indirect than the previousdLedgerFileStore.getCommittedPos(). The catch-allThrowableand returning-1on failure is safe, but consider:- What happens if
committedIndexis valid but the entry has been truncated/compacted? Theget()would return null and-1is returned, which could affect offset calculations. - Performance: this now does an entry lookup on every
getMaxOffset()andtruncate()call. If these are hot paths, consider caching.
- What happens if
- [Info]
DLedgerRoleChangeHandler.java:83—getCommittedIndex()moved fromDLedgerStoretoMemberState. Consistent with the DLedger API refactoring. - [Info]
DLedgerControllerStateMachine.java:55-58—CommittedEntryIterator→ApplyEntryIteratorwithApplyEntry.getEntry()wrapper. Clean adaptation. - [Info]
DLedgerCommitLog.java:101—setEnableBatchPush→setEnableBatchAppend. API rename in DLedger. - [Info] fastjson v1 removal from
common/pom.xmland migration of@JSONFieldannotation to fastjson2 in the compat test. Good cleanup.
Suggestions
- Track the SNAPSHOT → release version upgrade
- Consider adding a brief comment on
getCommittedPos()explaining why the indirect lookup is needed (API change in DLedger 0.3.3)
Verdict
Necessary dependency upgrade with correct API adaptations. The SNAPSHOT version and the new getCommittedPos() implementation are the main concerns.
Automated review by github-manager-bot
Which Issue(s) This PR Fixes
Brief Description
This PR upgrades the DLedger dependency to
0.3.3-SNAPSHOTand adapts RocketMQ to the related API changes:io.openmessaging.storage.dledger.common.setEnableBatchPushwithsetEnableBatchAppend.MemberStateafterDLedgerStore#getCommittedIndex()was removed.ApplyEntryIteratorAPI.DLedgerMmapFileStore#getCommittedPos()was removed.fastjson1dependency and switch the remaining compatibility test usage tofastjson2.How Did You Test This Change?
mvn -DskipTests -Dspotbugs.skip=true compilemvn -DskipTests -Dspotbugs.skip=true test-compilegit diff --check