apache/cassandra · warning

Non-fatal checksum error reading saved cache {}: {}

Error message

Non-fatal checksum error reading saved cache {}: {}

What it means

A warning logged when loading a saved key cache/row cache file fails a checksum (CorruptFileException). Cassandra treats saved caches as an optimization only: the corrupt file is discarded, JVMStabilityInspector inspects the throwable, and startup continues with an empty cache. It is deliberately non-fatal.

Source

Thrown at src/java/org/apache/cassandra/cache/AutoSavingCache.java:274

                        }

                        if (futures.size() > 1000)
                            Thread.yield();
                    } while(futures.size() > 1000);
                }

                Future<Pair<K, V>> future = null;
                while ((future = futures.poll()) != null)
                {
                    Pair<K, V> entry = future.get();
                    if (entry != null && entry.right != null)
                        put(entry.left, entry.right);
                }
            }
            catch (CorruptFileException e)
            {
                JVMStabilityInspector.inspectThrowable(e);
                logger.warn("Non-fatal checksum error reading saved cache {}: {}", dataPath.absolutePath(), e.getMessage());
            }
            catch (Throwable t)
            {
                JVMStabilityInspector.inspectThrowable(t);
                logger.info("Harmless error reading saved cache {}: {}", dataPath.absolutePath(), t.getMessage());
            }
            finally
            {
                FileUtils.closeQuietly(in);
                cacheLoader.cleanupAfterDeserialize();
            }
        }
        if (logger.isTraceEnabled())
            logger.trace("completed reading ({} ms; {} keys) saved cache {}",
                         TimeUnit.NANOSECONDS.toMillis(nanoTime() - start), count, dataPath);
        return count;
    }

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. No action strictly required — the node rebuilds the cache in memory; verify with nodetool info that key-cache/row-cache entries repopulate.
  2. Delete the corrupt file from the saved_caches directory if the warning repeats, so it is regenerated cleanly.
  3. Check disk/filesystem health (dmesg, fsck) since checksum failures can indicate hardware issues.
  4. Avoid killing the node uncleanly; prefer graceful shutdown (nodetool drain then stop) to get consistent cache saves.

Example fix

// before (recurring corruption)
# leave stale cache file in place
// after
rm /var/lib/cassandra/saved_caches/*-key-cache-* && restart node to regenerate
Defensive patterns

Strategy: try-catch

Validate before calling

// before relying on saved caches, check the file parses
File f = new File(savedCachesDir, "KeyCache");
if (f.length() == 0 || !f.canRead()) logger.warn("saved cache missing/truncated: {}", f);

Try / catch

try {
    cache.loadSaved();
} catch (CorruptFileException e) {
    logger.warn("Discarding corrupt saved cache, continuing with cold cache", e);
}

Prevention

When it happens

Trigger: Node restart with saved_cache enabled where the cache file in saved_caches_directory is truncated or corrupted — e.g. unclean shutdown (power loss / kill -9) mid-write, disk corruption, filesystem truncation, or manual copy of cache files between nodes.

Common situations: After a hard crash or OOM kill, cache files on disk are incomplete; moving cache files across nodes with different data (checksum no longer valid); corrupted storage medium; upgrading with stale cache files.

Understand the failure class

Background: Checksum mismatch errors: "checksum verification failed", "digest mismatch", "expected vs actual checksum" — what they mean and how to fix them — this error's family across 41 libraries.

Related errors


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