From: Adam Kupczyk Date: Fri, 10 Mar 2023 07:53:27 +0000 (+0100) Subject: os/bluestore: BlueFS: harmonize log read and writes modes X-Git-Tag: v18.1.0~204^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=672a15e0600713de36f72fcdfddebda73c1745b6;p=ceph-ci.git os/bluestore: BlueFS: harmonize log read and writes modes BlueFS log has always been written in non-buffered mode. Reading of it depends on bluefs_buffered_io option. It is strongly suspected that this causes some wierd problems. Possibly fixes: https://tracker.ceph.com/issues/54019 Signed-off-by: Adam Kupczyk --- diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index fc0e906e9c2..3dc9199f598 100644 --- a/src/os/bluestore/BlueFS.cc +++ b/src/os/bluestore/BlueFS.cc @@ -2219,13 +2219,16 @@ int64_t BlueFS::_read( << std::hex << x_off << "~" << l << std::dec << " of " << *p << dendl; int r; + // when reading BlueFS log (only happens on startup) use non-buffered io + // it makes it in sync with logic in _flush_range() + bool use_buffered_io = h->file->fnode.ino == 1 ? false : cct->_conf->bluefs_buffered_io; if (!cct->_conf->bluefs_check_for_zeros) { r = _bdev_read(p->bdev, p->offset + x_off, l, &buf->bl, ioc[p->bdev], - cct->_conf->bluefs_buffered_io); + use_buffered_io); } else { r = _read_and_check( p->bdev, p->offset + x_off, l, &buf->bl, ioc[p->bdev], - cct->_conf->bluefs_buffered_io); + use_buffered_io); } logger->inc(l_bluefs_read_disk_count, 1); logger->inc(l_bluefs_read_disk_bytes, l);