recv_fix_encryption_hierarchy does horrifically inefficient lookups that could be either cached or refactored, and it bottlenecks super badly #16317
Labels
Type: Defect
Incorrect behavior (e.g. crash, hang)
System information
6.7.12+bpo-cloud-amd64
(also6.7.12+bpo-amd64
)2.2.4-1~bpo12+1
(also2.2.3-2~bpo12+1
)Describe the problem you're observing
When doing a zfs send/recv with encryption and replication, zfs send completes after about 15 minutes, but zfs send then spends another 825 minutes using 100% of 1 CPU core.
In my test recipe, "zfs send" takes 20 seconds and generates an 18MB blob, and "zfs receive" takes 2580 seconds.
The issue appears to be proportional to the number of datasets.
On a system with ~100 datasets, it is not noticeable.
I asked
#openzfs
(IRC) for help with this, and someone there worked out which function was causing the problem (the issue title is what they suggested).Describe how to reproduce the problem
Here is a minimal recipe that demonstrates the time difference.
The output is:
zfs.recv_fix_encryption_hierarchy.txt
Include any warning/errors/backtraces from the system logs
No errors --- the
zfs receive
process does eventually terminate, it's just very very slow.The text was updated successfully, but these errors were encountered: