[Tarantool-patches] [PATCH] fio/coio: handle partial writes

Alexander Turenko alexander.turenko at tarantool.org
Wed May 6 20:08:18 MSK 2020


> issue https://github.com/tarantool/tarantool/issues/4651
> branch gorcunov/gh-4651-partial-write

> diff --git a/src/lib/core/coio_file.c b/src/lib/core/coio_file.c
> index e2345567c..e290214bc 100644
> --- a/src/lib/core/coio_file.c
> +++ b/src/lib/core/coio_file.c
> @@ -164,10 +164,30 @@ coio_file_close(int fd)
>  ssize_t
>  coio_pwrite(int fd, const void *buf, size_t count, off_t offset)
>  {

In Febrary ([1]) we start discussing whether the loop should be in fio
or in coio. coio_p?write() returns amount of written bytes, so it seems
logical to keep it performing one write and move the loop to
src/lua/fio.c.

To be honest, I don't sure here. If you have a reason to keep the logic
here, please, explain it.

I'll CC Vlad, maybe he has more strong vision here.

[1]: https://lists.tarantool.org/pipermail/tarantool-patches/2020-February/014403.html

> @@ -201,6 +221,11 @@ static void
>  coio_do_write(eio_req *req)
>  {
>  	struct coio_file_task *eio = (struct coio_file_task *)req->data;
> +
> +	ERROR_INJECT(ERRINJ_COIO_WRITE_CHUNK, {
> +		eio->write.count = 1;
> +	});

Why not set it right in coio_write() to don't spread the logic?

> diff --git a/test/app/fio.result b/test/app/fio.result
> index 783fa4fab..73fbd29e5 100644
> --- a/test/app/fio.result
> +++ b/test/app/fio.result
> @@ -776,6 +776,12 @@ file5 = fio.pathjoin(tree, 'file.5')
>  file6 = fio.pathjoin(tree, 'file.6')
>  ---
>  ...
> +file7 = fio.pathjoin(tree, 'file.7')
> +---
> +...
> +file8 = fio.pathjoin(tree, 'file.8')
> +---
> +...

Nit: SOP now requires to add a test file with gh-... name when fixing a
bug.


More information about the Tarantool-patches mailing list