xiangfu0 opened a new pull request, #16776:
URL: https://github.com/apache/pinot/pull/16776
This PR adds comprehensive test coverage for the partition ID remapping
functionality in SegmentPartitionMetadataManager.
## Changes
### New Test Methods Added:
1. testPartitionIdRemappingLogic() - Tests core remapping functionality
- Validates 8 Kafka partitions to 4 Pinot partitions with
allowPartitionRemapping=true
- Tests modulo-based mapping: partitions 0,4 to 0; 1,5 to 1; 2,6 to 2
- Verifies fully replicated server tracking with remapped partitions
2. testPartitionIdRemappingInvalidCases() - Tests invalid remapping
scenarios
- Tests non-divisible partition counts (8 partitions to 3 partitions)
- Validates segments are correctly marked invalid when 8 % 3 != 0
3. testPartitionIdRemappingDisabled() - Tests behavior when remapping is
disabled
- With allowPartitionRemapping=false, validates strict partition count
matching
- Ensures segments with mismatched partition counts are marked invalid
## Validation
- All 4 tests pass (3 new + 1 existing)
- 0 checkstyle violations
- No regressions in existing functionality
These tests validate the partition remapping feature used for scaling Kafka
partitions while maintaining fewer logical partitions in Pinot.
--
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]