{"record":{"id":"d984292c1ad3c365","repo":"apache/cassandra","slug":"too-many-accord-trace-events-stored-already-delet","errorCode":null,"errorMessage":"Too many Accord trace events stored already; delete some to continue tracing","messagePattern":"Too many Accord trace events stored already; delete some to continue tracing","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/service/accord/debug/AccordTracing.java","lineNumber":876,"sourceCode":"                txnIds.clear();\n                slowest.clear();\n                slowestLookup.clear();\n                detachedEvents.clear();\n            }\n            for (TxnId txnId : untrace)\n                untrace(txnId);\n        }\n    }\n\n    static class GlobalCount extends AtomicInteger\n    {\n        public boolean admit()\n        {\n            if (incrementAndGet() <= MAX_EVENTS)\n                return true;\n\n            decrementAndGet();\n            ClientWarn.instance.warn(\"Too many Accord trace events stored already; delete some to continue tracing\");\n            noSpamLogger.warn(\"Too many Accord trace events stored already; delete some to continue tracing\");\n            return false;\n        }\n    }\n\n    private static final AtomicLong lastNowMicros = new AtomicLong();\n    private static long uniqueNowMicros()\n    {\n        long nowMicros = Clock.Global.currentTimeMillis() * 1000;\n        while (true)\n        {\n            long last = lastNowMicros.get();\n            if (last >= nowMicros)\n                return lastNowMicros.incrementAndGet();\n            if (lastNowMicros.compareAndSet(last, nowMicros))\n                return nowMicros;\n        }\n    }","sourceCodeStart":858,"sourceCodeEnd":894,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/accord/debug/AccordTracing.java#L858-L894","documentation":"AccordTracing.admit() enforces a cap (MAX_EVENTS) on stored Accord trace events. Once the in-memory/trace store already holds the maximum, further events are rejected (this call returns false), a client warning is sent to the querying session, and a throttled server-side warning is logged. Tracing stops accumulating new events until old ones are deleted.","triggerScenarios":"Running Accord trace sessions (via nodetool/JMX trace commands on Accord transactions) without deleting prior trace events until MAX_EVENTS is reached; every subsequent admit() rejects the event.","commonSituations":"Long-running tracing left enabled across many transactions; debugging sessions that collect the full event budget and then try to trace more; forgetting to clear/reset the trace store between investigations.","solutions":["Delete/expire existing stored Accord trace events (via the trace management commands/JMX) to free capacity before tracing again","Increase the trace event cap if the deployment has memory headroom","Stop/finish the trace session when done so events stop accumulating","Reduce tracing scope (fewer transactions/shorter duration) so fewer events are produced"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// before starting a trace, check capacity\nif (traceEventStore.count() >= MAX_EVENTS)\n    clearStoredTraceEvents();","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Delete stored trace events after each debugging session","Treat ClientWarn messages about trace capacity as a signal to purge events","Limit trace duration/scope to stay under MAX_EVENTS"],"tags":["accord","tracing","limit-exceeded"],"backgroundTag":"rate-limit-exceeded","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"}