Skip to content

fix(files/cache): uniqueness guarantees in the file cache layer#59586

Open
solracsf wants to merge 1 commit intomasterfrom
fix/uniqueness-file-cache-layer
Open

fix(files/cache): uniqueness guarantees in the file cache layer#59586
solracsf wants to merge 1 commit intomasterfrom
fix/uniqueness-file-cache-layer

Conversation

@solracsf
Copy link
Copy Markdown
Member

@solracsf solracsf commented Apr 11, 2026

Summary

Replaces row-by-row PHP aggregation with a single SQL query using five aggregates an thus eliminating a second round-trip to the database that was a performance regression for encrypted storage.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@solracsf solracsf force-pushed the fix/uniqueness-file-cache-layer branch from 90d1746 to 4552fc8 Compare April 11, 2026 09:46
@solracsf solracsf added the 2. developing Work in progress label Apr 11, 2026
@solracsf solracsf force-pushed the fix/uniqueness-file-cache-layer branch from 32b7949 to 8bb31e0 Compare April 11, 2026 10:24
@solracsf solracsf added bug 3. to review Waiting for reviews and removed 2. developing Work in progress labels Apr 11, 2026
@solracsf solracsf added this to the Nextcloud 34 milestone Apr 11, 2026
@solracsf solracsf added feature: filesystem 2. developing Work in progress 3. to review Waiting for reviews and removed 3. to review Waiting for reviews 2. developing Work in progress labels Apr 11, 2026
@solracsf solracsf marked this pull request as ready for review April 11, 2026 14:42
@solracsf solracsf requested a review from a team as a code owner April 11, 2026 14:42
@solracsf solracsf requested review from Altahrim, artonge, icewind1991 and provokateurin and removed request for a team April 11, 2026 14:42
@provokateurin
Copy link
Copy Markdown
Member

Fixes a bug where all rows in a batch shared the same etag (it was computed once at query-build time and reused). Each entry now gets a unique cryptographic etag, preventing stale cache responses in WebDAV clients.

I don't understand what the problem was and why it needed to be fixed. Multiple rows having the same etag is completely fine. The only important thing about the etag is that it changes, not that it's unique.

@solracsf
Copy link
Copy Markdown
Member Author

solracsf commented Apr 13, 2026

Yep, the "uniqueness guarantee" framing suggests a bug that didn't exist...
I'll revert the uniqid() usage and keep only performance improvements on SQL queries.

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
@solracsf solracsf force-pushed the fix/uniqueness-file-cache-layer branch from 8bb31e0 to 3d5c987 Compare April 13, 2026 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants