Skip to content

fix: use proper index when deleting mounts#59650

Open
icewind1991 wants to merge 1 commit intomasterfrom
usermountcache-delete-hash
Open

fix: use proper index when deleting mounts#59650
icewind1991 wants to merge 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

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.

3 participants