Page MenuHomePhabricator

Remove fileExists() call from fileStoragePathsForOps() in FileBackendMultiWrite
Closed, ResolvedPublic1 Estimated Story Points

Description

The fileStoragePathsForOps() method stats files for ops with "ignoreMissingSource" set. This call is surprising given the method name. Also, since the call to fileStoragePathsForOps() also occurs just before a clearCache() call, such entries would have to load into cache again...causing more HEAD requests.

The check was added in 1045622590d9702dd2f0c0e97c38220a392d20c1 so that accessibilityCheck() wouldn't complain if the paths were not "prepared" (e.g. parent directory/container exists). accessibilityCheck() itself is kind of duplicating what FileOp classes do, but worse. After f7ea531b2f3d5c82, it probably makes sense to just remove accessibilityCheck().

Also, I think FileOp calls isPathUsableInternal() on every path anyway, so ops with "ignoreMissingSource" might still error on an unprepared file path anyway, when using FSFileBackend, regardless of the multi-write backend. I'll need to confirm this...[EDIT: yep, filed as T406802]

I noticed this while looking at T328872.

Event Timeline

Change #1194781 had a related patch set uploaded (by Aaron Schulz; author: Aaron Schulz):

[mediawiki/core@master] filebackend: remove accessibility check from multi-backend

https://gerrit.wikimedia.org/r/1194781

Change #1194781 merged by jenkins-bot:

[mediawiki/core@master] filebackend: remove accessibility check from multi-backend

https://gerrit.wikimedia.org/r/1194781

aaron triaged this task as High priority.Oct 9 2025, 3:22 PM
aaron set the point value for this task to 1.
aaron set Final Story Points to 1.
aaron claimed this task.