Rolling index on primary database

Question 2:
It’s important to ensure that secondaries with indexes that differ from the primary not be eligible to become primary.

Per earlier chapter ,it has been suggeted to make rolling index to avoid downtime. First we need to build index on secondary and in last on primary. it means once we shutdown primary no node(as other node will be with index ,which not there on primary) will become primary.please clear my doubt.

@ Anurag_52272

Sorry, but I don’t really understand your question. Assuming that you have a working replica set, there is no time when there is not a primary – that’s the whole point, right? The issue in the question here is when a secondary has an index that is deliberately different (for whatever reason) from all other members of the set.

If you will clarify your question a bit, I’ll try to help. Good luck.