flyrain commented on code in PR #3281:
URL: https://github.com/apache/polaris/pull/3281#discussion_r2652055703


##########
persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/JdbcMetaStoreManagerFactory.java:
##########
@@ -196,15 +196,20 @@ public Map<String, BaseResult> 
purgeRealms(Iterable<String> realms) {
 
     for (String realm : realms) {
       RealmContext realmContext = () -> realm;
-      PolarisMetaStoreManager metaStoreManager = 
getOrCreateMetaStoreManager(realmContext);
-      BasePersistence session = getOrCreateSession(realmContext);
-
-      PolarisCallContext callContext = new PolarisCallContext(realmContext, 
session);
-      BaseResult result = metaStoreManager.purge(callContext);
-      results.put(realm, result);
-
-      sessionSupplierMap.remove(realm);
-      metaStoreManagerMap.remove(realm);
+      try {
+        PolarisMetaStoreManager metaStoreManager = 
getOrCreateMetaStoreManager(realmContext);
+        BasePersistence session = getOrCreateSession(realmContext);
+
+        PolarisCallContext callContext = new PolarisCallContext(realmContext, 
session);
+        BaseResult result = metaStoreManager.purge(callContext);
+        results.put(realm, result);
+
+        sessionSupplierMap.remove(realm);
+        metaStoreManagerMap.remove(realm);
+      } catch (IllegalStateException e) {
+        // Realm is not bootstrapped, return a failed result
+        results.put(realm, new 
BaseResult(BaseResult.ReturnStatus.ENTITY_NOT_FOUND, e.getMessage()));

Review Comment:
   > In my experience having more than one application.properties file in a 
Quarkus build leads to very obscure behaviours. 
   
   Thanks for the explanation. This seems to be happening in the server module 
as well today. If this is a real concern, we should be consistent and remove 
the dependency from the server too. One concrete option would be to remove 
`application.properties` from the `defaults` module entirely, and keep it only 
in the `admin` and `server` modules. Also I don't think 
`application-it.properties` and `application-test.properties` will mess up with 
any other `application.properties`, the `server` module has been depended on it 
for a while. 
   
   More broadly, the separate `admin` module has been a recurring source of 
friction. It effectively doubles license checks, Docker image publishing, and 
binary publishing, and it also forces additional shared modules like `common` 
and `test-common`. At this point, it may be worth stepping back and seriously 
considering whether Polaris would be simpler and more maintainable as a single 
module rather than continuing to split to two. 



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