apache/cassandra · warning
Failed to retrieve compression dictionary for
Error message
Failed to retrieve compression dictionary for {}.{}. {} What it means
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.
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.
Defensive patterns
Strategy: retry
Validate before calling
// verify the dictionary row exists before assuming failure is fatal
Row r = session.execute("SELECT * FROM system_distributed.compression_dictionaries WHERE keyspace_name=? AND table_name=?",
ks, table).one(); Try / catch
// the handler already swallows; operators retry via repair + next scheduled refresh
try { retrieveDictionary(); } catch (Exception e) { scheduleRetryWithBackoff(e); } Prevention
- Keep system_distributed repaired, especially after adding nodes.
- Do not delete dictionary rows before peers have pulled them.
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- Failed to refresh compression dictionary for
- Failed to send dictionary update notification to
- Provided dictionary can not be consumed by table's…
- Access forbidden
- Can not alter a keyspace to use MetaReplicationStrategy
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/4f681b17d868d0e4.
Report an issue: GitHub.
Appendix: source
Thrown at src/java/org/apache/cassandra/db/compression/CompressionDictionaryEventHandler.java:95
@Override
public void onNewDictionaryAvailable(CompressionDictionary.DictId dictionaryId)
{
// Best effort to retrieve the dictionary; otherwise, the periodic task should retrieve the dictionary later
ScheduledExecutors.nonPeriodicTasks.submit(() -> {
try
{
if (!cfs.metadata().params.compression.isDictionaryCompressionEnabled())
{
return;
}
CompressionDictionary dictionary = SystemDistributedKeyspace.retrieveCompressionDictionary(keyspaceName, tableName, cfs.metadata().id.toLongString(), dictionaryId.id);
cache.add(dictionary);
}
catch (Exception e)
{
logger.warn("Failed to retrieve compression dictionary for {}.{}. {}",
keyspaceName, tableName, dictionaryId, e);
}
});
}
// Best effort to notify the peer regarding the new dictionary being available to pull.
// If the request fails, each peer has periodic task scheduled to pull.
private void sendNotification(InetAddressAndPort target, CompressionDictionaryUpdateMessage message)
{
logger.debug("Sending dictionary update notification for {} to {}", message.dictionaryId, target);
Message<CompressionDictionaryUpdateMessage> msg = Message.out(Verb.DICTIONARY_UPDATE_REQ, message);
MessagingService.instance()
.sendWithResponse(target, msg)
.addListener(future -> {
if (future.isSuccess())
{
logger.debug("Successfully sent dictionary update notification to {}", target);View on GitHub (pinned to 88fd0f6a0e)