aiborodin commented on code in PR #18539:
URL: https://github.com/apache/iceberg/pull/18539#discussion_r4310765139
##########
core/src/main/java/org/apache/iceberg/CatalogProperties.java:
##########
@@ -154,6 +154,15 @@ private CatalogProperties() {}
public static final String LOCK_TABLE = "lock.table";
+ /**
+ * Number of times to retry reading table or view metadata during a refresh.
+ *
+ * <p>Support for this property is catalog-dependent.
+ */
+ public static final String METADATA_REFRESH_MAX_RETRIES =
"metadata-refresh.max-retries";
+
+ public static final int METADATA_REFRESH_MAX_RETRIES_DEFAULT = 20;
Review Comment:
With the property now JDBC-specific, the default lives in `JdbcUtil`. I left
the `20` in the base operations classes alone so core doesn't reference a JDBC
setting.
##########
core/src/main/java/org/apache/iceberg/jdbc/JdbcViewOperations.java:
##########
@@ -61,6 +62,7 @@ protected JdbcViewOperations(
this.fileIO = fileIO;
this.connections = dbConnPool;
this.catalogProperties = catalogProperties;
+ this.metadataRefreshMaxRetries =
JdbcUtil.metadataRefreshMaxRetries(catalogProperties);
Review Comment:
Done. It's now parsed and validated once in `JdbcCatalog.initialize()` and
passed to the operations classes, so a bad value fails at catalog startup. I
kept the existing protected `JdbcViewOperations` constructor for compatibility.
##########
core/src/test/java/org/apache/iceberg/jdbc/TestJdbcCatalog.java:
##########
@@ -1067,6 +1072,40 @@ public void testRemoveProperties() {
assertThat(catalog.namespaceExists(testNamespace)).isTrue();
}
+ @Test
+ public void testMetadataRefreshMaxRetries() {
+ JdbcCatalog jdbcCatalog =
Review Comment:
Good catch, wrapped them in try-with-resources like the other tests here.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]