Fix overflow when calculating chunk size in ClearOrphanedFoundationDbQueuesCommand

This commit is contained in:
Ameya Lokare
2026-08-26 09:37:57 -07:00
parent 08ca97ba00
commit 7f08e8bf4e
@@ -214,7 +214,7 @@ public class ClearOrphanedFoundationDbQueuesCommand extends AbstractCommandWithD
CompletableFuture<List<Range>> splitSubspace(final Database database, final int numChunks) {
return database.runAsync(transaction -> transaction.getEstimatedRangeSizeBytes(messagesSubspace.range())
.thenCompose(rangeSize -> {
final int chunkSize = Math.toIntExact(Math.ceilDiv(rangeSize, numChunks));
final long chunkSize = Math.ceilDiv(rangeSize, numChunks);
return transaction.getRangeSplitPoints(messagesSubspace.range(), chunkSize);
}))
.thenApply(result -> splitPointsToRanges(result.getKeys()));