apache/cassandra · error · ConfigurationException
fast_path must be set to 'keyspace' or 'default' or a map…
Error message
fast_path must be set to 'keyspace' or 'default' or a map defining '%s' and optionally '%s'
What it means
ParameterizedFastPathStrategy.fromMap throws a ConfigurationException when the fast_path option is a map but lacks the required 'size' key. A map-valued fast_path must define 'size' and optionally 'dcs'; without 'size' the strategy cannot be constructed, and the message states the accepted forms ('keyspace', 'default', or such a map).
Solutions
- Add the required size key with a positive integer, e.g. {fast_path: {'size':'4', 'dcs':'dc1:1'}}
- Check for key spelling/case errors ('size' exactly)
- If no parameterization is needed, use the string forms fast_path='keyspace' or fast_path='default' instead of a map
Example fix
// before
ALTER KEYSPACE ks WITH options = {fast_path: {'dcs':'dc1:1'}}
// after
ALTER KEYSPACE ks WITH options = {fast_path: {'size':'4', 'dcs':'dc1:1'}} Defensive patterns
Strategy: validation
Validate before calling
if (!map.containsKey("size"))
throw new IllegalArgumentException("fast_path map requires 'size'; got keys: " + map.keySet());
Integer.parseInt(map.get("size")); // also fail fast on non-numeric size Try / catch
try { applyFastPathOption(opts); } catch (org.apache.cassandra.exceptions.ConfigurationException e) {
if (e.getMessage().contains("fast_path must be set"))
log.error("Map-valued fast_path must define 'size' (and optionally 'dcs')");
} Prevention
- Always build fast_path maps from a helper that requires size
- Check key spelling/case ('size' exactly)
- Use the plain string forms 'keyspace'/'default' when no parameterization is needed
- Copy from documented examples rather than partial snippets
When it happens
Trigger: Setting a keyspace/table fast_path option to a map that contains only 'dcs' (or other keys) without 'size', e.g. {fast_path: {'dcs':'dc1'}}.
Common situations: Typo'd key ('sizes', 'Size') instead of 'size'; operator assuming dcs alone suffices; copying a partial example; camelCasing when serializing options through a tool that alters keys.
Understand the failure class
Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.
Related errors
- accord.cache_size option was set incorrectly to
- accord.journal_directory must not be the same as any…
- Cannot change transactional mode to
- dc name must not be empty
- DC weights must be zero or positive
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/bc105a67cc30647a.
Report an issue: GitHub.
Appendix: source
Thrown at src/java/org/apache/cassandra/service/accord/topology/ParameterizedFastPathStrategy.java:244
Node.Id[] array = new Node.Id[fpSize];
for (int i=0; i<fpSize; i++)
array[i] = sorters.get(i).id;
Arrays.sort(array);
SortedArrayList<Node.Id> electorate = new SortedArrayList<>(array);
Invariants.require(electorate.size() >= slowQuorum);
return electorate;
}
private static ConfigurationException cfe(String fmt, Object... args)
{
return new ConfigurationException(String.format(fmt, args));
}
public static ParameterizedFastPathStrategy fromMap(Map<String, String> map)
{
if (!map.containsKey(SIZE))
throw cfe("fast_path must be set to 'keyspace' or 'default' or a map defining '%s' and optionally '%s'", SIZE, DCS);
int size;
try
{
size = Integer.parseInt(map.get(SIZE));
}
catch (NumberFormatException e)
{
throw cfe("%s must be a positive number, got %s", SIZE, map.get(SIZE));
}
if (size < 1)
throw cfe("%s must be greater than zero", SIZE);
ImmutableMap<String, WeightedDc> dcMap;
if (map.containsKey(DCS) && !map.get(DCS).isEmpty())
{
Map<String, WeightedDc> mutableDcs = new HashMap<>();View on GitHub (pinned to 88fd0f6a0e)