zfs - two pools with nested mountpoints and conflicting mount order

Solution 1:

Instead of mounting zpool2 as /var/db, mount it as /zpool2 or /db or whatever makes sense for you.

Then make /var/db a symlink to /db.

Solution 2:

You can set the file system mountpoint properties to legacy and use /etc/fstab to define them.

That way, you'll be able to define the order in which they will be mounted.

Edit: I just noticed you already considered the legacy approach. It might be the only one though.