]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
os/bluestore: allow main device expansion when DB needs space to 33989/head
authorIgor Fedotov <ifedotov@suse.com>
Fri, 20 Mar 2020 17:01:03 +0000 (20:01 +0300)
committerIgor Fedotov <ifedotov@suse.com>
Wed, 25 Mar 2020 21:59:35 +0000 (00:59 +0300)
commit69a43efccfd3289a3ffec1d76dc4b4a208e0ec0c
tree3e1fa16bb8693a388afcb708d57032c2cc895e39
parentdb6f3f66fcc28c3db2eba01611664676a820cb90
os/bluestore: allow main device expansion when DB needs space to
recover.

This patch provides a fix for an expansion "deadlock" state:
OSD is out of space at main disk and DB needs to recover and
flush some additional data to the disk. To expand the main device one needs
to alter freelist parameters in DB which in turn triggers DB recovery.
The following approach is used to fix that:
1) Major set of Freelist Manager's key parameters
(primarily actual size and block count) is kept at device label from now on.
2)Secondary replica of parameters set is preserved at DB mostly to permit
downgrades if any.
3) At first expansion procedure updates bdev label only. No updates to DB takes
place hence read-only mode for DB is enough to execute it.

4) On regular BlueStore mount (second stage of expantion does this as
well) DB is initially loaded in read-only.

5)Freelist manager is started and initiated with parameters from device label.
Original allocation bits are taken from DB, new ones (appeared after
expansion but not present in DB) are virtually treated by FM as free.
Allocator is initialed with expanded size accordingly.

6) DB is reopened in full access mode. During this process BlueFS is able
to request for additional space from main device. This still doesn't need
DB update as BlueFS tracks owned extents via internal logging, not
persisting this info at DB
Hence DB recovery if any completes successfully. DB is fully operational
at this point.

7) Freelist Manager sync function is called to
commit all the changes: expanded size, location bits adjustment for
old and new boundaries.
Regular allocations that needs DB update are operational at this point.
Store is ready.

Signed-off-by: Igor Fedotov <ifedotov@suse.com>
src/os/bluestore/BitmapFreelistManager.cc
src/os/bluestore/BitmapFreelistManager.h
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h
src/os/bluestore/FreelistManager.h