sergeyuttsel commented on code in PR #1968:
URL: https://github.com/apache/ignite-3/pull/1968#discussion_r1183358907


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java:
##########
@@ -1343,72 +1355,132 @@ private Set<Assignment> 
calculateAssignments(TableConfiguration tableCfg, int pa
      *         </ul>
      * @see TableAlreadyExistsException
      */
-    public CompletableFuture<Table> createTableAsync(String name, 
Consumer<TableChange> tableInitChange) {
+    public CompletableFuture<Table> createTableAsync(String name, String 
zoneName, Consumer<TableChange> tableInitChange) {
         if (!busyLock.enterBusy()) {
             throw new IgniteException(new NodeStoppingException());
         }
         try {
-            return createTableAsyncInternal(name, tableInitChange);
+            return createTableAsyncInternal(name, zoneName, tableInitChange);
         } finally {
             busyLock.leaveBusy();
         }
     }
 
-    /** See {@link #createTableAsync(String, Consumer)} for details. */
-    private CompletableFuture<Table> createTableAsyncInternal(String name, 
Consumer<TableChange> tableInitChange) {
+    /** See {@link #createTableAsync(String, String, Consumer)} for details. */
+    private CompletableFuture<Table> createTableAsyncInternal(
+            String name,
+            String zoneName,
+            Consumer<TableChange> tableInitChange
+    ) {
         CompletableFuture<Table> tblFut = new CompletableFuture<>();
+        tableAsyncInternal(name)
+                .thenAccept(tbl -> {
+                    if (tbl != null) {
+                        tblFut.completeExceptionally(new 
TableAlreadyExistsException(DEFAULT_SCHEMA_NAME, name));
+                    } else {
+                        
distributionZoneManager.zoneIdAsyncInternal(zoneName).handle((zoneId, ex) -> {

Review Comment:
   Tests in DistributionZoneAwaitDataNodesTest check it:
   testWithOutAwaiting - check that even when ScaleUp and ScaleDown equal to 
INFINITE_TIMER_VALUE we wait topology version.
   testAwaitingScaleUpOnly and testAwaitingScaleDownOnly - check that we await 
immediate timers but skip non-immediate ones.



-- 
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]

Reply via email to