{"record":{"id":"182dc51e64c04ef7","repo":"apache/cassandra","slug":"fswriteerror-182dc5","errorCode":null,"errorMessage":"FSWriteError","messagePattern":"FSWriteError","errorType":"exception","errorClass":"FSWriteError","httpStatus":null,"severity":"critical","filePath":"src/java/org/apache/cassandra/hints/HintsWriteExecutor.java","lineNumber":255,"sourceCode":"    private boolean flushInternal(Iterator<ByteBuffer> iterator, HintsWriter writer)\n    {\n        long maxHintsFileSize = DatabaseDescriptor.getMaxHintsFileSize();\n\n        try (HintsWriter.Session session = writer.newSession(writeBuffer))\n        {\n            while (iterator.hasNext())\n            {\n                session.append(iterator.next());\n\n                if (session.position() >= maxHintsFileSize)\n                    return false;\n            }\n\n            return true;\n        }\n        catch (IOException e)\n        {\n            throw new FSWriteError(e, writer.descriptor().fileName());\n        }\n    }\n}\n","sourceCodeStart":237,"sourceCodeEnd":259,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/hints/HintsWriteExecutor.java#L237-L259","documentation":"In HintsWriteExecutor.flushInternal, appending hints to the hints file raised IOException (disk full, I/O error, permissions). It is converted to FSWriteError(e, file) — Cassandra's standard fatal disk-write failure — because hints durability cannot be compromised; the flush aborts and the node typically fails/gossips the disk error.","triggerScenarios":"Flushing the hint buffer to disk fails: disk full, I/O error during write or fsync, file closed unexpectedly, or device errors on the hints volume.","commonSituations":"Hints volume filling up; failing disk; hints file descriptor invalidated by external deletion; storage latency/timeout causing fsync failure.","solutions":["Check disk space and health on the hints volume; clean space or move hints_directory","Inspect the wrapped IOException in the log to identify disk vs. descriptor issues","After fixing storage, restart the node (hint writers are re-opened and buffered hints may be lost — run repair to be safe)","Monitor hints directory usage and alert before it fills"],"exampleFix":"# check and free space on the hints volume\ndf -h /var/lib/cassandra/hints\nclean up or expand volume, then restart node and run nodetool repair","handlingStrategy":"try-catch","validationCode":"long usable = new File(hintsDirectory).getUsableSpace();\nif (usable < MIN_FREE_BYTES) { logger.warn(\"Hints volume low: {} bytes free\", usable); }","typeGuard":null,"tryCatchPattern":"try {\n    executor.flushBuffer();\n} catch (FSWriteError e) {\n    logger.error(\"Hints flush failed for {}: {}\", fileName, e.getCause());\n    // pause dispatch and page ops; run repair afterwards\n}","preventionTips":["Capacity-monitor the hints volume with alerts before full","Use healthy local disks for hints_directory","Don't delete hints files out from under the running node","Run repair after any hints flush failure"],"tags":["io","filesystem","hints","write","fsync"],"backgroundTag":"file-write-failed","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}