roryqi commented on code in PR #14540:
URL: https://github.com/apache/gravitino/pull/14540#discussion_r4488138793


##########
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/dispatcher/IcebergNamespaceHookDispatcher.java:
##########
@@ -90,21 +92,18 @@ public CreateNamespaceResponse createNamespace(
             });
     // SchemaMetaService.insertSchema splits the leaf's logical name and 
auto-creates a
     // Gravitino entity row for each ancestor, so a single leaf import covers 
the branch.
+    // Newly inserted ancestor rows inherit the leaf audit in that same write.
     // Failures propagate intentionally: swallowing would leave a namespace in 
Iceberg
     // that Gravitino doesn't know about. Do not drop the namespace on import 
failure: another
     // client may already have created objects in it.
-    importSchema(catalogName, leaf);
+    importSchema(

Review Comment:
   Fixed in 0e7d651e04. Each newly created ancestor is now explicitly imported 
with the request audit before the leaf. If an ordinary load has already 
registered it with a null creator, the store update fills its missing creation 
fields while rechecking identity and preserving any non-null creator.
   
   The H2 hook-to-storage test injects ordinary loads of the parent and leaf 
after backend creation and branch-lock release, before the hook import. It 
verifies Alice on a newly created parent and leaf, while preserving 
source/unknown audit on a pre-existing parent.



##########
core/src/main/java/org/apache/gravitino/catalog/ViewOperationDispatcher.java:
##########
@@ -571,6 +585,9 @@ private EntityCombinedView importView(NameIdentifier ident) 
throws NoSuchViewExc
             .withLastModifier(catalogView.auditInfo().lastModifier())
             .withLastModifiedTime(catalogView.auditInfo().lastModifiedTime())
             .build();
+    if (audit.creator() == null) {

Review Comment:
   Fixed in 0e7d651e04. View imports now use `put(..., false)`. On an insert 
conflict they reload the winning registration and conditionally fill missing 
creation fields; an empty load cannot overwrite the winner's creator or entity 
ID.
   
   Added a two-thread H2 test covering both insert orderings, with and without 
a source identifier. It asserts the winning row ID and Alice's 
creator/createTime survive. Shared in-process tree locking is bypassed for this 
ordering probe so synchronization comes from the real database. No multi-node 
HTTP test was run.



##########
core/src/main/java/org/apache/gravitino/catalog/SchemaDispatcher.java:
##########
@@ -89,4 +91,16 @@ default Schema createSchema(
       throws NoSuchCatalogException, SchemaAlreadyExistsException {
     throw new UnsupportedOperationException("Creating a schema with secrets is 
not supported");
   }
+  /**

Review Comment:
   Fixed in 0e7d651e04. Added the blank line before the javadoc and ran 
Spotless; the checks passed.



##########
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/dispatcher/IcebergViewHookDispatcher.java:
##########
@@ -184,9 +183,9 @@ public void renameView(IcebergRequestContext context, 
RenameTableRequest renameV
   /**
    * Import a view into Gravitino's metadata catalog by loading it through the 
ViewDispatcher.
    *
-   * <p>This method calls {@link ViewDispatcher#loadView} which delegates to 
the underlying
-   * catalog's ViewCatalog implementation. This ensures Gravitino is aware of 
the view and can apply
-   * authorization policies to it.
+   * <p>This method calls {@link ViewDispatcher#importView(NameIdentifier, 
AuditInfo)} which

Review Comment:
   Updated in 0e7d651e04. The javadoc now says that `importView` loads the 
existing view and registers it in Gravitino's entity store so authorization 
policies can apply.



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