apache/cassandra · warning

Failed to close CompressionDictionaryManager on disabling…

Error message

Failed to close CompressionDictionaryManager on disabling dictionary-based compression for table {}.{}

What it means

When schema changes disable dictionary-based compression for a table, CompressionDictionaryManager.maybeReloadFromSchema calls close() to tear down trainer/scheduler/cache. If close() throws, it logs this warning naming the table; the schema change continues but dictionary resources (threads, cache refs) may leak.

Solutions

  1. Check surrounding log lines for the close() root cause (usually from CompressionDictionaryManager 'Failed closing ...').
  2. Avoid rapid disable/enable toggling; allow in-flight training/refresh to finish before altering compression.
  3. Restart the node if leaked scheduler threads/cache refs accumulate, then re-apply the compression change.
  4. If reproducible, capture the exception and file a fix for closeQuietly swallowing details.
Defensive patterns

Strategy: try-catch

Try / catch

try { manager.close(); } catch (Exception e) { log.warn("dictionary manager close failed; resources may leak", e); }

Prevention

When it happens

Trigger: ALTER TABLE ... WITH compression = {...non-dictionary...} (or dropping the table) triggers maybeReloadFromSchema to disable the manager, and close() throws an exception; observed while testing enable/disable of dictionary compression.

Common situations: Repeatedly toggling dictionary compression in tests; disabling compression while a training run or cache eviction is in flight; scheduler thread refusing to shut down cleanly.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/6c3b1fd6a11f0d7b. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/db/compression/CompressionDictionaryManager.java:132

        this.compressionParams = newParams;
        this.isEnabled = compressionParams.isDictionaryCompressionEnabled();
        this.kind = compressionParams.getCompressionDictionaryKind();
        scheduler.setEnabled(isEnabled);
        if (isEnabled)
        {
            registerMbean();
            scheduler.scheduleRefreshTask();
            return;
        }

        // Clean up when dictionary compression is disabled
        try
        {
            close();
        }
        catch (Exception e)
        {
            logger.warn("Failed to close CompressionDictionaryManager on disabling " +
                        "dictionary-based compression for table {}.{}", keyspaceName, tableName);
        }
    }

    @Nullable
    @Override
    public CompressionDictionary getCurrent()
    {
        return cache.getCurrent();
    }

    @Override
    public CompressionDictionary get(CompressionDictionary.DictId dictId)
    {
        return cache.get(dictId);
    }

    @Override

View on GitHub (pinned to 88fd0f6a0e)