as far as I can tell this check previously could never be triggered as we used to hold a reader lock which means no one was allowed to change indexWriter. Now we do it out of the lock which means it can happen? I think we should remove it.