Lxc move --stateless error on disk write

Correct me if i am wrong, but as i understand lxc move --stateless will provide the following on eg. zfs storage backend.

  1. copy instance config.
  2. copy storage with eg. zfs send / receive
  3. stop source container.
  4. incremental send / receive
  5. start instance on target

This seems like what i have been looking for and of course i am testing it out before using it in production.

On a base debian/buster with almost nothing installed i lose 1 ping using lxc move --stateless.
However on our production environment we will have disk write and read while moving, so i tried to download a big file on the container while moving, and this is where i get in trouble. The instance is copied and started on the target - however the lxc command fails on deletion of the source container:

Error: Failed to delete original instance after copying it: Failed to run: zfs destroy -r tank0/lxd/containers/stateless: cannot destroy snapshot tank0/lxd/containers/stateless@migration-13e92f0e-de09-4341-930e-bcaab652c00e: dataset is busy

And running ps aux | grep zfs on the source host shows that zfs send is still running.

Is this a bug or is it as expected?
Both hosts are running Debian Buster 10.3 with kernel 5.4 from backports - zfs 0.8.3 and snap lxd version 3.21

zfs send should be done running by the time the dataset is deleted. It’s actually pretty weird that the remote end treated this as success…

Does it happen repeatedly?

Thanks you for your answer. This happens repeatedly. I can replicate this issue again and again. Tried it also while running a long mysql query. Same result.

Will try it on Ubuntu 18.04 with an older zfs version as the host

I can confirm that the issue does NOT occur on:
Ubuntu 18.04
lxd: 3.21
zfs: 0.8.1-1ubuntu14.2