{"record":{"id":"4f681b17d868d0e4","repo":"apache/cassandra","slug":"failed-to-retrieve-compression-dictionary-for","errorCode":null,"errorMessage":"Failed to retrieve compression dictionary for {}.{}. {}","messagePattern":"Failed to retrieve compression dictionary for (.+?)\\.(.+?)\\. (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/db/compression/CompressionDictionaryEventHandler.java","lineNumber":95,"sourceCode":"\n    @Override\n    public void onNewDictionaryAvailable(CompressionDictionary.DictId dictionaryId)\n    {\n        // Best effort to retrieve the dictionary; otherwise, the periodic task should retrieve the dictionary later\n        ScheduledExecutors.nonPeriodicTasks.submit(() -> {\n            try\n            {\n                if (!cfs.metadata().params.compression.isDictionaryCompressionEnabled())\n                {\n                    return;\n                }\n\n                CompressionDictionary dictionary = SystemDistributedKeyspace.retrieveCompressionDictionary(keyspaceName, tableName, cfs.metadata().id.toLongString(), dictionaryId.id);\n                cache.add(dictionary);\n            }\n            catch (Exception e)\n            {\n                logger.warn(\"Failed to retrieve compression dictionary for {}.{}. {}\",\n                            keyspaceName, tableName, dictionaryId, e);\n            }\n        });\n    }\n\n    // Best effort to notify the peer regarding the new dictionary being available to pull.\n    // If the request fails, each peer has periodic task scheduled to pull.\n    private void sendNotification(InetAddressAndPort target, CompressionDictionaryUpdateMessage message)\n    {\n        logger.debug(\"Sending dictionary update notification for {} to {}\", message.dictionaryId, target);\n\n        Message<CompressionDictionaryUpdateMessage> msg = Message.out(Verb.DICTIONARY_UPDATE_REQ, message);\n        MessagingService.instance()\n                        .sendWithResponse(target, msg)\n                        .addListener(future -> {\n                            if (future.isSuccess())\n                            {\n                                logger.debug(\"Successfully sent dictionary update notification to {}\", target);","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/compression/CompressionDictionaryEventHandler.java#L77-L113","documentation":"The CompressionDictionaryEventHandler, on learning a new dictionary is available, tries to read it from the system_distributed keyspace and add it to the local cache. If retrieval fails (missing row, deserialization issue, I/O error) it logs this warning and continues without the dictionary; compression falls back to operating without that dictionary.","triggerScenarios":"onNewDictionaryAvailable runs and SystemDistributedKeyspace.retrieveCompressionDictionary throws or returns null for the given keyspace/table/dictionaryId — e.g. the dictionary row was not yet replicated locally.","commonSituations":"New node pulling dictionary metadata before full repair/replication of system_distributed; network or consistency issues reading system_distributed; dictionary deleted on the writer side before peers fetched it.","solutions":["Verify the dictionary row exists in system_distributed (dictionary table) for the given table id and dictionary id.","Run repair on system_distributed so the dictionary data replicates to this node, then wait for the scheduler to retry.","Check connectivity/consistency to system_distributed and the logged exception for the root cause.","Disable/re-enable dictionary compression for the table to force a fresh training/retrieval cycle."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// verify the dictionary row exists before assuming failure is fatal\nRow r = session.execute(\"SELECT * FROM system_distributed.compression_dictionaries WHERE keyspace_name=? AND table_name=?\",\n                        ks, table).one();","typeGuard":null,"tryCatchPattern":"// the handler already swallows; operators retry via repair + next scheduled refresh\ntry { retrieveDictionary(); } catch (Exception e) { scheduleRetryWithBackoff(e); }","preventionTips":["Keep system_distributed repaired, especially after adding nodes.","Do not delete dictionary rows before peers have pulled them."],"tags":["compression","dictionary","system-distributed","replication"],"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"}