axboe / fio

Flexible I/O Tester
GNU General Public License v2.0
5.22k stars 1.26k forks source link

fsync is not working properly with nrfiles #1677

Open Tulsishah opened 10 months ago

Tulsishah commented 10 months ago

When nrfiles is set to 2 and fsync is set to 1, the sync system call is only executed after each write operation for the first file. This results in the following pattern for the first file:

Write
Sync
Write
Sync
Write
Sync

For the second file, the sync system call is not executed after each write operation.

Write
Write
Write
Flush

When nrfiles is increased to 3, the sync system call is only executed after each write operation for the first two file. The third file is not subject to any sync calls.

In summary, the sync behavior for files is determined by the value of nrfiles. When nrfiles is set to 1, all files are synced after each write operation. When nrfiles is greater than 1, only the first nrfiles-1 files are synced after each write operation.

e.g.

nrfiles=3
fsync=1
filesize=3M
bs=1M

calls for 1st file 8UFDmtBkLggvkmV

calls for 2nd file AMUwWEaqTcvhwhT

calls for 3rd file 3JCi5A8J3hYLXJg

Tulsishah commented 10 months ago

Is there any update on this bug?