CASSANDRA-14380: Tolerate EINVAL and ENOTSUP on directory fsync - #5148
Open
cheeeee wants to merge 1 commit into
Open
CASSANDRA-14380: Tolerate EINVAL and ENOTSUP on directory fsync#5148cheeeee wants to merge 1 commit into
cheeeee wants to merge 1 commit into
Conversation
In POSIX and Linux VFS (fs/sync.c: vfs_fsync_range), filesystems that do not implement directory synchronization (e.g. CephFS, NFS, GlusterFS, FUSE, OverlayFS in Kubernetes) return -EINVAL or -EOPNOTSUPP/ENOTSUP when fsync() is called on a directory descriptor. NativeLibrary.trySync() previously treated any non-zero return code as a catastrophic storage hardware error, unconditionally throwing FSWriteError. Under Cassandra's default disk_failure_policy (die or stop), this caused immediate JVM termination on startup or during the first memtable flush when deployed on Ceph or Kubernetes volumes. Following the proven practice of PostgreSQL (src/backend/storage/file/fd.c) and RocksDB (env/io_posix.cc), treat EINVAL and ENOTSUP as capability limitations of the underlying filesystem rather than fatal storage failures: log a rate-limited WARN via NoSpamLogger and do not escalate to FSWriteError. Physical disk write failures (EIO, EROFS, ENOSPC) remain strictly fatal. Define platform-resolved ENOTSUP and EINVAL constants in NativeLibrary to ensure clean portability across Linux and macOS/BSD. Fixes: CASSANDRA-14380
cheeeee
force-pushed
the
CASSANDRA-14380-trunk
branch
from
September 11, 2026 01:06
2c79ceb to
89d1dcb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Status: changes requested — not ready to merge
The published /dev/null test does not establish directory-fsync behavior, error propagation, or cross-platform support.
Verification correction
Earlier descriptions overstated correctness and/or test coverage. Those claims are withdrawn. AI-assisted source review has been performed; this is not maintainer approval. Previously mixed build artifacts are not accepted as verification evidence. Corrective changes and clean, targeted verification are in progress; the published head has not yet been replaced.
Published head under review:
89d1dcbfb4ba46a869696b7f8af5ef1fe0a0f52a.