  Let $G$ be a finite $p$-group. We prove that whenever the commuting
probability of $G$ is greater than $(2p^2 + p - 2)/p^5$, the unramified Brauer
group of the field of $G$-invariant functions is trivial. Equivalently, all
relations between commutators in $G$ are consequences of some universal ones.
The bound is best possible, and gives a global lower bound of $1/4$ for all
finite groups. The result is attained by describing the structure of groups
whose Bogomolov multipliers are nontrivial, and Bogomolov multipliers of all of
their proper subgroups and quotients are trivial. Applications include a
classification of $p$-groups of minimal order that have nontrivial Bogomolov
multipliers and are of nilpotency class $2$, a nonprobabilistic criterion for
the vanishing of the Bogomolov multiplier, and establishing a sequence of
Bogomolov's absolute $\gamma$-minimal factors which are $2$-groups of
arbitrarily large nilpotency class, thus providing counterexamples to some of
Bogomolov's claims. In relation to this, we fill a gap in the proof of
triviality of Bogomolov multipliers of finite simple groups.
