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


##########
persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/RelationalJdbcProductionReadinessChecks.java:
##########
@@ -55,4 +56,50 @@ public ProductionReadinessCheck checkRelationalJdbc(
     }
     return ProductionReadinessCheck.OK;
   }
+
+  /**
+   * Checks if metrics persistence is properly configured. When metrics 
persistence is enabled, this
+   * check verifies that the metrics tables have been bootstrapped in the 
database.
+   *
+   * <p>This check only applies when using RelationalJdbc persistence and 
metrics persistence is
+   * enabled.
+   */
+  @Produces
+  public ProductionReadinessCheck checkMetricsPersistenceBootstrapped(
+      MetaStoreManagerFactory metaStoreManagerFactory,
+      Instance<DataSource> dataSource,
+      RelationalJdbcConfiguration relationalJdbcConfiguration,
+      @ConfigProperty(name = "polaris.persistence.metrics.enabled", 
defaultValue = "false")
+          boolean metricsPersistenceEnabled) {
+    // This check should only be applicable when persistence uses 
RelationalJdbc.
+    if (!(metaStoreManagerFactory instanceof JdbcMetaStoreManagerFactory)) {
+      return ProductionReadinessCheck.OK;

Review Comment:
   otherwise, the check code LGTM 👍 



##########
persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/RelationalJdbcProductionReadinessChecks.java:
##########
@@ -55,4 +56,50 @@ public ProductionReadinessCheck checkRelationalJdbc(
     }
     return ProductionReadinessCheck.OK;
   }
+
+  /**
+   * Checks if metrics persistence is properly configured. When metrics 
persistence is enabled, this
+   * check verifies that the metrics tables have been bootstrapped in the 
database.
+   *
+   * <p>This check only applies when using RelationalJdbc persistence and 
metrics persistence is
+   * enabled.
+   */
+  @Produces
+  public ProductionReadinessCheck checkMetricsPersistenceBootstrapped(
+      MetaStoreManagerFactory metaStoreManagerFactory,
+      Instance<DataSource> dataSource,
+      RelationalJdbcConfiguration relationalJdbcConfiguration,
+      @ConfigProperty(name = "polaris.persistence.metrics.enabled", 
defaultValue = "false")
+          boolean metricsPersistenceEnabled) {
+    // This check should only be applicable when persistence uses 
RelationalJdbc.
+    if (!(metaStoreManagerFactory instanceof JdbcMetaStoreManagerFactory)) {
+      return ProductionReadinessCheck.OK;

Review Comment:
   This check does not look correct to me. We should test the Metrics 
Persistence impl.. I think.
   
   ... but it may not be available in this PR... Perhaps we should move this 
code to #3385? WDYT?



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