CASSANDRA-14380 Tolerate unsupported fsync only for kernel-verified directory descriptors - #5148
Open
cheeeee wants to merge 1 commit into
Open
CASSANDRA-14380 Tolerate unsupported fsync only for kernel-verified directory descriptors#5148cheeeee wants to merge 1 commit into
cheeeee wants to merge 1 commit into
Conversation
cheeeee
force-pushed
the
CASSANDRA-14380-trunk
branch
from
September 11, 2026 01:06
2c79ceb to
89d1dcb
Compare
Resolve supported capability errno values for the host platform and keep unknown values and ordinary descriptor failures strict. Route directory sync callers explicitly and preserve primary sync failures when descriptor cleanup also fails. CASSANDRA-14380 Generated-by: Claude (Anthropic)
cheeeee
force-pushed
the
CASSANDRA-14380-trunk
branch
from
September 11, 2026 22:51
89d1dcb to
2973a43
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.
CASSANDRA-14380: on a filesystem whose directories do not support fsync (the report is a Rook/Ceph
volume) directory fsync fails with EINVAL, NativeLibrary.trySync raises FSWriteError, and the disk
failure policy stops the node. On Linux, fsync returns EINVAL when the file's operations have no
fsync at all; writeback errors are reported as EIO/ENOSPC/EDQUOT, never as EINVAL or ENOTSUP.
Changes:
that fails with EINVAL, ENOTSUP or EOPNOTSUPP is logged once per directory per 10 minutes and
otherwise ignored. Every other errno, and every error on a non-directory descriptor (trySync(fd) is
unchanged), still raises FSWriteError.
platform table does not define is never matched, so no value from another platform is used. On AIX
the jnr table has no ENOTSUP, so only EINVAL and EOPNOTSUPP are tolerated there.
a directory (ENOTDIR otherwise). O_DIRECTORY is resolved through jnr and then verified once at class
initialization: opening java.io.tmpdir with it must succeed and opening a regular file with it must
fail with ENOTDIR. If the verification fails or the constant is unavailable (Windows), O_DIRECTORY is
treated as 0 and the tolerance is disabled entirely, i.e. the behaviour stays strict.
even when the sync throws, via Throwables.maybeFail) and Accord ReplayMarkers. SyncUtil.trySyncDir
forwards to the new method.
Testing:
for a plain descriptor; EIO/EBADF still fail for both; the warning names the directory and two
directories are both reported within one window; tryOpenDirectory on a regular file returns -1; the
descriptor is closed when fsync fails and the fsync failure is kept as the primary exception when
close also fails; plus the existing skip-cache and pid tests.
and EINVAL on /proc (a directory whose operations have no fsync); open(O_RDONLY | O_DIRECTORY) on a
regular file returns ENOTDIR on all four.
precisely because jnr's per-architecture flag tables do not cover every platform, and it was only
exercised on x86_64 Linux.
CASSANDRA-14380