Skip to content

fix: use proper index when deleting mounts#59650

Merged
joshtrichards merged 1 commit intomasterfrom
usermountcache-delete-hash
Apr 23, 2026
Merged

fix: use proper index when deleting mounts#59650
joshtrichards merged 1 commit intomasterfrom
usermountcache-delete-hash

Conversation

@icewind1991
Copy link
Copy Markdown
Member

@icewind1991 icewind1991 commented Apr 15, 2026

Extracted from #57760 for easier reviews.

Select by path hash instead of full path.

Signed-off-by: Robin Appelman <robin@icewind.nl>
@icewind1991 icewind1991 added this to the Nextcloud 34 milestone Apr 15, 2026
@icewind1991 icewind1991 requested a review from a team as a code owner April 15, 2026 14:04
@icewind1991 icewind1991 requested review from Altahrim, ArtificialOwl, leftybournes and sorbaugh and removed request for a team April 15, 2026 14:04
@icewind1991
Copy link
Copy Markdown
Member Author

/backport to stable33

$query = $this->connection->getQueryBuilder();
$query->delete('mounts')
->where($query->expr()->eq('mount_point', $query->createNamedParameter($mountPoint)));
->where($query->expr()->eq('mount_point_hash', $query->createNamedParameter(hash('xxh128', $mountPoint))));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to also keep filter on mount_point in case of (improbable) collision, no?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

afaik collisions are already impossible due other other unique contraints

@joshtrichards joshtrichards merged commit 874f192 into master Apr 23, 2026
218 of 225 checks passed
@joshtrichards joshtrichards deleted the usermountcache-delete-hash branch April 23, 2026 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants