Merged
Conversation
when an AOF write fails with ENOSPC (disk full), the shard now sets a `disk_full` flag that rejects all subsequent write commands with an explicit error message. reads and admin commands still work so operators can inspect and recover. the flag clears automatically when a periodic fsync succeeds (every 1s for the EverySec policy) or when a normal AOF write recovers, so the server resumes accepting writes as soon as disk space is freed. changes: - add `is_write()` method to ShardRequest for classifying mutations - add `disk_full` flag to shard state and ProcessCtx - check flag before dispatching write commands in process_single - `log_aof_error` now returns whether the error was disk-full - set flag on ENOSPC, clear on recovery in both process_single and fsync tick paths - propagate disk_full through write_aof_record for blocking pop ops
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.
summary
when AOF writes fail with ENOSPC (disk full), the shard now rejects subsequent write commands with
ERR disk full, write rejected — free disk space to resume writes. reads and admin commands continue working so operators can inspect and recover. the flag auto-clears when disk space becomes available (detected on the periodic fsync tick or the next successful AOF write).what was tested
cargo test --workspace --exclude ember-integration-tests)emberkv-coreis_write_classifies_correctlytest validates the read/write classificationdesign considerations
disk_fullflag is a simpleboolper shard (notAtomicBool) since the shard runs single-threaded — no synchronization overhead on the hot pathlog_aof_errornow returnsboolindicating disk-full, keeping the detection logic in one placeis_write()onShardRequestuses an explicit match to be future-proof — new variants that aren't listed default to read (safe default)write_aof_recordfor consistency