{"record":{"id":"9f939fc9ba2b8aac","repo":"apache/cassandra","slug":"nanoseconds-level-precision-is-not-supported","errorCode":null,"errorMessage":"NANOSECONDS level precision is not supported.","messagePattern":"NANOSECONDS level precision is not supported\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/db/commitlog/CommitLogArchiver.java","lineNumber":157,"sourceCode":"                    {\n                        throw new RuntimeException(\"Unable to create directory: \" + dir);\n                    }\n                }\n            }\n        }\n\n        String precisionPropertyValue = commitlogCommands.getProperty(\"precision\", TimeUnit.MICROSECONDS.name());\n        TimeUnit precision;\n        try\n        {\n            precision = TimeUnit.valueOf(precisionPropertyValue);\n        }\n        catch (IllegalArgumentException ex)\n        {\n            throw new RuntimeException(\"Unable to parse precision of value \" + precisionPropertyValue, ex);\n        }\n        if (precision == TimeUnit.NANOSECONDS)\n            throw new RuntimeException(\"NANOSECONDS level precision is not supported.\");\n\n        String targetTime = commitlogCommands.getProperty(\"restore_point_in_time\");\n        long restorePointInTime = Long.MAX_VALUE;\n        try\n        {\n            if (!Strings.isNullOrEmpty(targetTime))\n            {\n                // get restorePointInTime in microseconds level by default as cassandra use this level's timestamp\n                restorePointInTime = getRestorationPointInTimeInMicroseconds(targetTime);\n            }\n        }\n        catch (DateTimeParseException e)\n        {\n            throw new RuntimeException(\"Unable to parse restore target time\", e);\n        }\n\n        String snapshotPosition = commitlogCommands.getProperty(\"snapshot_commitlog_position\");\n        CommitLogPosition snapshotCommitLogPosition;","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/commitlog/CommitLogArchiver.java#L139-L175","documentation":"Thrown when the 'precision' property in commitlog_archiving.properties resolves to TimeUnit.NANOSECONDS. Cassandra's restore-point-in-time bookkeeping operates at microsecond resolution, so nanosecond precision is explicitly rejected at startup.","triggerScenarios":"getArchiverFromProperties() parses precision=NANOSECONDS and hits the explicit `if (precision == TimeUnit.NANOSECONDS)` guard.","commonSituations":"Developer setting precision to NANOSECONDS expecting higher-resolution restores; auto-generated configs that emit all TimeUnit values.","solutions":["Change precision to MICROSECONDS (the finest supported value and the default).","Remove the precision property to fall back to the default.","If nanosecond precision is a hard requirement, it is not supported — restructure the restore strategy around microsecond timestamps."],"exampleFix":"# before\nprecision: NANOSECONDS\n# after\nprecision: MICROSECONDS","handlingStrategy":"validation","validationCode":"String p = props.getProperty(\"precision\");\nif (p != null && p.trim().equalsIgnoreCase(\"NANOSECONDS\"))\n    throw new IllegalArgumentException(\"precision NANOSECONDS is unsupported; use MICROSECONDS\");","typeGuard":null,"tryCatchPattern":"try { archiver = CommitLogArchiver.construct(); }\ncatch (RuntimeException e) {\n    if (\"NANOSECONDS level precision is not supported.\".equals(e.getMessage()))\n        log.error(\"Set precision to MICROSECONDS or lower\", e);\n    throw e;\n}","preventionTips":["Never set precision to NANOSECONDS in commitlog_archiving.properties","Whitelist supported precision values in config tooling","Rely on the MICROSECONDS default unless a coarser unit is intended"],"tags":["cassandra","commitlog","configuration","unsupported"],"backgroundTag":"unsupported-config-value","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"}