If indexes are up-to-date, this should not happen. If you can reproduce this in a standalone use case, fell free to log a JIRA (if this is indeed a bug, it should be Wildfly independent). A similar issue was fixed for the LocalIndexProvider as part of [MODE-2392] LocalIndexProvider seems to do extensive work at every startup, even if shutdown properly - JBoss Issue Trac… ; the test case is here : modeshape/JcrRepositoryStartupTest.java at 4.x · ModeShape/modeshape · GitHub)
With the default "is_missing" setting for reindexing, the repository will walk all the existing nodes none-the-less, even though the indexes may not be actually updated. So this may take some time just from loading each node from the cache. You can try to use the LocalIndexProvider instead of Lucene to check if it works better or you can try configuring reindexing differently to see if it works around this issue: Query and search - ModeShape 4 - Project Documentation Editor
I have logged a JIRA ModeShape - JBoss Issue Tracker with an attached PR MODE-2565 - Added test to demonstrate lucene re-indexing issue. by lucasweb78 · Pull Request #1519 · ModeShape/modeshape… that demonstrates this
It only seems to be an issue with Lucene and not with the Local Index provider.
Is there any way to configure Modeshape not to automatically walk all the existing nodes on start up. We have a fairly large but fairly static data set and the over-head which we do not need to have checked n every re-start for index changes, instead it would be convenient to skip this at start-up in order to improve re-start times. If we ever find our indexes are out of sync we can always manually force a re-index via the Index Provider API.
There is a hack/workaround you can try and that is to configure "incremental" reindexing via <reindexing mode="incremental" />
Normally this only works if you enable & use the repository journal, but without the journal enabled you should see a warning at repository startup and no reindexing should be performed.