{"record":{"id":"7fb6cb5876a363a8","repo":"apache/cassandra","slug":"failed-to-refresh-compression-dictionary-for","errorCode":null,"errorMessage":"Failed to refresh compression dictionary for {}.{}","messagePattern":"Failed to refresh compression dictionary for (.+?)\\.(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/db/compression/CompressionDictionaryScheduler.java","lineNumber":184,"sourceCode":"    /**\n     * Refreshes dictionary from system table and updates the cache.\n     * This method is called periodically by the scheduled refresh task.\n     */\n    private void refreshDictionaryFromSystemTable()\n    {\n        try\n        {\n            if (!isEnabled)\n            {\n                return;\n            }\n\n            CompressionDictionary dictionary = SystemDistributedKeyspace.retrieveLatestCompressionDictionary(keyspaceName, tableName, tableId);\n            cache.add(dictionary);\n        }\n        catch (Exception e)\n        {\n            logger.warn(\"Failed to refresh compression dictionary for {}.{}\",\n                        keyspaceName, tableName, e);\n        }\n    }\n\n    @Override\n    public void close()\n    {\n        if (scheduledRefreshTask != null)\n        {\n            scheduledRefreshTask.cancel(false);\n            scheduledRefreshTask = null;\n        }\n\n        finishTraining(TrainingState.notStarted());\n    }\n\n    /**\n     * Task that samples chunks from existing SSTables and triggers training.","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/compression/CompressionDictionaryScheduler.java#L166-L202","documentation":"The periodic dictionary refresh task reads the latest compression dictionary for a table from the system_distributed keyspace and adds it to the local cache. On any exception (missing row, deserialization, I/O) it logs this warning and skips the refresh; existing compression continues without the newest dictionary until the next scheduled run.","triggerScenarios":"refreshDictionaryFromSystemTable runs on schedule and SystemDistributedKeyspace.retrieveLatestCompressionDictionary throws for the keyspace/table — e.g. the dictionary row is absent or not yet replicated.","commonSituations":"system_distributed not fully repaired after adding nodes; dictionary publisher deleted rows; transient storage/consistency errors; table id mismatch after table recreation.","solutions":["Check the logged exception and verify the latest dictionary row exists in system_distributed for the table id.","Repair system_distributed so dictionary data replicates, then let the next scheduled refresh retry.","Confirm the table was not dropped/recreated (table id change) and re-enable dictionary compression if needed.","If refreshes keep failing, disable/re-enable dictionary-based compression to retrain and repopulate."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// precheck that latest dictionary row is visible\nRow latest = session.execute(\"SELECT * FROM system_distributed.compression_dictionaries WHERE keyspace_name=? AND table_name=?\", ks, table).one();\nboolean dictionaryAvailable = latest != null;","typeGuard":null,"tryCatchPattern":"try { refreshFromSystemTable(); } catch (Exception e) { logger.warn(\"refresh skipped; will retry next cycle\", e); }","preventionTips":["Schedule repairs of system_distributed regularly.","Confirm table ids are stable (avoid drop/recreate) when dictionary compression is enabled.","Alert on repeated refresh warnings rather than a single occurrence."],"tags":["compression","dictionary","scheduler","system-distributed"],"backgroundTag":"resource-not-found","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}