Currently initial sync ignores any in-progress 2 phase index builds. Only if it sees commitIndexBuild oplog entry during the initial sync oplog replay or during secondary oplog application, the index build gets started and committed. Now, the problem is that, for two phase index builds with commit quorum on, the primary can commit the index build only if my number of ready to commit votes satisfy commit quorum value.
Let's assume my commit quorum is "all" and its a 2 node replica set. To be noted, In our today's world, initial syncing nodes can vote, as a result. so consider the below scenario.
1) Node A is primary
2) Node B starts performing initial sync.
3) Primary(node A) starts the index build 'x_1' for collection foo.bar and votes for itself.
4) Node B ignores building/in-progress 'x_1' during initial sync.
5) Node B finishes initial sync.
6) Since Index build 'x_1' has received only one vote < ("all" = 2), so it can't commit the index build and keeps waiting for the votes from secondary(Node B) forever.