Search results can stay empty for up to an hour after a reindex batch because the query cache is cleared before the index refresh
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 58/100
Línea de trabajo
Start with ContentletIndexOperationsES.java:167, BulkProcessorListener.java:328-330, and ContentFactoryIndexOperationsES.cachedIndexSearch at line 134 to trace when the batch is acknowledged, the index refreshes, and query results are cached. Then inspect ReindexThreadTest.test_normal_pause_unpause_cycle_still_indexes_content and add an integration test that reproduces the stale empty result without clearing the cache in the test. Done means a search after a batch acknowledgment does not keep serving a result cached before the document becomes searchable.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem Statement
After the reindex worker indexes a batch, a content search can return no results for up to an hour even though the content is in the index.
The worker sends its bulk requests with refresh NONE (ContentletIndexOperationsES.java:167), so new documents become searchable only at the next index refresh. When the batch is acknowledged, BulkProcessorListener.handleSuccess (BulkProcessorListener.java:328-330) clears ESQueryCache and OSQueryCache. That happens before the refresh. A search made between the acknowledgement and the refresh misses the new documents, and ContentFactoryIndexOperationsES.cachedIndexSearch (:134) caches that empty result for cache.esquerycache.seconds (3600 s by default). Nothing clears the cache again until the next batch is acknowledged, so on a quiet instance the empty result is served for up to the full hour.
Steps to Reproduce
- Set
refresh_intervalto-1on the content indices, so the window between acknowledgement and refresh stays open. - Save a contentlet with the DEFER index policy and wait for the reindex queue to drain.
- Search for it with
ContentletAPI.search(+identifier:<id>): no hits, and the empty result is cached. - Force a refresh (
POST /_refresh) and search again: still no hits. A read that does not use the query cache (ContentletAPI.createScrollQuery) finds the document.
This was reproduced in an integration-test run on main (59b89f6fe1); it is the cause of the intermittent ReindexThreadTest.test_normal_pause_unpause_cycle_still_indexes_content failure.
Acceptance Criteria
- A search made after a reindex batch is acknowledged never keeps serving a result cached before the documents became searchable. Options include clearing the query caches after the refresh instead of at acknowledgement, or not caching results computed between the two.
- An integration test covers it without clearing the cache from the test.
dotCMS Version
main (59b89f6fe1); the same code is in 26.11.09-01.
Links
- Found while fixing CI test flakes;
ReindexThreadTestnow reads the index without the query cache so the test no longer depends on this behaviour.
- Lenguaje dominante
- Java
- Estrellas
- 972
- Forks
- 493
- Merge medio
- 2 d 12 h
- PR fusionados (30 d)
- 228
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de dotCMS/core
-
dotCMS : UVE OKR : Customer Support Team : Maintenance Type : Defect
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 2 días
-
OKR : Customer Support Team : Maintenance Type : Defect
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
Opening content from Content Search replaces the "Search" breadcrumb in the new Edit Content screenAbiertodotCMS: New Edit Contentlet OKR : Customer Support Team : Falcon Type : Defect
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
Escape the Binary field hint in the legacy content editor so an apostrophe doesn't break the fieldAbiertoOKR : Customer Support Team : Maintenance Type : Defect
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
Los mantenedores suelen responder en 2 días
-
dotCMS : Permissions OKR : Customer Support Team : Maintenance Type : Defect
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 2 días
Todos los issues de dotCMS/core
Issues similares
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
it-at-m/Wahllokalsystem#3846 ·
Los mantenedores suelen responder en 2 días
-
Area/Connector module/solace Priority/Low Type/Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
ballerina-platform/ballerina-library#9849 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
Vakore/ZappierGames#327 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Radix number block generates NaN after switching a negative or decimal number to binary, octal or hexPosiblemente ocupada @matthewalberto la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
mit-cml/appinventor-sources#4246 · 1 comentario ·
Los mantenedores suelen responder en 1 día