{"record":{"id":"26bc42f441ef812e","repo":"apache/cassandra","slug":"failed-to-create-s-for-s-s-reason-s","errorCode":null,"errorMessage":"Failed to create %s for %s.%s, reason: %s","messagePattern":"Failed to create (.+?) for (.+?)\\.(.+?), reason: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/db/compression/ZstdDictionaryTrainer.java","lineNumber":304,"sourceCode":"            return false;\n\n        try\n        {\n            // reset on starting; a new zstdTrainer instance is created during reset\n            reset(trainingConfig);\n            currentTrainingStatus = TrainingStatus.SAMPLING;\n            failureMessage = null; // Clear any previous failure message\n            return true;\n        }\n        catch (Exception e)\n        {\n            String message = String.format(\"Failed to create %s for %s.%s, reason: %s\",\n                                           ZstdDictTrainer.class.getSimpleName(),\n                                           keyspaceName,\n                                           tableName,\n                                           e.getMessage());\n\n            logger.warn(message);\n            failureMessage = message;\n            currentTrainingStatus = TrainingStatus.FAILED;\n        }\n        return false;\n    }\n\n    @Override\n    public void reset(CompressionDictionaryTrainingConfig trainingConfig)\n    {\n        if (closed)\n        {\n            return;\n        }\n\n        currentTrainingStatus = TrainingStatus.NOT_STARTED;\n        synchronized (this)\n        {\n            totalSampleSize.set(0);","sourceCodeStart":286,"sourceCodeEnd":322,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/compression/ZstdDictionaryTrainer.java#L286-L322","documentation":"ZstdDictionaryTrainer.start logs this formatted warning when training a zstd compression dictionary with ZstdDictTrainer fails for a table. The trainer sets TrainingStatus.FAILED and stores the message; the table simply continues without a trained dictionary (falls back to normal zstd without a dictionary).","triggerScenarios":"An exception is thrown during the training run (ZstdDictTrainer.trainSamples / fitSamples) — e.g. insufficient or oversized sample set, native zstd trainer error, OOM during training, or IO problems collecting samples; the message embeds the table keyspace/name and exception message.","commonSituations":"Dictionary training enabled with too few or malformed sample sstables; memory pressure causing zstd training failure on large samples; zstd native library lacking trainer support; training on a table with tiny or highly uniform data.","solutions":["Read the embedded reason (%s at the end) to identify the root cause — most commonly a native zstd or sampling error.","Ensure the table has enough data samples and that dictionary training thresholds in cassandra.yaml are appropriate (not requiring more samples than exist).","Retry training after freeing heap/native memory or reducing sample size limits.","Confirm the JVM's zstd build supports dictionary training; otherwise disable dictionary training for the table via compression options."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// pre-check sample availability before enabling training\nif (table.getLiveSSTables().size() < minSamplesForTraining) {\n    logger.info(\"Not enough samples to train dictionary for {}.{}\", ks, table);\n    return false;\n}","typeGuard":null,"tryCatchPattern":"try {\n    boolean trained = trainer.start();\n} catch (Exception e) {\n    logger.warn(\"Dictionary training failed: {}\", e.getMessage());\n}","preventionTips":["Ensure the table has sufficient, representative data before enabling dictionary training.","Tune sample size/thresholds in compression params to available data volume.","Free heap/native headroom before training large tables.","Verify zstd build supports dictionary training (training samples API)."],"tags":["cassandra","zstd","compression","dictionary-training"],"backgroundTag":"training-job-failed","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"}