Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fileio rndrw : FATAL: Failed to fsync file! file: 0 errno = 22 (Invalid argument) #400

Open
jojolope opened this issue Mar 3, 2021 · 4 comments · May be fixed by #518
Open

fileio rndrw : FATAL: Failed to fsync file! file: 0 errno = 22 (Invalid argument) #400

jojolope opened this issue Mar 3, 2021 · 4 comments · May be fixed by #518

Comments

@jojolope
Copy link

jojolope commented Mar 3, 2021

On a system installed with Oracle Linux 7 the rndwr tests are failing. (rndrd and the rest work fine)

/usr/local/bin/sysbench fileio cleanup > /dev/null
/usr/local/bin/sysbench fileio prepare >/dev/null
/usr/local/bin/sysbench fileio --warmup-time=30 --file-test-mode=rndrw --threads=8 --events=10000000 run
sysbench 1.1.0-bbee5d5 (using bundled LuaJIT 2.1.0-beta3)

Running the test with following options:
Number of threads: 8
Warmup time: 30s
Initializing random number generator from current time

Extra file open flags: (none)
128 files, 16MiB each
2GiB total file size
Block size 16KiB
Number of IO requests: 10000000
Read/Write ratio for combined random IO test: 1.50
Periodic FSYNC enabled, calling fsync() each 100 requests.
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random r/w test
Initializing worker threads...

Threads started!

Warming up for 30 seconds...

FATAL: Failed to fsync file! file: 0 errno = 22 (Invalid argument)

When I enable debug it shows:

DEBUG: Executing request, operation: 2, file_id: 86, pos: 15089664, size: 16384
DEBUG: Executing request, operation: 3, file_id: 127, pos: 0, size: 0
DEBUG: Executing request, operation: 1, file_id: 98, pos: 2785280, size: 16384
FATAL: Failed to fsync file! file: 0 errno = 22 (Invalid argument)
DEBUG: Executing request, operation: 1, file_id: 92, pos: 10747904, size: 16384
DEBUG: Executing request, operation: 2, file_id: 5, pos: 3211264, size: 16384
Done.

@Myshiner
Copy link

Myshiner commented Oct 8, 2021

I also got this errors, is anyone can comment ?

@rualark
Copy link

rualark commented Jun 16, 2022

Same error here

gilbsgilbs added a commit to gilbsgilbs/sysbench that referenced this issue Oct 22, 2023
This leads to creation of requests with incorrect file ids, which makes
fsync fail on a bad file descriptor when the request is handled.

fixes akopytov#400, fixes akopytov#430, fixes akopytov#431
gilbsgilbs added a commit to gilbsgilbs/sysbench that referenced this issue Oct 22, 2023
This was leading to creation of requests with incorrect file ids, which
was causing fsync to fail on a bad file descriptor when the request was
handled.

fixes akopytov#400, fixes akopytov#430, fixes akopytov#431
gilbsgilbs added a commit to gilbsgilbs/sysbench that referenced this issue Oct 22, 2023
This was leading to creation of requests with incorrect file ids, which
was causing fsync to fail on a bad file descriptor when the request was
handled.

fixes akopytov#400, fixes akopytov#430, fixes akopytov#431
gilbsgilbs added a commit to gilbsgilbs/sysbench that referenced this issue Oct 22, 2023
This was leading to creation of requests with incorrect file ids, which
was causing fsync to fail on a bad file descriptor when the request was
handled.

fixes akopytov#400, fixes akopytov#430, fixes akopytov#431
@gilbsgilbs
Copy link

I submitted what I think is a fix to this issue here: #518 . Any test/review is appreciated.

rli9 added a commit to intel/lkp-tests that referenced this issue Feb 22, 2024
…random test

The issue is like

	FATAL: Failed to fsync file! file: 0 errno = 22 (Invalid argument)

Link: akopytov/sysbench#400
Link: akopytov/sysbench#518
Signed-off-by: Philip Li <philip.li@intel.com>
rli9 added a commit to intel/lkp-tests that referenced this issue Feb 22, 2024
…random test

The issue is like

	FATAL: Failed to fsync file! file: 0 errno = 22 (Invalid argument)

Link: akopytov/sysbench#400
Link: akopytov/sysbench#518
Signed-off-by: Philip Li <philip.li@intel.com>
@jojolope
Copy link
Author

jojolope commented Apr 9, 2024

I've tested rndrw and rndwr using sysbench 1.0.20 and the issue was reproducible:

FATAL: Failed to fsync file! file: 0 errno = 22 (Invalid argument)

then I added SB_THREAD_MUTEX_UNLOCK(); in the line 491 of src/tests/fileio/sb_fileio.c and that seems to fix the issue:

`Test command: /usr/local/bin/sysbench fileio --file-test-mode=rndwr --warmup-time=30 --threads=2 --events=10000000 run
sysbench 1.1.0 (using bundled LuaJIT 2.1.0-beta3)

Running the test with following options:
Number of threads: 2
Warmup time: 30s
Initializing random number generator from current time

Extra file open flags: (none)
128 files, 16MiB each
2GiB total file size
Block size 16KiB
Number of IO requests: 10000000
Read/Write ratio for combined random IO test: 1.50
Periodic FSYNC enabled, calling fsync() each 100 requests.
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random write test
Initializing worker threads...

Threads started!

Warming up for 30 seconds...

Throughput:
read: IOPS=0.00 0.00 MiB/s (0.00 MB/s)
write: IOPS=2876.44 44.94 MiB/s (47.13 MB/s)
fsync: IOPS=3709.02

Latency (ms):
min: 0.00
avg: 0.30
max: 24.81
95th percentile: 1.08
sum: 19969.28
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants