To add to this, it's best to remove the plugin until it is potentially addressed, as is warned here: https://btrfs.wiki.kernel.org/index.php/Gotchas#Block-level_copies_of_devices
While these two "copies" are in fact the same thing, the thing with unraid is the /dev/mdx devices correspond to the /dev/sdx devices. So if the kernel sees both all of a sudden, it just thinks they're unique devices. In normal filesystems, this is fine, but Btrfs isn't "normal", so it gets angry because there are two devices with the same Device ID (all btrfs devices in a pool share the same UUID). A btrfs pool stores unique devices in its own metadata with numerical device IDs which are incremental. If you have a pool, consider running the command:
btrfs device usage /mnt/cache
It will list the devices in the pool with an ID. However, if you run
blkid
on your pool devices, you'll see they all have the same UUID. This is normal. This is how btrfs identifies devices belonging to a pool.
The thing is, it's the device ID in the btrfs metadata that is the issue. The btrfs driver should *never* see duplicate device IDs. When you run a btrfs device scan, it looks for these devices. This is how btrfs can work with pool devices without you needing to specify each device when it mounts, instead, mounting any of the devices in a pool will mount all of them. However, when duplicates are found, this warning is triggered on mount, since the btrfs driver talks to devices by their device ID.
It's like trying to mount two XFS devices with the same UUID, the kernel will get angry. Only in this case, btrfs has its own IDs. It's the same thing.
On old kernels, this would almost certainly cause corruption. While I think there has been effort to harden against this in later kernel versions, like is being used on unraid today, if the kernel ever did get confused and commits a write to the /dev/sdx device, while you may not have fs corruption in this case, it could cause the parity to go out of sync. Or it could cause corruption if there's any race condition or write barrier issues between the MDx devices and the SDx devices.
Honestly, I think it's just best to avoid that potential issue. The UD plugin must be doing a device scan, triggering the duplicate device detection.
This is probably intentional by the plugin, since of course, if you had a btrfs array that wasn't assigned as a pool in Unraid, it would still be possible to easily mount it without returning any errors (otherwise btrfs will return an error if the kernel hasn't "scanned" all the devices).
So as far as I can tell, since it would probably be undesirable to remove this feature from the plugin, you should either choose to only use Btrfs in pools only if you wanna use UD, or don't use the UD plugin.