fix-superblock-io-amplification #87

Merged
vitalif merged 1 commits from changwei.ye/vitastor:fix-superblock-io-amplification into master 2026-09-24 11:08:15 +03:00
Contributor

Description

fix-superblock-io-amplification

Commit df9a2850 introduced force_fsync to resolve the placement contract
conflict (EAGAIN) when a new metadata entry depends on a previous unsynced
entry that is already in-flight. However, it mistakenly grouped the
'force_fsync > 0' condition together with the Superblock Checkpoint logic.

As a result, every time the internal torn-write prevention mechanism
requested a force_fsync, the system inadvertently executed an expensive
trim_lsn() (updating the Superblock with RWF_DSYNC), causing unnecessary
write latency and I/O amplification during congested object updates.

This change minimally refactors the state machine to ensure trim_lsn() is
strictly bound to the intended journal_trim_interval, while force_fsync
only triggers the necessary fsync_buffer().

Contributor Name

Changwei Ye (Datatom, https://www.datatom.com/)

CLA

### Description fix-superblock-io-amplification Commit df9a2850 introduced force_fsync to resolve the placement contract conflict (EAGAIN) when a new metadata entry depends on a previous unsynced entry that is already in-flight. However, it mistakenly grouped the 'force_fsync > 0' condition together with the Superblock Checkpoint logic. As a result, every time the internal torn-write prevention mechanism requested a force_fsync, the system inadvertently executed an expensive trim_lsn() (updating the Superblock with RWF_DSYNC), causing unnecessary write latency and I/O amplification during congested object updates. This change minimally refactors the state machine to ensure trim_lsn() is strictly bound to the intended journal_trim_interval, while force_fsync only triggers the necessary fsync_buffer(). ### Contributor Name Changwei Ye (Datatom, https://www.datatom.com/) ### CLA - [x] I accept Vitastor CLA agreement: https://git.yourcmc.ru/vitalif/vitastor/src/branch/master/CLA-en.md
changwei.ye added 1 commit 2026-09-14 13:02:51 +03:00
Commit df9a2850 introduced force_fsync to resolve the placement contract
conflict (EAGAIN) when a new metadata entry depends on a previous unsynced
entry that is already in-flight. However, it mistakenly grouped the
'force_fsync > 0' condition together with the Superblock Checkpoint logic.

As a result, every time the internal torn-write prevention mechanism
requested a force_fsync, the system inadvertently executed an expensive
trim_lsn() (updating the Superblock with RWF_DSYNC), causing unnecessary
write latency and I/O amplification during congested object updates.

This change minimally refactors the state machine to ensure trim_lsn() is
strictly bound to the intended journal_trim_interval, while force_fsync
only triggers the necessary fsync_buffer().
changwei.ye requested review from vitalif 2026-09-14 13:16:54 +03:00
vitalif approved these changes 2026-09-24 11:08:05 +03:00
vitalif merged commit 6d1b9165a2 into master 2026-09-24 11:08:15 +03:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vitalif/vitastor#87
No description provided.