-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better error message when partition space is exhausted #15685
Better error message when partition space is exhausted #15685
Conversation
final RootPartitionRange highFence = new RootPartitionRange(Short.MAX_VALUE, Short.MAX_VALUE); | ||
return stateMap.subMap(lowFench, false, highFence, false).entrySet().iterator(); | ||
if (lowFence.compareTo(highFence) > 0) { | ||
throw new ISE("PartitionId[%d] must be in the range [0, 32767].", Short.toUnsignedInt(partitionId)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The message might still not be very useful because the user cannot determine the root cause. Maybe indicate the fact that there are too many partitions (i.e. more than 32,767) in the interval causing overflow of the partition ID range.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
if (lowFence.compareTo(highFence) > 0) { | ||
throw new ISE("PartitionId[%d] must be in the range [0, 32767].", Short.toUnsignedInt(partitionId)); | ||
} | ||
return stateMap.subMap(lowFence, false, highFence, false).entrySet().iterator(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Cleaner to put this in the else
of the preceding if
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Merging since the failing UT is unrelated |
Segment locking introduced a limitation where the partition id of a segment must lie within [0, 32767]. When the partitionId falls outside this range, a cryptic error
fromKey > toKey
can be thrown.This PR is an attempt to improve the error message when the partition space is exhausted.
This PR has: