Suppose that we have a Riemannian Manifold $(M,g)$ whose curvature vanishes in an open neighborhood U of a point p.

When does this imply that the metric is Flat ?

In particular, does it happen under some special or exceptional holonomy like $G_2$ ?

Are there any topological conditions on $M$ to make it Flat ?

Note that a manifold is *Flat* if and only if the restricted holonomy
$Hol^0(M,g)=0$. This condition means that contractible loops have zero holonomy. Our case is somehow 'close' to this condition because if the loop is sufficiently small then its holonomy is zero. It actually includes any small loop contractible or not. So it is a strong condition. I guess Ricci-Flatness or something like that implies the global result. References also appreciated.

(Flat means the curvature is zero, in case of ambiguity.)