alievmirza commented on code in PR #3653:
URL: https://github.com/apache/ignite-3/pull/3653#discussion_r1579656780


##########
modules/catalog/src/main/java/org/apache/ignite/internal/catalog/CatalogManagerImpl.java:
##########
@@ -363,6 +361,30 @@ public CompletableFuture<Boolean> compactCatalog(long 
timestamp) {
         return updateLog.saveSnapshot(new SnapshotEntry(catalog));
     }
 
+    private CompletableFuture<Void> createDefaultZone(Catalog emptyCatalog) {
+        List<UpdateEntry> createZoneEntries = CreateZoneCommand.builder()
+                .zoneName(DEFAULT_ZONE_NAME)
+                .partitions(DEFAULT_PARTITION_COUNT)
+                .replicas(DEFAULT_REPLICA_COUNT)
+                .dataNodesAutoAdjustScaleUp(IMMEDIATE_TIMER_VALUE)
+                .dataNodesAutoAdjustScaleDown(INFINITE_TIMER_VALUE)
+                .filter(DEFAULT_FILTER)
+                .storageProfilesParams(
+                        
List.of(StorageProfileParams.builder().storageProfile(CatalogService.DEFAULT_STORAGE_PROFILE).build())
+                )
+                .build()
+                .get(emptyCatalog);
+
+        return updateLog.append(new VersionedUpdate(emptyCatalog.version() + 
1, 0L, createZoneEntries))
+                .handle((result, error) -> {
+                    if (error != null) {
+                        LOG.warn("Unable to create default zone.", error);

Review Comment:
   What are the negative side effects if default zone wasn't created at all? 
What will be the behaviour of a table creation without specified zone?  



##########
modules/catalog/src/main/java/org/apache/ignite/internal/catalog/storage/NewZoneEntry.java:
##########
@@ -72,13 +72,17 @@ public CatalogEventParameters createEventParameters(long 
causalityToken, int cat
     public Catalog applyUpdate(Catalog catalog, long causalityToken) {
         descriptor.updateToken(causalityToken);
 
+        int defaultZoneId = catalog.defaultZone() != null
+                ? catalog.defaultZone().id()
+                : descriptor.id();

Review Comment:
   I do not understand why we take `descriptor.id()` of a new zone as a 
defaultZoneId



-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to