Store v1: Report writes refused because the journal can't be trimmed #181

Open
koolkhel wants to merge 3 commits from koolkhel/vitastor:v1-journal-full-log into master
Contributor

Description

The old store refuses writes with EAGAIN when its journal is full and nothing in it can be flushed. That is by design since c35e1013, and clients retry such writes. But the only message about it is "Ran out of journal space" with log_level > 5, so an OSD can refuse writes for hours with nothing in its log.

  1. Store v1: Report writes refused because the journal can't be trimmed. When it happens, print a line at most once in 10 seconds, at any log level. The line gives used_start/next_free, the number of objects with unstable writes, and the oldest journal entry still in use:

    • an unstable oldest entry waits for its primary OSD to stabilize or roll it back, for example when its PG can't peer;
    • a stable one is a lost flush, a store bug.

    From test_write_no_space_eagain:
    Journal is full and nothing in it can be flushed, refusing writes with EAGAIN (used_start=00001000 next_free=000f9000, 4 objects with unstable writes, oldest entry 1:0 v1 unstable)

  2. Store v1: Test a write over a deletion which is being flushed. This is a regression test for 4ee30fa7 (#114), which went in without one. It holds the flusher's I/O so that a write lands on a deletion while that deletion is flushed, then writes 2000 x 4 KB to other objects through a 1 MB journal.

    • Before 4ee30fa7, 1867 of them fail with EAGAIN and the write over the deletion is never flushed. The new report then prints 0 objects with unstable writes, oldest entry 1:0 v1 stable.
    • With it, none fail.

Tested: test_blockstore_v1 passes.

Contributor Name

Yury Luneff (MIND Software LLC, https://mindsw.io)

CLA

### Description The old store refuses writes with EAGAIN when its journal is full and nothing in it can be flushed. That is by design since c35e1013, and clients retry such writes. But the only message about it is "Ran out of journal space" with log_level > 5, so an OSD can refuse writes for hours with nothing in its log. 1. **Store v1: Report writes refused because the journal can't be trimmed.** When it happens, print a line at most once in 10 seconds, at any log level. The line gives used_start/next_free, the number of objects with unstable writes, and the oldest journal entry still in use: - an **unstable** oldest entry waits for its primary OSD to stabilize or roll it back, for example when its PG can't peer; - a **stable** one is a lost flush, a store bug. From `test_write_no_space_eagain`: `Journal is full and nothing in it can be flushed, refusing writes with EAGAIN (used_start=00001000 next_free=000f9000, 4 objects with unstable writes, oldest entry 1:0 v1 unstable)` 2. **Store v1: Test a write over a deletion which is being flushed.** This is a regression test for 4ee30fa7 (#114), which went in without one. It holds the flusher's I/O so that a write lands on a deletion while that deletion is flushed, then writes 2000 x 4 KB to other objects through a 1 MB journal. - Before 4ee30fa7, 1867 of them fail with EAGAIN and the write over the deletion is never flushed. The new report then prints `0 objects with unstable writes, oldest entry 1:0 v1 stable`. - With it, none fail. Tested: test_blockstore_v1 passes. ### Contributor Name Yury Luneff (MIND Software LLC, https://mindsw.io) ### CLA - [x] I accept Vitastor CLA agreement: https://git.yourcmc.ru/vitalif/vitastor/src/branch/master/CLA-en.md
koolkhel added 2 commits 2026-11-24 23:31:02 +03:00
The old store refuses writes with EAGAIN when its journal is full and
nothing in it can be flushed, and only logs it with log_level > 5.
Clients retry such writes, so an OSD could refuse writes for hours with
nothing in its log.

Print a line about it at most once in 10 seconds, with the number of
objects with unstable writes and the oldest journal entry still in use.
An unstable oldest entry waits for its primary OSD to stabilize or roll
it back, a stable one is a lost flush.
Before 4ee30fa7 such a write queued the deletion for flushing once more.
The stale queue entry hid the flush of the write itself, the write kept
the journal from being trimmed, and once the journal was full every
write failed with EAGAIN until a restart.
koolkhel added 1 commit 2026-11-25 05:56:29 +03:00
Without the journal trim held after the flush of the deletion, the flusher
drops the stale queue entry before the write over the deletion becomes
stable, and the test passes without testing anything.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u v1-journal-full-log:koolkhel-v1-journal-full-log
git checkout koolkhel-v1-journal-full-log
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vitalif/vitastor#181
No description provided.