{"record":{"id":"7a6f1101018de5bc","repo":"apache/cassandra","slug":"a-local-deletion-time-should-not-be-a-legacy-overf","errorCode":null,"errorMessage":"A local deletion time should not be a legacy overflowed value","messagePattern":"A local deletion time should not be a legacy overflowed value","errorType":"validation","errorClass":"MarshalException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/db/rows/AbstractCell.java","lineNumber":193,"sourceCode":"            digest.updateWithCounterContext(value(), accessor());\n        else\n            digest.update(value(), accessor());\n\n        digest.updateWithLong(timestamp())\n              .updateWithInt(ttl())\n              .updateWithBoolean(isCounterCell());\n        if (path() != null)\n            path().digest(digest);\n    }\n\n    public void validate()\n    {\n        if (ttl() < 0)\n            throw new MarshalException(\"A TTL should not be negative\");\n        if (localDeletionTime() < 0)\n            throw new MarshalException(\"A local deletion time should not be negative\");\n        if (localDeletionTime() == INVALID_DELETION_TIME)\n            throw new MarshalException(\"A local deletion time should not be a legacy overflowed value\");\n        if (isExpiring() && localDeletionTime() == NO_DELETION_TIME)\n            throw new MarshalException(\"Shoud not have a TTL without an associated local deletion time\");\n\n        // non-frozen UDTs require both the cell path & value to validate,\n        // so that logic is pushed down into ColumnMetadata. Tombstone\n        // validation is done there too as it also involves the cell path\n        // for complex columns\n        column().validateCell(this);\n    }\n\n    public boolean hasInvalidDeletions()\n    {\n        if (ttl() < 0 || localDeletionTime() == INVALID_DELETION_TIME || localDeletionTime() < 0 || (isExpiring() && localDeletionTime() == NO_DELETION_TIME))\n            return true;\n        return false;\n    }\n\n    public long maxTimestamp()","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/rows/AbstractCell.java#L175-L211","documentation":"Cells store localDeletionTime == INVALID_DELETION_TIME (a legacy sentinel that once meant an overflowed/unset value) as invalid. Modern Cassandra distinguishes NO_DELETION_TIME and uses real values otherwise; encountering the legacy sentinel during validate() indicates data written by a very old or broken encoder and is rejected with MarshalException.","triggerScenarios":"Reading SSTables written by legacy versions that used the overflow sentinel; cells whose localDeletionTime equals Integer.MIN_VALUE-derived legacy constants; corrupted data accidentally matching the sentinel.","commonSituations":"Upgrades from very old Cassandra versions (pre-2.1 era formats); hand-migrated SSTables; corruption repair attempts that re-wrote deletion times incorrectly.","solutions":["Scrub and rewrite the SSTables (`nodetool scrub`) to convert legacy values.","Complete the full upgrade path (do not skip major format upgrades) before reading data.","Restore data from a backup taken on a supported version.","Replace the affected cells by rewriting the rows (read/rewrite via CQL where possible)."],"exampleFix":"// before: accepting legacy sentinel\nif (ldt == INVALID_DELETION_TIME) ldt = NO_DELETION_TIME;\n// after: rewrite data through the modern writer instead of silently remapping\nif (ldt == INVALID_DELETION_TIME)\n    throw new MarshalException(\"legacy overflowed localDeletionTime, scrub required\");","handlingStrategy":"validation","validationCode":"if (cell.localDeletionTime() == INVALID_DELETION_TIME) throw new IllegalStateException(\"legacy overflowed localDeletionTime; rewrite data\");","typeGuard":"boolean isModernDeletionTime(AbstractCell<?> c) { return c.localDeletionTime() != INVALID_DELETION_TIME; }","tryCatchPattern":"try { row.validate(); } catch (MarshalException e) { scheduleScrub(keyspace, table); }","preventionTips":["Complete all major version upgrade steps before serving reads","Never hand-migrate SSTables between format eras","Rewrite legacy data via scrub after upgrade"],"tags":["validation","legacy-format","data-corruption","tombstone"],"backgroundTag":"schema-validation-failed","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"}