korlov42 commented on code in PR #5502:
URL: https://github.com/apache/ignite-3/pull/5502#discussion_r2018271720


##########
modules/catalog/src/main/java/org/apache/ignite/internal/catalog/storage/UpdateLogImpl.java:
##########
@@ -120,11 +123,20 @@ public CompletableFuture<Void> 
startAsync(ComponentContext componentContext) {
             this.listener = listener;
 
             metastore.registerPrefixWatch(CatalogKey.updatePrefix(), listener);
+
+            Update putProductKey = ops(
+                    put(CatalogKey.catalogProduct(), MAGIC_BYTES)
+            ).yield(false);
+
+            Iif writeProductKeyIfNotExist = iif(
+                    notExists(CatalogKey.catalogProduct()),
+                    putProductKey, ops().yield(false)
+            );
+            return 
metastore.invoke(writeProductKeyIfNotExist).thenApply(ignore -> null);

Review Comment:
   no need to invoke distributed operation on every start. Let's check presence 
of the key locally `metastore.getLocally(CatalogKey.catalogProduct());` and 
invoke distributed update only in case the key does not exist



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