{"record":{"id":"a66a36e4210300a6","repo":"apache/cassandra","slug":"only-free-across-all-data-volumes-consider-add","errorCode":null,"errorMessage":"Only {} free across all data volumes. Consider adding more capacity to your cluster or removing obsolete snapshots","messagePattern":"Only (.+?) free across all data volumes\\. Consider adding more capacity to your cluster or removing obsolete snapshots","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":900,"sourceCode":"        for (String datadir : conf.data_file_directories)\n        {\n            if (datadir == null)\n                throw new ConfigurationException(\"data_file_directories must not contain empty entry\", false);\n            if (datadir.equals(conf.local_system_data_file_directory))\n                throw new ConfigurationException(\"local_system_data_file_directory must not be the same as any data_file_directories\", false);\n            if (datadir.equals(conf.commitlog_directory))\n                throw new ConfigurationException(\"commitlog_directory must not be the same as any data_file_directories\", false);\n            if (datadir.equals(conf.accord.journal_directory))\n                throw new ConfigurationException(\"accord.journal_directory must not be the same as any data_file_directories\", false);\n            if (datadir.equals(conf.hints_directory))\n                throw new ConfigurationException(\"hints_directory must not be the same as any data_file_directories\", false);\n            if (datadir.equals(conf.saved_caches_directory))\n                throw new ConfigurationException(\"saved_caches_directory must not be the same as any data_file_directories\", false);\n\n            dataFreeBytes = saturatedSum(dataFreeBytes, tryGetSpace(datadir, FileStore::getUnallocatedSpace));\n        }\n        if (dataFreeBytes < 64 * ONE_GIB) // 64 GB\n            logger.warn(\"Only {} free across all data volumes. Consider adding more capacity to your cluster or removing obsolete snapshots\",\n                        FBUtilities.prettyPrintMemory(dataFreeBytes));\n\n        if (conf.local_system_data_file_directory != null)\n        {\n            if (conf.local_system_data_file_directory.equals(conf.commitlog_directory))\n                throw new ConfigurationException(\"local_system_data_file_directory must not be the same as the commitlog_directory\", false);\n            if (conf.local_system_data_file_directory.equals(conf.accord.journal_directory))\n                throw new ConfigurationException(\"local_system_data_file_directory must not be the same as the accord.journal_directory\", false);\n            if (conf.local_system_data_file_directory.equals(conf.saved_caches_directory))\n                throw new ConfigurationException(\"local_system_data_file_directory must not be the same as the saved_caches_directory\", false);\n            if (conf.local_system_data_file_directory.equals(conf.hints_directory))\n                throw new ConfigurationException(\"local_system_data_file_directory must not be the same as the hints_directory\", false);\n\n            long freeBytes = tryGetSpace(conf.local_system_data_file_directory, FileStore::getUnallocatedSpace);\n\n            if (freeBytes < ONE_GIB)\n                logger.warn(\"Only {} free in the system data volume. Consider adding more capacity or removing obsolete snapshots\",\n                            FBUtilities.prettyPrintMemory(freeBytes));","sourceCodeStart":882,"sourceCodeEnd":918,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L882-L918","documentation":"At startup DatabaseDescriptor sums the unallocated space (File.getUnallocatedSpace) across all data_file_directories and warns if the total is below 64 GiB. Cassandra needs working room for compactions, hints, and snapshots; critically low free space risks failed writes and compactions, so this is an early capacity warning.","triggerScenarios":"applySimpleConfig computes dataFreeBytes as the saturated sum of getUnallocatedSpace over every data directory and it comes out < 64 * 1 GiB; the warning names the pretty-printed free amount.","commonSituations":"Small dev/test VMs or containers with < 64 GiB disks, production clusters nearly full where old snapshots were never cleared (nodetool clearsnapshot), or over-provisioned node counts on thin volumes.","solutions":["Free space by removing obsolete snapshots (nodetool clearsnapshot) and compacting/cleaning expired data","Add storage capacity or more nodes to the cluster","If the node is intentionally tiny (dev only), ignore or silence the warning — it is non-fatal"],"exampleFix":"// before (shell)\nnodetool listsnapshots   # many old snapshots, disk at 50 GiB free\n// after\nnodetool clearsnapshot   # frees space; warning disappears on next startup","handlingStrategy":"validation","validationCode":"long totalFree = 0;\nfor (String dir : config.data_file_directories) {\n    try { totalFree = Math.addExact(totalFree, new File(dir).getUsableSpace()); }\n    catch (Exception e) { /* ignore unreadable dir */ }\n}\nif (totalFree < 64L * 1024 * 1024 * 1024) logger.warn(\"Only {} free across data volumes\", totalFree);","typeGuard":null,"tryCatchPattern":"try { DatabaseDescriptor.applySimpleConfig(conf); } catch (ConfigurationException e) { /* directory collisions/misconfig surface here, not the space warning */ }","preventionTips":["Set disk-usage alerts well below 100% on data volumes","Schedule nodetool clearsnapshot and monitor snapshot buildup","Size volumes to keep >= 64 GiB free on data directories"],"tags":["cassandra","disk-space","storage","capacity"],"backgroundTag":"insufficient-disk-space","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}