Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-70394

Implement a way to check indexes in modules

    Details

      Description

      It's very common that, for different reasons, some indexes are not created properly during the upgrade. It would be useful to have a way to check if there are missed indexes in your database.

      In the Core we have the property:

      database.indexes.update.on.startup=true

      And the update of indexes run automatically after an upgrade.

      Our first proposal for modules is the following one:

      • Run the update of indexes (only recreate those ones whose definition is diferent the same indexes in the database) after every upgrade in modules
      • Run on demand during module startup (another of option could be to recreate indexes using the upgrade tool)

      Ricardo Couso Jose Jimenez Sergio Alonso

      Covered cases

      Update database indexes for a particular module

      1. Start Liferay and connect to the gogo shell
      2. In the database, delete some of the indexes for the table JournalArticle
      3. In the gogo shell, locate the Id for the bundle with symbolic name com.liferay.journal.service (by running lb com.liferay.journal.service, for example)
      4. In the gogo shell, execute upgrade:updateIndexes $bundleId, where $bundleId is the bundle id for the module found in the previous step
        Expected: In the database, the indexes for the table JournalArticle have been regenerated.
      5. In the database, delete again some of the indexes for the table JournalArticle
      6. In the gogo shell, execute upgrade:updateIndexes com.liferay.journal.service
        Expected: In the database, the indexes for the table JournalArticle have been regenerated.

      Update database indexes for all modules

      1. Start Liferay and connect to the gogo shell
      2. In the database, delete some of the indexes for the tables JournalArticle and BlogsEntry
      3. In the gogo shell, execute upgrade:updateIndexesAll
        Expected: In the database, the indexes for the tables JournalArticle and BlogsEntry have been regenerated.

      Update database indexes during an upgrade

      1. In a previous version of Liferay, delete some of the database indexes for the tables JournalArticle and BlogsEntry
      2. Execute an upgrade from that previous version of Liferay
        Expected: In the database, the indexes for the tables JournalArticle and BlogsEntry have been regenerated.

      User is informed when bundle does not exist

      1. Start Liferay and connect to the gogo shell
      2. In the gogo shell, execute upgrade:udpateIndexes -1
        Expected: Informing message: gogo: IllegalArgumentException: Module -1 does not exist
      3. In the gogo shell, execute upgrade:updateIndexes fakebundlename
        Expected: Informing message: gogo: IllegalArgumentException: Module with symbolic name fakebundlename does not exist

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              michael.saechang Michael Saechang
              Reporter:
              alberto.chaparro Alberto Chaparro
              Recent user:
              Marta Elicegui
              Participants of an Issue:
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Packages

                  Version Package
                  7.1.1 CE GA2
                  7.1.10 DXP FP4
                  7.1.10.1 SP1
                  7.1.X
                  Master