branch-4.0: [opt](memory) Remove unused dbId field from CloudReplica #62079#62597
branch-4.0: [opt](memory) Remove unused dbId field from CloudReplica #62079#62597dataroaring wants to merge 1 commit intoapache:branch-4.0from
Conversation
- Remove the `dbId` field and its `@SerializedName` from `CloudReplica`, saving 8 bytes per replica object - No external callers read `dbId` from CloudReplica — all callers use `TabletMeta.getDbId()` via the inverted index instead - Constructor parameter is kept for source compatibility but the value is no longer stored - Gson silently ignores unknown keys when deserializing old images, so backward compatibility is maintained -8 bytes/replica. At 10M replicas: ~76 MB saved. At 100M replicas: ~763 MB saved. - [ ] Existing cloud tests pass (`mvn test -pl fe/fe-core -Dtest="*Cloud*"`) - [ ] Gson backward compatibility: old-format JSON with "dbId" key deserializes without errors (silently ignored) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> (cherry picked from commit 186a53e) Generated by ThinkOps
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
There was a problem hiding this comment.
Pull request overview
Backports an optimization from master to reduce FE memory usage by removing the unused dbId state from CloudReplica (a persisted/serialized metadata object in cloud mode).
Changes:
- Removes the
dbIdfield (and its@SerializedName) fromCloudReplica. - Removes the constructor assignment to
dbId. - Removes the
getDbId()getter fromCloudReplica.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -562,10 +559,6 @@ public boolean checkVersionCatchUp(long expectedVersion, boolean ignoreAlter) { | |||
| return true; | |||
| } | |||
|
|
|||
There was a problem hiding this comment.
CloudReplica#getDbId() was removed, but there are still call sites on this branch that use it (e.g. CloudTabletRebalancer calls cloudReplica.getDbId() when looking up the database and building UpdateCloudReplicaInfo). This change will break compilation and/or runtime behavior unless those callers are migrated to obtain dbId from TabletMeta/TabletInvertedIndex (or the dbId getter/field is kept for this branch).
| public long getDbId() { | |
| return dbId; | |
| } |
pick #62079
Conflict resolution
Trivial conflict on line 63 of
CloudReplica.java:primaryClusterToBackend = new ConcurrentHashMap<>()(from a separate PR)= nullResolution: kept branch-4.0's
= nullinitialization unchanged, and only applied this PR's scope (removing thedbIdfield, constructor assignment, andgetDbId()getter). No CloudReplica callers ofgetDbId()exist on branch-4.0.🤖 Generated by ThinkOps — autonomous agent pipeline