Project

General

Profile

Actions

Bug #63771

open

discard at object end can grow the logical size of the object

Added by Ilya Dryomov 5 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

Discards on a standalone image are implemented in terms of one of three OSD ops: remove, truncate or zero. When truncate op is chosen, discard at object end can grow the logical size of the object:

$ rbd create -s 1G foo
$ rbd info foo | grep block_name_prefix
        block_name_prefix: rbd_data.81ed7464ba8c

$ sudo rbd device map foo
/dev/rbd0
$ sudo xfs_io -d -c 'pwrite 0 512' /dev/rbd0
wrote 512/512 bytes at offset 0
$ rados -p rbd stat rbd_data.81ed7464ba8c.0000000000000000
rbd/rbd_data.81ed7464ba8c.0000000000000000 mtime 2023-12-08T13:14:06.000000+0100, size 512
$ sudo blkdiscard -o 3M -l 1M /dev/rbd0
$ rados -p rbd stat rbd_data.81ed7464ba8c.0000000000000000
rbd/rbd_data.81ed7464ba8c.0000000000000000 mtime 2023-12-08T13:14:44.000000+0100, size 3145728
$ sudo rbd device unmap /dev/rbd0

This doesn't affect the physical space usage, so the user impact is negligible. But this does make reasoning about discards and especially writing tests that involve discards more complicated. This is likely one of the reasons why randomized DiffIterate tests are too week, which in turn lead to missed regressions.

I think we should base the implementation on just two OSD ops for standalone images: remove or zero. Truncate op doesn't provide any benefit.


Related issues 1 (1 open0 closed)

Related to rbd - Bug #63719: [test] scribble()-based DiffIterate tests are too weakNew

Actions
Actions #1

Updated by Ilya Dryomov 5 months ago

  • Related to Bug #63719: [test] scribble()-based DiffIterate tests are too weak added
Actions

Also available in: Atom PDF