mirror of
https://github.com/signalapp/Signal-Server
synced 2026-08-29 05:34:07 +01:00
Fix overflow when calculating chunk size in ClearOrphanedFoundationDbQueuesCommand
This commit is contained in:
+1
-1
@@ -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()));
|
||||
|
||||
Reference in New Issue
Block a user