dataroaring opened a new pull request, #61922:
URL: https://github.com/apache/doris/pull/61922
## Summary
- Centralize per-CloudReplica `ConcurrentHashMap` fields
(`primaryClusterToBackend`, `secondaryClusterToBackends`) into
`CloudTabletInvertedIndex` using `ConcurrentLong2LongHashMap` (primitive
long→long, no boxing)
- Eliminates ~768 bytes per replica of overhead from two `ConcurrentHashMap`
instances, saving ~3.7 GB at 10M tablets and ~37 GB at 100M tablets
- Checkpoint JSON format (`"be": {"cluster1": 10001}`) is fully preserved
via `GsonPreProcessable`/`GsonPostProcessable` hooks — safe for upgrade,
downgrade, and rolling upgrade
## Changes
| File | Change |
|------|--------|
| `CloudTabletInvertedIndex.java` | Add 3 central `ConcurrentHashMap<String,
ConcurrentLong2LongHashMap>` maps + 12 accessor methods + cleanup in
`deleteTablet`/`deleteReplica`/`innerClear` |
| `CloudReplica.java` | Remove per-replica maps, delegate to central index,
implement `GsonPreProcessable`, update `gsonPostProcess` |
| `CloudReplicaCentralIndexTest.java` | 8 test cases covering round-trip,
Gson serialization, cleanup, legacy format migration |
## Memory Impact
| Scale | Before | After | Savings |
|-------|--------|-------|---------|
| 10M tablets | 3.8 GB | ~80 MB | ~3.7 GB (97%) |
| 100M tablets | 38 GB | ~800 MB | ~37.2 GB (98%) |
## Test plan
- [ ] New unit test `CloudReplicaCentralIndexTest` passes (primary/secondary
BE lifecycle, Gson round-trip, tablet deletion cleanup, legacy format migration)
- [ ] Existing cloud tests pass: `mvn test -pl fe/fe-core -Dtest="*Cloud*"`
- [ ] Grep confirms no remaining direct access to removed fields outside
`CloudReplica.java`
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]