This is an automated email from the ASF dual-hosted git repository.

dimas pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris.git


The following commit(s) were added to refs/heads/main by this push:
     new 18fdb0104 Properly track bootstrappedRealms in 
InMemoryPolarisMetaStoreManagerFactory (#1352)
18fdb0104 is described below

commit 18fdb010450f92ac2139222acd2f5fe927422831
Author: Dmitri Bourlatchkov <[email protected]>
AuthorDate: Thu Apr 10 15:09:26 2025 -0400

    Properly track bootstrappedRealms in InMemoryPolarisMetaStoreManagerFactory 
(#1352)
    
    Fixes #1351
---
 .../service/persistence/InMemoryPolarisMetaStoreManagerFactory.java  | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/service/common/src/main/java/org/apache/polaris/service/persistence/InMemoryPolarisMetaStoreManagerFactory.java
 
b/service/common/src/main/java/org/apache/polaris/service/persistence/InMemoryPolarisMetaStoreManagerFactory.java
index 2d51dcd53..4122285b0 100644
--- 
a/service/common/src/main/java/org/apache/polaris/service/persistence/InMemoryPolarisMetaStoreManagerFactory.java
+++ 
b/service/common/src/main/java/org/apache/polaris/service/persistence/InMemoryPolarisMetaStoreManagerFactory.java
@@ -97,13 +97,13 @@ public class InMemoryPolarisMetaStoreManagerFactory
   private void bootstrapRealmsAndPrintCredentials(List<String> realms) {
     RootCredentialsSet rootCredentialsSet = 
RootCredentialsSet.fromEnvironment();
     this.bootstrapRealms(realms, rootCredentialsSet);
-    bootstrappedRealms.addAll(realms);
   }
 
   @Override
   public Map<String, PrincipalSecretsResult> bootstrapRealms(
       Iterable<String> realms, RootCredentialsSet rootCredentialsSet) {
     Map<String, PrincipalSecretsResult> results = 
super.bootstrapRealms(realms, rootCredentialsSet);
+    bootstrappedRealms.addAll(results.keySet());
 
     Map<String, RootCredentials> presetCredentials = 
rootCredentialsSet.credentials();
     for (String realmId : realms) {
@@ -113,6 +113,9 @@ public class InMemoryPolarisMetaStoreManagerFactory
       }
 
       PrincipalSecretsResult principalSecrets = results.get(realmId);
+      if (principalSecrets == null) {
+        continue; // already bootstrapped (possible benign race)
+      }
 
       String msg =
           String.format(

Reply via email to