In differential geometry or general relativity, we usually think of the metric tensor $g_{\mu \nu}$ first and then introduce the metric connection.
However, I wonder if we can go reverse.
That is, let $M$ be a smooth manifold equipped with some nontrivial affine connection $\nabla$. Then does there always exist a metric tensor $g_{\mu \nu}$ on $M$ that has $\nabla$ as its metric connection?
I tried to figure this out myself but it is more confusing than expected. Could anyone help me?