{"record":{"id":"d60fc717878d8474","repo":"apache/cassandra","slug":"mutations-look-to-have-different-time-sources-som","errorCode":null,"errorMessage":"Mutations look to have different time sources, some are using 'USING TIMESTAMP' and others are using the server timestamp; writes to the Accord table will not be linearizable while using transactions.  To allow this behavior set accord.mixed_time_source_handling=log or ignore","messagePattern":"Mutations look to have different time sources, some are using 'USING TIMESTAMP' and others are using the server timestamp; writes to the Accord table will not be linearizable while using transactions\\.  To allow this behavior set accord\\.mixed_time_source_handling=log or ignore","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/service/StorageProxy.java","lineNumber":1365,"sourceCode":"            catch (Exception t)\n            {\n                // Unexpected error so it would be helpful to have details\n                Tracing.trace(\"{}\", getStackTraceAsToString(t));\n                throw t;\n            }\n            break;\n        }\n    }\n\n    private static void checkMixedTimeSourceHandling()\n    {\n        AccordConfig.MixedTimeSourceHandling handling = DatabaseDescriptor.getAccord().mixedTimeSourceHandling;\n        switch (handling)\n        {\n            case log:\n            case reject:\n            {\n                ClientWarn.instance.warn(UNSAFE_MIXED_MUTATIONS_MSG);\n                logger.warn(UNSAFE_MIXED_MUTATIONS_MSG);\n                if (handling == AccordConfig.MixedTimeSourceHandling.reject)\n                    throw new InvalidRequestException(UNSAFE_MIXED_MUTATIONS_MSG);\n            }\n            break;\n            case ignore:\n                // ignore\n                break;\n        }\n    }\n\n    private static ConsistencyLevel consistencyLevelForBatchLog(ConsistencyLevel consistencyLevel, boolean requireQuorumForRemove)\n    {\n        // If we are requiring quorum nodes for removal, we upgrade consistency level to QUORUM unless we already\n        // require ALL, or EACH_QUORUM. This is so that *at least* QUORUM nodes see the update.\n        ConsistencyLevel batchConsistencyLevel = requireQuorumForRemove\n                                                 ? ConsistencyLevel.QUORUM\n                                                 : consistencyLevel;","sourceCodeStart":1347,"sourceCodeEnd":1383,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/StorageProxy.java#L1347-L1383","documentation":"Accord transactions require all mutations in a write to use a consistent time source. Mixing mutations that carry an explicit 'USING TIMESTAMP' with mutations using the server-assigned timestamp breaks linearizability guarantees. When accord.mixed_time_source_handling is 'log', the warning is issued both to the client (ClientWarn) and the server log; when 'reject', it also throws InvalidRequestException. This index is the ClientWarn.instance.warn(...) emission.","triggerScenarios":"An Accord transaction batch contains some mutations with client-supplied timestamps (USING TIMESTAMP) and some with default server timestamps, while DatabaseDescriptor.getAccord().mixedTimeSourceHandling is log or reject.","commonSituations":"Application code partially migrated to Accord transactions where some statements still use USING TIMESTAMP; ORMs or drivers injecting timestamps inconsistently; default config where the operator never set mixed_time_source_handling.","solutions":["Make all mutations in Accord transactions use the same time source — drop USING TIMESTAMP so server timestamps apply","Alternatively supply explicit timestamps for every mutation in the transaction","If intentionally accepting the risk, set accord.mixed_time_source_handling: ignore in cassandra.yaml","If reject is desired for safety, keep the setting but fix the offending client code to pass validation"],"exampleFix":"// before\nBEGIN TRANSACTION\n  INSERT INTO t (k,v) VALUES (1,1) USING TIMESTAMP 12345;\n  UPDATE t SET v=2 WHERE k=2;\nCOMMIT TRANSACTION\n\n// after\nBEGIN TRANSACTION\n  INSERT INTO t (k,v) VALUES (1,1);\n  UPDATE t SET v=2 WHERE k=2;\nCOMMIT TRANSACTION","handlingStrategy":"validation","validationCode":"// client-side: ensure all statements in an Accord transaction omit USING TIMESTAMP\nfor (Statement st : transactionStatements) {\n    if (st.getTimestamp() != null)\n        throw new IllegalArgumentException(\"USING TIMESTAMP not allowed in Accord transaction: \" + st);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Standardize on server timestamps for transactional writes","Review driver timestamp-generator settings before adopting Accord","Keep mixed_time_source_handling at log or reject in prod to surface violations"],"tags":["accord","transactions","timestamps","lwt"],"backgroundTag":"conflicting-config-options","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}