Step 1: Lay out the goal.
A tiny length change $\Delta L$ in one cavity shifts the phase of its beam. We need the cavity length $L$ so that this phase shift just reaches the smallest detectable value.
Step 2: Write the phase shift formula.
A beam goes down and back, so the path change is $2\Delta L$. The phase shift is \[ \Delta\phi = \frac{2\pi}{\lambda}(2\Delta L) = \frac{4\pi \Delta L}{\lambda}. \]
Step 3: Express $\Delta L$ using the given fraction.
Since $\Delta L / L \approx 10^{-21}$, we have $\Delta L = 10^{-21} L$.
Step 4: Substitute and set to the threshold.
The detector needs $\Delta\phi \ge 5 \times 10^{-11}$ rad, so at the minimum, \[ \frac{4\pi (10^{-21} L)}{\lambda} = 5 \times 10^{-11}. \]
Step 5: Solve for $L$.
With $\lambda = 1\ \mu\text{m} = 10^{-6}$ m, \[ L = \frac{5 \times 10^{-11} \times 10^{-6}}{4\pi \times 10^{-21}} = \frac{5 \times 10^{-17}}{1.26 \times 10^{-20}} \approx 4 \times 10^{3}\ \text{m}. \]
Step 6: Convert to kilometres.
That is about $4$ km of cavity length. \[ \boxed{L \approx 4\ \text{km}} \]