The zroot/var dataset lives outside of the ZFS Boot Environment created by bsdinstall, making the package database shared across BEs that might have different packages installed. To fix, set the canmount ZFS property to no. Talked in person with Allan Jude regarding this bug.
A commit references this bug: Author: allanjude Date: Sun Sep 28 21:44:24 UTC 2014 New revision: 272274 URL: https://svnweb.freebsd.org/changeset/base/272274 Log: Change the /var dataset in the default ZFS layout to have the ZFS property canmount=off so that /var/db/pkg and other such directories are part of the / dataset, and only /var/mail, /var/log, and /var/crash are excluded from the ZFS boot environment (beadm). PR: 193971 Approved by: jmg MFC after: ASAP Relnotes: yes Sponsored by: ScaleEngine Inc. Changes: head/usr.sbin/bsdinstall/scripts/zfsboot
Thanks for noticing this. We'll try to get it into 10.1, it is rather late, but it is a tiny diff.
A commit references this bug: Author: allanjude Date: Thu Oct 2 17:19:33 UTC 2014 New revision: 272424 URL: https://svnweb.freebsd.org/changeset/base/272424 Log: MFC r272274: Change the /var dataset in the default ZFS layout to have the ZFS property canmount=off, making /var/db/pkg part of the / dataset, so installed package files are consistent with the package database when using ZFS boot environments (beadm). PR: 193971 Reviewed by: Shawn Webb, bcr Approved by: re (gjb), jmg Relnotes: yes Sponsored by: ScaleEngine Inc. Changes: _U stable/10/ stable/10/usr.sbin/bsdinstall/scripts/zfsboot
should be fixed in 10.1-RC1