apache/cassandra · error · IllegalArgumentException

Invalid pair: '%s'

Error message

Invalid pair: '%s'

What it means

CommitLogReplayer.create parses the cassandra.commitlog_replay_list property (replayList) into a keyspace/table multimap. Each comma-separated entry is trimmed; if an entry is empty or ends with a dot (implying a missing table), an IllegalArgumentException 'Invalid pair: <entry>' is thrown before replay begins.

Source

Thrown at src/java/org/apache/cassandra/db/commitlog/CommitLogReplayer.java:406

        /**
         * Creates filter for entities to replay mutations for upon commit log replay.
         *
         * @see org.apache.cassandra.config.CassandraRelevantProperties#COMMIT_LOG_REPLAY_LIST
         * */
        public static ReplayFilter create()
        {
            String replayList = COMMIT_LOG_REPLAY_LIST.getString();

            if (replayList == null)
                return new AlwaysReplayFilter();

            Multimap<String, String> toReplay = HashMultimap.create();
            for (String rawPair : replayList.split(","))
            {
                String trimmedRawPair = rawPair.trim();
                if (trimmedRawPair.isEmpty() || trimmedRawPair.endsWith("."))
                    throw new IllegalArgumentException(format("Invalid pair: '%s'", trimmedRawPair));

                String[] pair = StringUtils.split(trimmedRawPair, '.');

                if (pair.length > 2)
                    throw new IllegalArgumentException(format("%s property contains an item which " +
                                                              "is not in format 'keyspace' or 'keyspace.table' " +
                                                              "but it is '%s'",
                                                              COMMIT_LOG_REPLAY_LIST.getKey(),
                                                              String.join(".", pair)));

                String keyspaceName = pair[0];

                Keyspace ks = Schema.instance.getKeyspaceInstance(keyspaceName);
                if (ks == null)
                    throw new IllegalArgumentException("Unknown keyspace " + keyspaceName);

                if (pair.length == 1)
                {

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Remove trailing commas and trailing dots from the cassandra.commitlog_replay_list value.
  2. Ensure each entry is exactly 'keyspace' or 'keyspace.table', e.g. 'ks1,ks2.tbl1'.
  3. If replaying everything, unset cassandra.commitlog_replay_list instead of passing an empty item.
  4. Validate the list programmatically before restart: split on ',', trim, and assert no empty or dot-terminated entries.

Example fix

// before
-Dcassandra.commitlog_replay_list=ks1.,ks2   // IllegalArgumentException: Invalid pair: 'ks1.'
// after
-Dcassandra.commitlog_replay_list=ks1,ks2
Defensive patterns

Strategy: validation

Validate before calling

for (String item : replayList.split(",")) {
    String t = item.trim();
    if (t.isEmpty() || t.endsWith("."))
        throw new IllegalArgumentException("Bad replay list item: '" + t + "'");
}

Try / catch

try { CommitLogReplayer.create(...); } catch (IllegalArgumentException e) { logger.error("Bad commitlog_replay_list: {}", e.getMessage()); }

Prevention

When it happens

Trigger: Starting a node with -Dcassandra.commitlog_replay_list=KS1., or ',KS1', or double commas — i.e. any comma-separated item that is blank or ends in '.'.

Common situations: Hand-editing the replay list with trailing commas or a trailing dot after a keyspace name, script-generated option strings with empty entries, or copy/paste errors in operational runbooks.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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