visit2rahul commented on code in PR #4422:
URL: https://github.com/apache/polaris/pull/4422#discussion_r3244647845


##########
runtime/service/src/main/java/org/apache/polaris/service/admin/PolarisAdminService.java:
##########
@@ -882,6 +882,33 @@ private void validateUpdateCatalogDiffOrThrow(
     }
   }
 
+  private void validateBaseLocationAgainstStorageConfig(

Review Comment:
   Addressed in cc58e79a6 — `BaseLocationValidationTest` now calls 
`validateBaseLocationAgainstStorageConfig` directly (method made 
package-private static for this), covering child / exact-match accept, 
outside-allowed rejection (asserts catalog name + location + allowed list 
appear in the message), multi-allowed acceptance, scheme mismatch, and null / 
empty / null-list allowed-locations as no-op.
   
   (First pass in b3f807cc1 only exercised `StorageLocation::isChildOf` via 
inlined logic — on second look that didn't really test the validation path, 
hence cc58e79a6.)



##########
runtime/service/src/main/java/org/apache/polaris/service/admin/PolarisAdminService.java:
##########
@@ -918,6 +945,13 @@ private void validateUpdateCatalogDiffOrThrow(
         // New base location is already in the updated properties; we'll also 
potentially
         // plumb it into the logic for setting an updated 
StorageConfigurationInfo.
         defaultBaseLocation = newDefaultBaseLocation;
+
+        // If the storage config is not being updated, validate that the new 
base location
+        // is allowed by the existing storage configuration to prevent 
inconsistent state.
+        if (updateRequest.getStorageConfigInfo() == null) {

Review Comment:
   Done in b3f807cc1 — added `&& 
!newDefaultBaseLocation.equals(currentCatalogEntity.getBaseLocation())` guard 
before invoking `validateBaseLocationAgainstStorageConfig`.



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