anoopj commented on code in PR #15910:
URL: https://github.com/apache/iceberg/pull/15910#discussion_r3061553449
##########
core/src/main/java/org/apache/iceberg/CachingCatalog.java:
##########
@@ -95,9 +95,16 @@ class MetadataTableInvalidatingRemovalListener
@Override
public void onRemoval(TableIdentifier tableIdentifier, Table table,
RemovalCause cause) {
LOG.debug("Evicted {} from the table cache ({})", tableIdentifier,
cause);
- if (RemovalCause.EXPIRED.equals(cause)) {
+ if (cause.wasEvicted()) {
if (!MetadataTableUtils.hasMetadataTableName(tableIdentifier)) {
tableCache.invalidateAll(metadataTableIdentifiers(tableIdentifier));
+ if (table != null) {
+ try {
+ table.io().close();
Review Comment:
This may not be safe for all catalogs. e.g. HadoopCatalog
[creates](https://github.com/apache/iceberg/blob/e1a2713d18ae62ae91512ebbde052d137c942861/core/src/main/java/org/apache/iceberg/hadoop/HadoopCatalog.java#L118)
a common fileIO at the catalog level and not table level. The same fileIO
reference is shared with the table object. So the `close()` here would break
tables in the catalog that are still actively used.
Can this be just handled as part of the catalog's `close()` instead?
--
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]