apache/cassandra · warning · UnsupportedOperationException

Cannot return epoch when accord.enabled = false in cassandra

Error message

Cannot return epoch when accord.enabled = false in cassandra.yaml

What it means

SupportAccordService.currentEpoch() throws UnsupportedOperationException ('Cannot return epoch when accord.enabled = false') because the Accord topology epoch only exists when Accord is running. Without Accord there is no epoch source, so the stub refuses to return a value rather than returning misleading data like 0.

Source

Thrown at src/java/org/apache/cassandra/service/accord/IAccordService.java:265

            return List.of();
        }

        @Override
        public @Nonnull IAccordResult<TxnResult> coordinateAsync(long minEpoch, long minHlc, @Nonnull Txn txn, @Nonnull ConsistencyLevel consistencyLevel, RequestTime requestTime)
        {
            throw new UnsupportedOperationException("No accord transaction should be executed when accord.enabled = false in cassandra.yaml");
        }

        @Override
        public boolean isEnabled()
        {
            return false;
        }

        @Override
        public long currentEpoch()
        {
            throw new UnsupportedOperationException("Cannot return epoch when accord.enabled = false in cassandra.yaml");
        }

        @Override
        public void setCacheSize(long kb) { }

        @Override
        public void setWorkingSetSize(long kb) {}

        @Override
        public TopologyManager topology()
        {
            throw new UnsupportedOperationException("Cannot return topology when accord.enabled = false in cassandra.yaml");
        }

        @Override
        public void localStartup()
        {
            try

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Check isEnabled() before reading currentEpoch and report ' Accord disabled' instead of calling
  2. Enable Accord in cassandra.yaml if epoch reporting is required
  3. Update monitoring/health-check code to treat a disabled Accord as a valid state, not an error path
  4. Capture the UnsupportedOperationException and degrade the metric gracefully

Example fix

// before
long epoch = accordService.currentEpoch();
// after
long epoch = accordService.isEnabled() ? accordService.currentEpoch() : -1;
Defensive patterns

Strategy: fallback

Validate before calling

long epoch = accordService.isEnabled() ? accordService.currentEpoch() : -1;

Type guard

Long safeCurrentEpoch(IAccordService s) { return s.isEnabled() ? s.currentEpoch() : null; }

Try / catch

try { return accordService.currentEpoch(); } catch (UnsupportedOperationException e) { return -1L; }

Prevention

When it happens

Trigger: Calling IAccordService.currentEpoch() on a node with accord.enabled=false, e.g. from JMX/monitoring, node-tool output, or internal code computing Accord timestamps.

Common situations: Monitoring dashboards scraping Accord epoch metrics on clusters where Accord was never enabled; health checks that unconditionally query currentEpoch; config change disabling Accord while epoch-based logic still runs.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/a9d6e23440d2e689. Report an issue: GitHub.