Skip to content

ddtprune seems to cause space leak #17982

@tuxoko

Description

@tuxoko

System information

Type Version/Name
Distribution Name
Distribution Version
Kernel Version
Architecture
OpenZFS Version master, 2.3.2

Describe the problem you're observing

After ddtprune, it seems every blocks pruned from the ddt table will leak when removed.

Describe how to reproduce the problem

$ sudo zpool create pp sdb sdc
$ sudo zfs set dedup=on pp
$ sudo chmod ugo+w /pp
$ dd if=/dev/urandom bs=1M count=16 of=/pp/test
$ while :; do zpool sync; done # wait for a few seconds for ddt log to flush
^C
$ sudo zpool ddtprune -p 100 pp

$ rm /pp/test
$ while :; do zpool sync; done # wait for a few seconds for async delete
^C

$ sudo zdb -bcc pp

Traversing all blocks to verify checksums and verify nothing leaked ...

loading concrete vdev 1, metaslab 126 of 127 ...
leaked space: vdev 0, offset 0x40029000, size 8126464
leaked space: vdev 0, offset 0x407ea000, size 262144
leaked space: vdev 1, offset 0x40029000, size 8126464
leaked space: vdev 1, offset 0x407ea000, size 262144
block traversal size 528384 != alloc 17305600 (leaked 16777216)

        bp count:                    77
        ganged count:                 0
        bp logical:             3081216      avg:  40015
        bp physical:             181248      avg:   2353     compression:  17.00
        bp allocated:            528384      avg:   6862     compression:   5.83
        bp deduped:                   0    ref>1:      0   deduplication:   1.00
        bp cloned:                    0    count:      0
        Normal class:          17367040     used:  0.01%
        Embedded log class              0     used:  0.00%

        additional, non-pointer bps of type 0:         31
        Dittoed blocks on same vdev: 34

Include any warning/errors/backtraces from the system logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: DefectIncorrect behavior (e.g. crash, hang)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions