{"record":{"id":"246c52b63fadb87a","repo":"apache/iceberg","slug":"an-error-occurred-reloading-table-table-was-no","errorCode":null,"errorMessage":"An error occurred reloading table {}, table was not reloaded","messagePattern":"An error occurred reloading table (.+?), table was not reloaded","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/sink/CachingTableSupplier.java","lineNumber":87,"sourceCode":"  }\n\n  void refreshTable() {\n    if (System.currentTimeMillis() > lastLoadTimeMillis + tableRefreshInterval.toMillis()) {\n      try {\n        if (!tableLoader.isOpen()) {\n          tableLoader.open();\n        }\n\n        this.table = tableLoader.loadTable();\n        this.lastLoadTimeMillis = System.currentTimeMillis();\n\n        LOG.info(\n            \"Table {} reloaded, next min load time threshold is {}\",\n            table.name(),\n            DateTimeUtil.formatTimestampMillis(\n                lastLoadTimeMillis + tableRefreshInterval.toMillis()));\n      } catch (Exception e) {\n        LOG.warn(\"An error occurred reloading table {}, table was not reloaded\", table.name(), e);\n      }\n    }\n  }\n}\n","sourceCodeStart":69,"sourceCodeEnd":92,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/sink/CachingTableSupplier.java#L69-L92","documentation":"CachingTableSupplier.refreshTable() periodically reloads the table metadata in the background; if the reload throws, the error is logged and the stale cached Table continues to be served. Data may be written against outdated metadata until the next successful refresh.","triggerScenarios":"testTableReload calls refreshTable() and tableLoader.loadTable() throws: catalog connectivity failures, authentication/authorization errors, snapshot expiry removing the referenced snapshot, or corrupt/missing metadata files.","commonSituations":"Catalog outages or credential expiry in long-running Flink jobs; the table's snapshots expired by another maintenance job while the sink holds a cached reference; network partition between the job and the REST/Hive catalog.","solutions":["Check the logged exception cause for the actual reload failure (auth, network, missing metadata)","Fix catalog connectivity/credentials; restart the job after long-running token/refresh failures","Avoid aggressive snapshot expiration by other jobs while active writers hold table references","Increase refresh retry/backoff or alert on repeated reload failures so staleness is detected"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Check catalog reachability before relying on background refresh\ncatalog.loadTable(tableIdentifier); // fail fast at job submission","typeGuard":null,"tryCatchPattern":"Table reloaded;\ntry {\n  reloaded = tableLoader.loadTable();\n} catch (Exception e) {\n  LOG.warn(\"reload failed, serving stale table\", e);\n  // schedule retry with backoff\n}","preventionTips":["Coordinate snapshot expiration with active Flink writers","Alert on repeated 'table was not reloaded' warnings (stale metadata risk)","Keep catalog credentials valid for the job's full lifetime"],"tags":["flink","table-refresh","caching","stale-metadata"],"backgroundTag":"stale-cache","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}