sashapolo commented on code in PR #5134:
URL: https://github.com/apache/ignite-3/pull/5134#discussion_r1935287145
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java:
##########
@@ -701,43 +702,39 @@ private CompletableFuture<Void>
waitForMetadataCompleteness(long ts) {
private CompletableFuture<Boolean>
onZoneReplicaCreated(LocalPartitionReplicaEventParameters parameters) {
if (!PartitionReplicaLifecycleManager.ENABLED) {
- return completedFuture(false);
+ return falseCompletedFuture();
}
return inBusyLockAsync(busyLock, () -> readyToProcessTableStarts
.thenCompose(v -> {
- Set<TableImpl> zoneTables =
zoneTables(parameters.zonePartitionId().zoneId());
+ ZonePartitionId zonePartitionId =
parameters.zonePartitionId();
- PartitionSet singlePartitionIdSet =
PartitionSet.of(parameters.zonePartitionId().partitionId());
+ Set<TableImpl> zoneTables =
zoneTables(zonePartitionId.zoneId());
- CompletableFuture<?>[] futures = zoneTables.stream()
- .map(tbl -> {
- CompletableFuture<Void> createStoragesFuture =
runAsync(
Review Comment:
To reviewer, this change is needed, because there was a bug:
`getOrCreatePartitionStorages` returns a `CompletableFuture`, which we wrapped
in a `runAsync` having a double wrapped future, which means we didn't wait for
the nested future to complete
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java:
##########
@@ -701,43 +702,39 @@ private CompletableFuture<Void>
waitForMetadataCompleteness(long ts) {
private CompletableFuture<Boolean>
onZoneReplicaCreated(LocalPartitionReplicaEventParameters parameters) {
if (!PartitionReplicaLifecycleManager.ENABLED) {
- return completedFuture(false);
+ return falseCompletedFuture();
}
return inBusyLockAsync(busyLock, () -> readyToProcessTableStarts
.thenCompose(v -> {
- Set<TableImpl> zoneTables =
zoneTables(parameters.zonePartitionId().zoneId());
+ ZonePartitionId zonePartitionId =
parameters.zonePartitionId();
- PartitionSet singlePartitionIdSet =
PartitionSet.of(parameters.zonePartitionId().partitionId());
+ Set<TableImpl> zoneTables =
zoneTables(zonePartitionId.zoneId());
- CompletableFuture<?>[] futures = zoneTables.stream()
- .map(tbl -> {
- CompletableFuture<Void> createStoragesFuture =
runAsync(
Review Comment:
To reviewer: this change is needed, because there was a bug:
`getOrCreatePartitionStorages` returns a `CompletableFuture`, which we wrapped
in a `runAsync` having a double wrapped future, which means we didn't wait for
the nested future to complete
--
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]