Legacy preview migration looks up filecache rows by path_hash without storage condition
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 72/100
Línea de trabajo
Lee LocalPreviewStorage::fetchFilecacheByPathHashes() en lib/private/Preview/Storage/LocalPreviewStorage.php y compara su consulta con la condición de almacenamiento añadida para deleteFolder() en #58403. Confirma cómo se obtiene el ID del almacenamiento raíz de las vistas previas de appdata y revisa las pruebas relacionadas de la migración. Se considera terminado cuando la consulta limita las filas a ese almacenamiento y la regresión está cubierta.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Bug description
During the migration of legacy previews, LocalPreviewStorage::fetchFilecacheByPathHashes() selects rows with only a path_hash IN (…) condition across all shards:
There is no index on path_hash alone (only (storage, path_hash)), so every chunk of up to 1000 hashes is a full scan of oc_filecache. On large instances this makes the migration very slow and puts heavy load on the database. The same problem was fixed for deleteFolder() in #58403 by adding the storage condition.
Steps to reproduce
Found by code reading.
- Instance with a large
oc_filecacheand legacy previews inappdata_*/preview. - Run the preview migration and watch the slow query log:
SELECT … FROM oc_filecache WHERE path_hash IN (…)withoutstorage.
Expected behavior
The query is restricted to the storage that holds the appdata previews (the root storage id), so the fs_storage_path_hash index is used.
Nextcloud version
master
- Lenguaje dominante
- PHP
- Estrellas
- 37.6k
- Forks
- 5.4k
- Merge medio
- 1 d 20 h
- PR fusionados (30 d)
- 605
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 nextcloud/server
-
Document lexicon.default.userconfig and lexicon.default.userconfig.enforced in config.sample.phpAbiertoenhancement feature: settings good first issue
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
bug feature: TaskProcessing good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
files_external occ commands crash with InvalidArgumentException for SMB mounts without credentialsAbiertobug feature: external storage feature: occ good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
"Forwarded for headers" setup check trusts a client-sent Remote-Addr header and ignores CIDR proxiesAbiertobug feature: settings
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
occ config:app:set --value ignores --no-sensitive (and drops --sensitive for boolean values)Abiertobug feature: occ
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
Todos los issues de nextcloud/server
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
nextcloud/integration_openai#480 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
a11y
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
omeka/plugin-Contribution#84 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
recca0120/vscode-phpunit#620 ·
Los mantenedores suelen responder en 1 día
-
Validation rule generation for recursive Data objects is unbounded (O(payload depth))Posiblemente ocupada @irfanm96 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
spatie/laravel-data#1226 ·