Bug #24434
"invalid object map" flag may be not stored on disk
0%
Description
The case:
- Create an image with object map enabled.
- Make the image object map smaller than expected (e.g. using cls_client::object_map_resize).
- Open the image and acquire the lock.
- Test that when post acquiring the lock and loading the object map it has properly detected the smaller map size and set "invalid" flag.
- Refresh the image.
- The the "invalid" flag.
Expected result: "invalid" flag is set.
Observed result: "invalid" flag is cleared.
When in post acquire lock hook it detected the map is invalid, it sends invalidate request but it is invalided in memory only: it is invalidated on disk only if we are lock owner, but we are still not at that moment, because the lock state is still ACQUIRING, and it is updated to POST_ACQUIRING only when post_acquiring lock is completed.
2018-06-06 15:21:52.636 7f10c0ff9700 10 librbd::ManagedLock: 0x7f10b001d0e0 handle_acquire_lock: r=0 2018-06-06 15:21:52.636 7f10c0ff9700 5 librbd::ManagedLock: 0x7f10b001d0e0 handle_acquire_lock: successfully acquired exclusive lock 2018-06-06 15:21:52.636 7f10c0ff9700 10 librbd::ExclusiveLock: 0x7f10b001d0e0 post_acquire_lock_handler: r=0 2018-06-06 15:21:52.636 7f10c0ff9700 10 librbd::exclusive_lock::PostAcquireRequest: 0x7f10a0003410 send_open_object_map: 2018-06-06 15:21:52.636 7f10c0ff9700 20 librbd::object_map::RefreshRequest: 0x7f10a0005a50 send: object_count=1 2018-06-06 15:21:52.636 7f10c0ff9700 10 librbd::object_map::RefreshRequest: 0x7f10a0005a50 send_lock: oid=rbd_object_map.4d42cabbb29 2018-06-06 15:21:52.636 7f10c0ff9700 10 librbd::object_map::LockRequest: 0x7f10a0005d80 send_lock: oid=rbd_object_map.4d42cabbb29 2018-06-06 15:21:52.636 7f10c17fa700 10 librbd::object_map::LockRequest: 0x7f10a0005d80 handle_lock: r=0 2018-06-06 15:21:52.636 7f10c17fa700 10 librbd::object_map::RefreshRequest: 0x7f10a0005a50 handle_lock 2018-06-06 15:21:52.636 7f10c17fa700 10 librbd::object_map::RefreshRequest: 0x7f10a0005a50 send_load: oid=rbd_object_map.4d42cabbb29 2018-06-06 15:21:52.636 7f10c17fa700 10 librbd::object_map::RefreshRequest: 0x7f10a0005a50 handle_load: r=0 2018-06-06 15:21:52.636 7f10c17fa700 -1 librbd::object_map::RefreshRequest: object map smaller than current object count: 0 != 1 2018-06-06 15:21:52.636 7f10c17fa700 10 librbd::object_map::RefreshRequest: 0x7f10a0005a50 send_resize_invalidate 2018-06-06 15:21:52.636 7f10c17fa700 -1 librbd::object_map::InvalidateRequest: 0x7f10b0059720 invalidating object map in-memory 2018-06-06 15:21:52.636 7f10c17fa700 20 librbd::ManagedLock: 0x7f10b001d0e0 is_lock_owner: XXXMG m_state=4 (STATE_POST_ACQUIRING=5) 2018-06-06 15:21:52.636 7f10c17fa700 20 librbd::ManagedLock: 0x7f10b001d0e0 is_lock_owner: =0 2018-06-06 15:21:52.636 7f10c0ff9700 -1 librbd::object_map::InvalidateRequest: 0x7f10b0059720 should_complete: r=0 2018-06-06 15:21:52.636 7f10c0ff9700 10 librbd::object_map::RefreshRequest: 0x7f10a0005a50 handle_resize_invalidate: r=0 2018-06-06 15:21:52.636 7f10c0ff9700 10 librbd::object_map::RefreshRequest: 0x7f10a0005a50 send_resize: oid=rbd_object_map.4d42cabbb29 2018-06-06 15:21:52.636 7f10c17fa700 10 librbd::object_map::RefreshRequest: 0x7f10a0005a50 handle_resize: r=0 2018-06-06 15:21:52.636 7f10c17fa700 10 librbd::exclusive_lock::PostAcquireRequest: 0x7f10a0003410 handle_open_object_map: r=0 2018-06-06 15:21:52.636 7f10c17fa700 10 librbd::ExclusiveLock: 0x7f10b001d0e0 handle_post_acquiring_lock
Note "is_lock_owner: =0" when invalidating object map.
Related issues
History
#1 Updated by Jason Dillaman almost 6 years ago
- Backport changed from mimic,luminous to mimic,luminous,jewel
#2 Updated by Mykola Golub almost 6 years ago
- Status changed from In Progress to Fix Under Review
#3 Updated by Jason Dillaman almost 6 years ago
- Status changed from Fix Under Review to Pending Backport
#4 Updated by Nathan Cutler almost 6 years ago
- Copied to Backport #24496: mimic: "invalid object map" flag may be not stored on disk added
#5 Updated by Nathan Cutler almost 6 years ago
- Copied to Backport #24497: jewel: "invalid object map" flag may be not stored on disk added
#6 Updated by Nathan Cutler almost 6 years ago
- Copied to Backport #24498: luminous: "invalid object map" flag may be not stored on disk added
#7 Updated by Jason Dillaman over 5 years ago
- Status changed from Pending Backport to Resolved