Project

General

Profile

Actions

Bug #55521

closed

bluestore zero block detection makes all-zeroes writes deallocate space

Added by Ilya Dryomov about 2 years ago. Updated almost 2 years ago.

Status:
Resolved
Priority:
Urgent
Assignee:
Target version:
-
% Done:

100%

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

Description

This is completely contrary to the original RFE to have a writesame of zeroes be treated as a request to allocate the specified amount of space but avoid the need to actually zero the space (i.e. track that the extent is in-use but flag it as being zeroed/uninitialized). The main desire there was to optimize "rbd create --thick-provision" which is supposed to allocate space.

In pacific:

$ rbd create --size 1G thinimage
$ rbd create --size 1G --thick-provision thickimage
$ rbd du
NAME        PROVISIONED  USED 
thickimage        1 GiB  1 GiB
thinimage         1 GiB    0 B
<TOTAL>           2 GiB  1 GiB

$ ceph df
[...]
--- POOLS ---
POOL  ID  PGS   STORED  OBJECTS     USED  %USED  MAX AVAIL
rbd    1   32  1.0 GiB      265  1.0 GiB  20.24    3.9 GiB

In quincy, as a result of https://github.com/ceph/ceph/pull/43337:

$ rbd create --size 1G thinimage
$ rbd create --size 1G --thick-provision thickimage
$ rbd du
NAME        PROVISIONED  USED 
thickimage        1 GiB  1 GiB
thinimage         1 GiB    0 B
<TOTAL>           2 GiB  1 GiB

$ ceph df
[...]
--- POOLS ---
POOL  ID  PGS  STORED  OBJECTS    USED  %USED  MAX AVAIL
rbd    1    1   247 B      264  20 KiB      0    4.9 GiB

The backing objects for thickimage are still created (as shown by "rbd du") but it is not actually thick (as shown by "ceph df") -- an unlimited number of such images can be created in a cluster with a single 5G block device.

This regression also affects existing thick images as, even though users disable discard/trim for such images, all-zeroes writes of various sizes which occur from time to time in pretty much any system would now slowly thin them.


Related issues 1 (0 open1 closed)

Copied to bluestore - Backport #55811: quincy: bluestore zero block detection makes all-zeroes writes deallocate spaceResolvedLaura FloresActions
Actions

Also available in: Atom PDF