LPS-46104

Hi @shuyangzhou,

For updates in the persistance layer, when the mehod SessionFlush() (which triggers the mvccVersion listener) is executed the shard stack doesn't contain the proper shard. I have fixed it following the pattern of:
com.liferay.portal.search.lucene.LuceneIndexer.reindex(int)
com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importLDAPUserByScreenName(long, String)

But please, refactor it as you think since I am not an expert in this part.

Please take into account the following information:
https://issues.liferay.com/browse/LPS-46104

Thanks.

PS: This issue has been brought to light after https://github.com/shuyangzhou/liferay-portal/pull/534 so we have to solve them at the same time.@tmoreira2020