Skip to content

zbd: when performing multi-threaded append writes to a zoned block device, write operations can occasionally fail #2032

@ywang-wnlo

Description

@ywang-wnlo

Please acknowledge the following before creating a ticket

Description of the bug:
The root cause is suspected to be that the zbd_info->num_write_zones counter is decremented too early at zbd_write_zone_put, before the opend-zone finish operation is fully complete at zbd_finish_zone

zbd.c:1523

	if (zbd_zone_remainder(zb) > 0 && zbd_zone_remainder(zb) < min_bs) {
		pthread_mutex_lock(&f->zbd_info->mutex);
		zbd_write_zone_put(td, f, zb);
		pthread_mutex_unlock(&f->zbd_info->mutex);
		dprint(FD_ZBD, "%s: finish zone %d\n",
		       f->file_name, zbd_zone_idx(f, zb));
		io_u_quiesce(td);
		zbd_finish_zone(td, f, zb);
		zone_unlock(zb);

fio version: branch master

Reproduction steps
maybe this job, bs should be larger than 4k to make sure into branch
zbd_zone_remainder(zb) > 0 && zbd_zone_remainder(zb) < min_bs

[global]
ioengine=XXX
zonemode=zbd
direct=1
thread=1
iodepth=64

[append1]
bs=32k
rw=randwrite        ; random zone
io_size=1%

[append2]
bs=32k
rw=randwrite        ; random zone
io_size=1%
offset=10%

Metadata

Metadata

Assignees

No one assigned

    Labels

    needreporterinfoWaiting on information from the issue reporter

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions