eric-maynard commented on code in PR #1037:
URL: https://github.com/apache/polaris/pull/1037#discussion_r1981910953


##########
service/common/src/main/java/org/apache/polaris/service/catalog/PolarisCatalogHandlerWrapper.java:
##########
@@ -585,10 +595,19 @@ public LoadTableResponse createTableDirect(Namespace 
namespace, CreateTableReque
     if (isExternal(catalog)) {
       throw new BadRequestException("Cannot create table on external 
catalogs.");
     }
-    return doCatalogOperation(() -> CatalogHandlers.createTable(baseCatalog, 
namespace, request));
+    return new ETaggedResponse<>(
+            doCatalogOperation(() -> CatalogHandlers.createTable(baseCatalog, 
namespace, request)),
+            generateETagValueForTable(getTableEntity(identifier))

Review Comment:
   I think we need to ensure that the entity we're using to generate the etag 
here is the exact same one returned in the response.
   
   Otherwise, imagine the response body describes the table at time T but you 
call `getTableEntity` at time T+1 and generate the etag accordingly. A user who 
keeps polling for the table using the etag will never see the table's state at 
time T+1



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