You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "korlov42 (via GitHub)" <gi...@apache.org> on 2023/05/16 10:18:34 UTC

[GitHub] [ignite-3] korlov42 commented on a diff in pull request #2064: IGNITE-19081 Introduce Catalog events

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


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ddl/DdlCommandHandlerWrapper.java:
##########
@@ -53,8 +57,15 @@ public DdlCommandHandlerWrapper(
     @Override
     public CompletableFuture<Boolean> handle(DdlCommand cmd) {
         if (cmd instanceof CreateTableCommand) {

Review Comment:
   since we always have to call super, does it make sense to move `if` statement inside `thenCompose`?



##########
modules/catalog/src/main/java/org/apache/ignite/internal/catalog/CatalogServiceImpl.java:
##########
@@ -270,7 +323,7 @@ public void handle(VersionedUpdate update) {
 
             registerCatalog(catalog);
 
-            versionTracker.update(catalog.version(), null);
+            CompletableFuture.allOf(eventFutures.toArray(CompletableFuture[]::new)).thenRun(() -> versionTracker.update(version, null));

Review Comment:
   `thenRun` is invoked only in case of successful completion, but what if any listener will throw an exception? We will get a frozen tests without notion about what went wrong. Let's at least log the exception



##########
modules/catalog/src/test/java/org/apache/ignite/internal/catalog/CatalogServiceSelfTest.java:
##########
@@ -247,6 +253,35 @@ public void catalogServiceManagesUpdateLogLifecycle() throws Exception {
         verify(updateLogMock).stop();
     }
 
+    @Test
+    public void testCreateTableEvents() {

Review Comment:
   let's test to validate CatalogEvent.TABLE_DROP



-- 
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-unsubscribe@ignite.apache.org

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