pvary commented on code in PR #14792:
URL: https://github.com/apache/iceberg/pull/14792#discussion_r2597707168
##########
flink/v2.0/flink/src/main/java/org/apache/iceberg/flink/sink/dynamic/TableMetadataCache.java:
##########
@@ -207,9 +207,26 @@ private Tuple2<Boolean, Exception>
refreshTable(TableIdentifier identifier) {
}
private boolean needsRefresh(CacheItem cacheItem, boolean allowRefresh) {
- return allowRefresh
- && (cacheItem == null
- || cacheRefreshClock.millis() - cacheItem.createdTimestampMillis >
refreshMs);
+ if (!allowRefresh) {
+ return false;
+ }
+
+ if (cacheItem == null) {
+ return true;
+ }
+
+ long nowMillis = cacheRefreshClock.millis();
+ long timeElapsedMillis = nowMillis - cacheItem.createdTimestampMillis;
+ if (timeElapsedMillis > refreshMs) {
+ LOG.info(
+ "Refreshing table metadata after {} millis, cache created={},
now={}",
Review Comment:
The typical log line contains the "now", so probably that is not needed.
We don't get info about which table we refreshing, which is an important
information.
We should examine, how do we plan to use this log.
Maybe we want to understand why an old schema is used for a specific table?
When was the last refresh?
Maybe:
```
"Refreshing table metadata for {} " after {} millis.", tableIdentifier,
timeElapsedMillis
```
--
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]