You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@polaris.apache.org by "adnanhemani (via GitHub)" <gi...@apache.org> on 2025/07/02 08:54:31 UTC

[PR] Materialize Realm ID for Session Supplier in JDBC [polaris]

adnanhemani opened a new pull request, #1988:
URL: https://github.com/apache/polaris/pull/1988

   <!--
       Possible security vulnerabilities: STOP here and contact security@apache.org instead!
   
       Please update the title of the PR with a meaningful message - do not leave it "empty" or "generated"
       Please update this summary field:
   
       The summary should cover these topics, if applicable:
       * the motivation for the change
       * a description of the status quo, for example the current behavior
       * the desired behavior
       * etc
   
       PR checklist:
       - Do a self-review of your code before opening a pull request
       - Make sure that there's good test coverage for the changes included in this PR
       - Run tests locally before pushing a PR (./gradlew check)
       - Code should have comments where applicable. Particularly hard-to-understand
         areas deserve good in-line documentation.
       - Include changes and enhancements to the documentation (in site/content/in-dev/unreleased)
       - For Work In Progress Pull Requests, please use the Draft PR feature.
   
       Make sure to add the information BELOW this comment.
       Everything in this comment will NOT be added to the PR description.
   -->
   
   As a continuation of the conversation in #1765, I've reduced the scope of the PR to be solved only for JDBC as a quick workaround. Technically, the `MetastoreManagerFactory` does not imply anything about the implementation of the interface, so I take this decision to materialize the RealmIds as an implementation detail of the JDBC integration.
   
   A quick reproduction of the original issue and the proof that this solves that issue can be found [here](https://github.com/apache/polaris/pull/1765#issuecomment-2942620712).


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Materialize Realm ID for Session Supplier in JDBC [polaris]

Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #1988:
URL: https://github.com/apache/polaris/pull/1988#discussion_r2180488604


##########
persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/JdbcMetaStoreManagerFactory.java:
##########
@@ -100,17 +99,18 @@ private void initializeForRealm(
       DatasourceOperations datasourceOperations,
       RealmContext realmContext,
       RootCredentialsSet rootCredentialsSet) {
+    String realmId = realmContext.getRealmIdentifier();
     sessionSupplierMap.put(
-        realmContext.getRealmIdentifier(),

Review Comment:
   Sorry, I do not really see any major runtime difference before/after this change. Could you add comments or clarify what the change is supposed to do in the PR description? It has a link to another PR, but the linked page has a rather long discussion thread... It would be nice to describe specifically what this PR fixes, please.



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Materialize Realm ID for Session Supplier in JDBC [polaris]

Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on PR #1988:
URL: https://github.com/apache/polaris/pull/1988#issuecomment-3034327668

   Just FYI: https://lists.apache.org/thread/0cyrzft2oon28otxlmmhvd5671rd3r3d


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Materialize Realm ID for Session Supplier in JDBC [polaris]

Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on PR #1988:
URL: https://github.com/apache/polaris/pull/1988#issuecomment-3034358771

   @singhpk234 : Please feel free to merge after you review the updated PR.


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Materialize Realm ID for Session Supplier in JDBC [polaris]

Posted by "singhpk234 (via GitHub)" <gi...@apache.org>.
singhpk234 merged PR #1988:
URL: https://github.com/apache/polaris/pull/1988


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Materialize Realm ID for Session Supplier in JDBC [polaris]

Posted by "adnanhemani (via GitHub)" <gi...@apache.org>.
adnanhemani commented on code in PR #1988:
URL: https://github.com/apache/polaris/pull/1988#discussion_r2184221167


##########
persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/JdbcMetaStoreManagerFactory.java:
##########
@@ -100,17 +99,18 @@ private void initializeForRealm(
       DatasourceOperations datasourceOperations,
       RealmContext realmContext,
       RootCredentialsSet rootCredentialsSet) {
+    String realmId = realmContext.getRealmIdentifier();
     sessionSupplierMap.put(
-        realmContext.getRealmIdentifier(),
+        realmId,
         () ->
             new JdbcBasePersistenceImpl(
                 datasourceOperations,
-                secretsGenerator(realmContext, rootCredentialsSet),
+                secretsGenerator(realmId, rootCredentialsSet),

Review Comment:
   Added!



##########
persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/JdbcMetaStoreManagerFactory.java:
##########
@@ -100,17 +99,18 @@ private void initializeForRealm(
       DatasourceOperations datasourceOperations,
       RealmContext realmContext,
       RootCredentialsSet rootCredentialsSet) {
+    String realmId = realmContext.getRealmIdentifier();
     sessionSupplierMap.put(
-        realmContext.getRealmIdentifier(),

Review Comment:
   I've added more details to the PR description and added a comment as well!



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Materialize Realm ID for Session Supplier in JDBC [polaris]

Posted by "singhpk234 (via GitHub)" <gi...@apache.org>.
singhpk234 commented on code in PR #1988:
URL: https://github.com/apache/polaris/pull/1988#discussion_r2180369902


##########
persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/JdbcMetaStoreManagerFactory.java:
##########
@@ -100,17 +99,18 @@ private void initializeForRealm(
       DatasourceOperations datasourceOperations,
       RealmContext realmContext,
       RootCredentialsSet rootCredentialsSet) {
+    String realmId = realmContext.getRealmIdentifier();
     sessionSupplierMap.put(
-        realmContext.getRealmIdentifier(),
+        realmId,
         () ->
             new JdbcBasePersistenceImpl(
                 datasourceOperations,
-                secretsGenerator(realmContext, rootCredentialsSet),
+                secretsGenerator(realmId, rootCredentialsSet),

Review Comment:
   Would you mind adding a comment for this ? 



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Materialize Realm ID for Session Supplier in JDBC [polaris]

Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on PR #1988:
URL: https://github.com/apache/polaris/pull/1988#issuecomment-3034324009

   Thanks for the updated description, @adnanhemani ! Nice find!


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org