]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: BlueFS: harmonize log read and writes modes 50474/head
authorAdam Kupczyk <akupczyk@ibm.com>
Fri, 10 Mar 2023 07:53:27 +0000 (08:53 +0100)
committerRadosław Zarzyński <rzarzyns@redhat.com>
Fri, 10 Mar 2023 16:25:46 +0000 (17:25 +0100)
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 <akupczyk@ibm.com>
(cherry picked from commit 80e9c5d1c328448f0ef2a836c8a312296e6f49d7)

src/os/bluestore/BlueFS.cc

index a1bc6e99661b4b912e6c2086401878e80d6b5f90..64fbe1e88039f91155dc55b2d195293b1870f841 100644 (file)
@@ -2217,13 +2217,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);