Start Segment Replace Request API does not allow empty segmentsTo
- Dominant language
- Java
- Stars
- 6.1k
- Forks
- 1.5k
- Avg merge
- 2d 55m
- Merged PRs (30d)
- 182
Description
Discussed with @Jackie-Jiang offline. He mentioned that the Segment replace api allows M>=0 to N>=0 segments, i.e., I can pass an empty `segmentsTo` list of segments and it should work and will mark the segments in segmentsFrom for deletion).
However, when I tried giving an empty segmentsTo list, I get a precondition check failure: https://github.com/apache/pinot/blob/7e9ca6a5a4afe0d4e283ac1307c45430e474cbf2/pinot-common/src/main/java/org/apache/pinot/common/restlet/resources/StartReplaceSegmentsRequest.java#L43
Is the preconditions check required?
Contributor guide
Research direction
Start with pinot-common/src/main/java/org/apache/pinot/common/restlet/resources/StartReplaceSegmentsRequest.java at the precondition check around line 43. Reproduce the request with an empty segmentsTo list and inspect the surrounding Segment replace API behavior; done means the request is handled consistently with the stated M>=0 to N>=0 contract, including marking segmentsFrom for deletion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100