]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
librbd: Fix local rbd mirror journals growing forever
authorJosef Johansson <josef@oderland.se>
Mon, 2 Jan 2023 13:12:53 +0000 (14:12 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Fri, 3 Mar 2023 18:12:10 +0000 (19:12 +0100)
commitba6c6d5fa8c5dea3959cbe55c4662f5adea5a30c
treecd73eba31e8bd10ce0685415ded6390ac283ddd2
parentceb65b44421decdc47b515f4a108991f3c882292
librbd: Fix local rbd mirror journals growing forever

This commit fixes commit 7ca1bab90f3 by pushing properly aligned
discards back to m_image_extents, if corrected.

If discards are misaligned (off 0, len 4608, gran=4096), they are
corrected properly, but only in object_extents and not in
m_image_extents.

When journal_append_event is triggered it will only append from
m_image_extents and does not now about the alignment fixes. In
commit_io_events_extent it will log a message and return without
completing the io since the larger misaligned area was sent to the journal.
This will in turn break rbd journal mirroring since the local client will wait
indefinately on the commit to be completed, which it never does.

This does not effect rbd-mirror in any way, which may be confusing and
dangerous since it's only rbd-mirror that updates ceph health, and not
the local client.

Setting `rbd_skip_partial_discard = false` under client will restore the
pre 7ca1bab behaviour and thus not trigger the bug with journals growing.
This will set `rbd_discard_granularity_bytes = 0` internally. This
setting is only changed during startup of a client.

Fixes: 7ca1bab90f3db3aaaa4cdbfc1f18e9f5cfbf5568
Fixes: https://tracker.ceph.com/issues/57396
Signed-off-by: Josef Johansson <josef@oderland.se>
(cherry picked from commit 21a26a752843295ff946d1543c2f5f9fac764593)

Conflicts:
src/librbd/io/ImageRequest.cc [ commit b2c88820923e ("librbd:
  return area from extents_to_file()") not in quincy ]
src/test/librbd/io/test_mock_ImageRequest.cc [ commit
  b9a2384cdc43 ("librbd: propagate area down to
  file_to_extents()") not in quincy ]
qa/workunits/rbd/rbd-nbd.sh
src/librbd/io/ImageRequest.cc
src/test/librbd/io/test_mock_ImageRequest.cc