Details
-
Bug
-
Status: Closed
-
Resolution: Fixed
-
6.2.X EE, 7.0.X, Master
-
7.0.x, 6.2.x
-
Committed
-
1.25
-
4
-
Regression Bug
Description
When saving a ddmstructure, each JournalArticle version is indexed as many times as versions exists in each JournalArticle.
If you have a webcontent with 4 versions, we are indexing it 4*4=16 times.
In 6.2.x similar error is produced when you configure journal.articles.index.all.versions=false in portal-ext.properties
In that case if you have a webcontent with 4 versions, only last version is indexed but it is indexed 4 times
Root cause
In LPS-57161, Index buffer was applied to JournalArticleIndexer.reindexDDMStructures method, see following pulls:
- https://github.com/brianchandotcom/liferay-portal/pull/28348
- https://github.com/brianchandotcom/liferay-portal/pull/29350
Call to index.reindex(classname, resourcePK) is better, because new index buffering removes the duplicates requests
But in LPS-51356 call to "JournalArticleIndexer.reindexDDMStructures" method was moved from DDMStructureLocalServiceImpl to DDMStructureIndexerBackgroundTaskExecutor.
This change causes this issue because in that background task there is no database transaction, so there is no Index Buffer that removes the duplicated requests to index.reindex(classname, resourcePK)
Steps to reproduce (7.0.x and master)
- Create a structure
- Create a webcontent with 4 versions (versions 1.0 to 1.3) using the new structure
- Activate log category com.liferay.portal.search.internal.IndexWriterHelperImpl to DEBUG level
- Modify the structure and save it. A background reindex is launched
- Check log traces with DEBUG [liferay/background_task-1][IndexWriterHelperImpl] and count them:
- Expected behavior: 4 lines with the requests to the index are written to the log
- Wrong behavior: 16 lines with the requests to the index are written to the log
- Expected behavior: 4 lines with the requests to the index are written to the log
Steps to reproduce (6.2.x)
- Configure journal.articles.index.all.versions=false in portal-ext.properties (only last version is indexed with this property)
- Create a structure
- Create a webcontent with 4 versions (versions 1.0 to 1.3) using the new structure
- Activate log category com.liferay.portal.kernel.search.SearchEngineUtil to DEBUG level
- Modify the structure and save it. A background reindex is launched
- Check log traces with DEBUG [liferay/background_task-1][IndexWriterHelperImpl] and count them:
- Expected behavior: 1 lines with the request to the index is written to the log
- Wrong behavior: 4 lines with the requests to the index are written to the log
- Expected behavior: 1 lines with the request to the index is written to the log
Attachments
Issue Links
- is caused by
-
LPS-51356 As an end user I don't want to wait for reindexing each related JournalArticle when updating a Structure
-
- Closed
-
- is related to
-
LPS-50579 Low performance for saving an structure if it's related to a huge number of contents with several versions
- Closed
- relates
-
LPE-16234 Saving a Dynamic Data Mapping Structure triggers a new reindex for every version of a web content for as many time as there are versions instead of just once per version
-
- Closed
-