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

[PR] Remove PolarisCallContext from TreeMapMetaStore [polaris]

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

   the concrete class `TreeMapMetaStore` only uses `PolarisDiagnostics` from the given `PolarisCallContext`.
   
   we also remember `initialDiagnosticServices` and reset it after a transaction for consistency (not sure if it will ever get used outside a transaction context though)


-- 
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] Remove PolarisCallContext from TreeMapMetaStore [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #2195:
URL: https://github.com/apache/polaris/pull/2195#discussion_r2243363918


##########
polaris-core/src/main/java/org/apache/polaris/core/persistence/transactional/TreeMapMetaStore.java:
##########
@@ -460,54 +454,47 @@ public void runActionInTransaction(
         throw e;
       } finally {
         this.tr = null;
-        this.diagnosticServices = null;
+        this.diagnosticServices = this.initialDiagnosticServices;
       }
     }
   }
 
   /**
    * Run inside a read only transaction
    *
-   * @param callCtx call context to use
-   * @param transactionCode transaction code
    * @return the result of the execution
    */
   public <T> T runInReadTransaction(
-      @Nonnull PolarisCallContext callCtx, @Nonnull Supplier<T> transactionCode) {
+      @Nonnull PolarisDiagnostics diagnostics, @Nonnull Supplier<T> transactionCode) {
     synchronized (lock) {
 
       // execute transaction
       try {
         // init diagnostic services
-        this.diagnosticServices = callCtx.getDiagServices();
+        this.diagnosticServices = diagnostics;
         this.startReadTransaction();
         return transactionCode.get();
       } finally {
         this.tr = null;
-        this.diagnosticServices = null;
+        this.diagnosticServices = this.initialDiagnosticServices;

Review Comment:
   This aspect is a behavior change, but it seems to be a pretty reasonable one



-- 
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] Remove PolarisCallContext from TreeMapMetaStore [polaris]

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


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