dimas-b commented on code in PR #3267:
URL: https://github.com/apache/polaris/pull/3267#discussion_r2643522519


##########
persistence/nosql/realms/store-nosql/src/main/java/org/apache/polaris/persistence/nosql/realms/store/RealmStoreImpl.java:
##########
@@ -206,7 +211,18 @@ public RealmDefinition update(
               return state.commitResult(obj, newRealms, refObj);
             });
 
-    return objToDefinition(realmId, realm.orElseThrow());
+    var result = realm.orElseThrow();
+    if (result.status() == PURGING && "InMemory".equals(backend.type())) {
+      // Handle the test/development case when using the in-memory backend:
+      // In this case there is no chance to run the maintenance service. To 
remove no longer
+      // necessary data from the Java heap, call the in-memory backend 
directly.
+      // This is "nice behavior" when running tests.
+      // The only "cost" is that the state PURGING may never be pushed to 
PURGED, but that is
+      // acceptable.
+      backend.deleteRealms(Set.of(realmId));

Review Comment:
   but as far as I can tell `PolarisIntegrationTestFixture` is the only piece 
of code that calls purge in tests... no other tests or user-driven actions will 
get to `backend.deleteRealms()` on this line... or did I miss something 
:thinking: 



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