Bug 1572496

Summary: Creating a VDO volume with --sparseIndex enabled results in an index on-disk size matching that of a dense index [rhel-7.5.z]
Product: Red Hat Enterprise Linux 7 Reporter: Oneata Mircea Teodor <toneata>
Component: vdoAssignee: vdo-internal <vdo-internal>
Status: CLOSED ERRATA QA Contact: Jakub Krysl <jkrysl>
Severity: unspecified Docs Contact:
Priority: high    
Version: 7.5CC: awalsh, bgurney, jkrysl, limershe, rhandlin, sweettea
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 6.1.0.168 Doc Type: If docs needed, set a value
Doc Text:
When a user created a new Virtual Data Optimizer (VDO) volume with the --indexSparse=enabled option, a dense index was created on the volume instead of sparse. Consequently, space savings on the volume were smaller than expected. With this update, the VDO management software now correctly creates a sparse index with the --indexSparse=enabled option.
Story Points: ---
Clone Of: 1570156 Environment:
Last Closed: 2018-05-14 16:13:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1570156    
Bug Blocks:    

Description Oneata Mircea Teodor 2018-04-27 07:19:31 UTC
This bug has been copied from bug #1570156 and has been proposed to be backported to 7.5 z-stream (EUS).

Comment 3 Jakub Krysl 2018-05-03 15:31:38 UTC
Tested with vdo-6.1.0.168-18:
# vdo create --name vdo --device /dev/mapper/mpatha --sparseIndex disabled --verbose
Creating VDO vdo
    grep MemAvailable /proc/meminfo
    pvcreate -qq --test /dev/mapper/mpatha
    modprobe kvdo
    vdoformat --uds-checkpoint-frequency=0 --uds-memory-size=0.25 /dev/mapper/mpatha
    vdodumpconfig /dev/mapper/mpatha
Starting VDO vdo
    dmsetup status vdo
    grep MemAvailable /proc/meminfo
    modprobe kvdo
    vdodumpconfig /dev/mapper/mpatha
    dmsetup create vdo --uuid VDO-e5ce6f31-095f-471e-9422-1173282e3dc5 --table '0 200940480 vdo /dev/mapper/mpatha 4096 disabled 0 32768 16380 on auto vdo ack=1,bio=4,bioRotationInterval=64,cpu=2,hash=1,logical=1,physical=1'
    dmsetup status vdo
Starting compression on VDO vdo
    dmsetup message vdo 0 compression on
    dmsetup status vdo
VDO instance 5 volume is ready at /dev/mapper/vdo
# cat /sys/uds/index/6/name
dev=/dev/mapper/mpatha offset=4096 size=2781704192
# lsblk
NAME                        MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sdc                           8:32   0   100G  0 disk
└─mpatha                    253:2    0   100G  0 mpath
  └─vdo                     253:4    0  95.8G  0 vdo

# vdo create --name vdo --device /dev/mapper/mpatha --sparseIndex enabled --verbose
Creating VDO vdo
    grep MemAvailable /proc/meminfo
    pvcreate -qq --test /dev/mapper/mpatha
    modprobe kvdo
    vdoformat --uds-checkpoint-frequency=0 --uds-memory-size=0.25 --uds-sparse /dev/mapper/mpatha
    vdodumpconfig /dev/mapper/mpatha
Starting VDO vdo
    dmsetup status vdo
    grep MemAvailable /proc/meminfo
    modprobe kvdo
    vdodumpconfig /dev/mapper/mpatha
    dmsetup create vdo --uuid VDO-2b77f213-8ecd-4ed8-95f8-edc6fea90f41 --table '0 159077384 vdo /dev/mapper/mpatha 4096 disabled 0 32768 16380 on auto vdo ack=1,bio=4,bioRotationInterval=64,cpu=2,hash=1,logical=1,physical=1'
    dmsetup status vdo
Starting compression on VDO vdo
    dmsetup message vdo 0 compression on
    dmsetup status vdo
VDO instance 6 volume is ready at /dev/mapper/vdo
# cat /sys/uds/index/7/name
dev=/dev/mapper/mpatha offset=4096 size=23847940096
# lsblk
NAME                        MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sdc                           8:32   0   100G  0 disk
└─mpatha                    253:2    0   100G  0 mpath
  └─vdo                     253:4    0  75.9G  0 vdo

So with dense the index size is ~2.6GB, with sparse it is ~22.7GB.

Regressions testing passed.

Comment 6 errata-xmlrpc 2018-05-14 16:13:39 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:1408