Legacy preview migration looks up filecache rows by path_hash without storage condition
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
調査の方向性
lib/private/Preview/Storage/LocalPreviewStorage.php の LocalPreviewStorage::fetchFilecacheByPathHashes() を読み、そのクエリを #58403 で deleteFolder() に追加されたストレージ条件と比較してください。appdata のプレビューのルートストレージ ID をどのように取得できるか確認し、移行に関連するテストを調べてください。このストレージの行に検索対象が限定され、回帰がテストでカバーされれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- PHP
- スター
- 37.6k
- フォーク
- 5.4k
- 平均マージ
- 1日 20時間
- マージ済み PR(30日)
- 605
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nextcloud/server のほかの issue
-
Document lexicon.default.userconfig and lexicon.default.userconfig.enforced in config.sample.phpオープンenhancement feature: settings good first issue
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
bug feature: TaskProcessing good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
files_external occ commands crash with InvalidArgumentException for SMB mounts without credentialsオープンbug feature: external storage feature: occ good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
"Forwarded for headers" setup check trusts a client-sent Remote-Addr header and ignores CIDR proxiesオープンbug feature: settings
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
bug feature: occ
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
nextcloud/server の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
nextcloud/integration_openai#480 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
a11y
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
omeka/plugin-Contribution#84 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
recca0120/vscode-phpunit#620 ·
メンテナーはふだん 1 日以内に返信
-
Validation rule generation for recursive Data objects is unbounded (O(payload depth))対応中かも @irfanm96 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
spatie/laravel-data#1226 ·