Solution de contournement et correction de la corruption d’index avec AEM/AEM Forms

Description




L’expérience d’une corruption d’index devrait être un cas très inhabituel car beaucoup de travail a été fait pour l’éviter, mais si cela se produit, vous verrez des entrées de journal similaires à :

17.01.2019 17:55:47.374 *WARN* pool-118-thread-4 org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate async The index update failed org.apache.jackrabbit.oak.api.CommitFailedException: OakMerge0001: OakMerge0001: Failed to merge changes to the underlying store (retries 5, 5169 ms) at org.apache.jackrabbit.oak.spi.state.AbstractNodeStoreBranch.merge0(AbstractNodeStoreBranch.java:345) at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreBranch.merge(DocumentNodeStoreBranch.java:156) at org.apache.jackrabbit.oak.plugins.document.DocumentRootBuilder.merge(DocumentRootBuilder.java:160) at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.merge(DocumentNodeStore.java:1588) at org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate.mergeWithConcurrencyCheck(AsyncIndexUpdate.java:581) at org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate.updateIndex(AsyncIndexUpdate.java:525) at org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate.runWhenPermitted(AsyncIndexUpdate.java:431) at org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate.run(AsyncIndexUpdate.java:323) at org.apache.sling.commons.scheduler.impl.QuartzJobExecutor.execute(QuartzJobExecutor.java:115) at org.quartz.core.JobRunShell.run(JobRunShell.java:202) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1164) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:634)

Résolution

Si vous êtes confronté à cette situation, la manière la plus rapide de résoudre ce problème est probablement de supprimer les données d’index contenues dans le référentiel et de réindexer l’index corrompu.

REMARQUE : La réindexation est une action longue et gourmande en ressources.

pour ces exemples, nous utiliserons l’index "workflowDataLucene"

Supprimez les données de l'index : 

Les données d’index se trouvent dans le référentiel ci-dessous. /oak:index/workflowDataLucene en tant que noeuds masqués. Par conséquent, pour supprimer l’index corrompu, vous devez :

  1. Copiez la définition d’index (uniquement) vers un nouvel emplacement
  2. Supprimer l’ensemble /oak:index/workflowDataLucene structure de noeud
  3. Recréer /oak:index/workflowDataLucene et déclencher la réindexation

Solution de contournement:

Pour pallier ce problème, au lieu de supprimer l’index, vous pouvez le désactiver et créer un nouvel index avec la même définition :

  1. Créez un nouvel index avec la même définition d’index que celui corrompu.
  2. Déclencher la réindexation sur le nouvel index
  3. Désactivez l’index corrompu en définissant la propriété de type sur "disabled".

une fois ces modifications effectuées, chaque requête est envoyée au nouvel index.

Supprimez les données de RDB :

En dernier recours et si vous exécutez RDBmk, vous pouvez analyser afin de supprimer les données d’index directement de la base de données avec comme requête similaire à :

DELETE FROM NODES WHERE
ID = '2:/oak:index/workflowDataLucene' OR ID LIKE '3:/oak:index/workflowDataLucene/%' OR ID LIKE '4:/oak:index/workflowDataLucene/%' OR ID LIKE '5:/oak:index/workflowDataLucene/%' OR ID LIKE '6:/oak:index/workflowDataLucene/%' OR ID LIKE '7:/oak:index/workflowDataLucene/%' OR ID LIKE '8:/oak:index/workflowDataLucene/%' OR ID LIKE '9:/oak:index/workflowDataLucene/%' OR ID LIKE '10:/oak:index/workflowDataLucene/%' OR   
ID LIKE '5:p/oak:index/workflowDataLucene/%' OR ID LIKE '6:p/oak:index/workflowDataLucene/%' OR ID LIKE '7:p/oak:index/workflowDataLucene/%' OR ID LIKE '8:p/oak:index/workflowDataLucene/%' OR ID LIKE '9:p/oak:index/workflowDataLucene/%' OR ID LIKE '10:p/oak:index/workflowDataLucene/%' OR ID LIKE '11:p/oak:index/workflowDataLucene/%' OR ID LIKE '12:p/oak:index/workflowDataLucene/%' OR
 

Si vous décidez de suivre ce chemin, veillez à vérifier la requête avant de l’exécuter, car certaines modifications peuvent être nécessaires.

REMARQUE : AEM doit être arrêté et les fichiers de cache et d’index persistants locaux (crx-quickstart/repository/cache et crx-quickstart/repository/index) supprimés avant de démarrer AEM après cette suppression.

Sur cette page