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()
{
tryView on GitHub (pinned to 88fd0f6a0e)
Solutions
- Check isEnabled() before reading currentEpoch and report ' Accord disabled' instead of calling
- Enable Accord in cassandra.yaml if epoch reporting is required
- Update monitoring/health-check code to treat a disabled Accord as a valid state, not an error path
- 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
- Treat 'Accord disabled' as valid state in monitoring, not an error
- Guard epoch readers with isEnabled()
- Use a sentinel value (e.g. -1) for epoch when Accord is off
- Avoid unconditional epoch queries in shared health-check code
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
- No accord transaction should be executed when accord.enabled
- Cannot return topology when accord.enabled = false in cassan
- Cannot return configuration when accord.enabled = false in c
- Chunk cache size cannot be changed.
- accord.journal_directory must not be the same as any data_fi
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/a9d6e23440d2e689.
Report an issue: GitHub.