The registered queries were loaded after shard went to started phase, this resulted in the situation that the percolate api could be used while the registered queries still needed to be loaded from disk.
The newly added afterIndexShardPostRecovery method to InternalIndicesLifecycle, that the percolator now uses to trigger the loading of the registered queries will make sure that a shard doesn't go to started state before the queries have been loaded.
The percolate api (like other apis) will retry the execution on a different shard copy if a shard isn't in a started state preventing empty results if there registered queries to be loaded. Percolator tests fail sometimes for this reason.
- removed the getKeyAsString method from StringTerms (redundant method)