Skip to content

Conversation

@salmart-dev
Copy link
Contributor

@salmart-dev salmart-dev commented Sep 12, 2025

Summary

This branch introduces WIP changes to setupForPath to implement a version taking advantage of the authoritative mount point list.

The branch is part of this set of branches:

TODO

  • Check if we ship without the changes for the INodeByPath implementation

Checklist

@salmart-dev salmart-dev changed the title Feature/54562/path specific fs setup Path specific Filesystem setup Sep 12, 2025
@salmart-dev salmart-dev force-pushed the fix/directoryAsINodeByPath branch from a1a6278 to cf952ce Compare September 16, 2025 08:08
@salmart-dev salmart-dev force-pushed the feature/54562/pathSpecificFSSetup branch from 7f95870 to 07f4028 Compare November 11, 2025 16:29
@salmart-dev salmart-dev changed the base branch from fix/directoryAsINodeByPath to master November 11, 2025 16:30
@github-actions
Copy link
Contributor

Possible performance regression detected

Show Output
An unhandled exception has been thrown:
TypeError: array_map(): Argument #2 ($array) must be of type array, null given in /home/runner/work/server/server/apps/profiler/lib/Command/Compare.php:35
Stack trace:
#0 /home/runner/work/server/server/apps/profiler/lib/Command/Compare.php(35): array_map()
#1 /home/runner/work/server/server/3rdparty/symfony/console/Command/Command.php(326): OCAProfilerCommandCompare->execute()
#2 /home/runner/work/server/server/core/Command/Base.php(218): SymfonyComponentConsoleCommandCommand->run()
#3 /home/runner/work/server/server/3rdparty/symfony/console/Application.php(1078): OCCoreCommandBase->run()
#4 /home/runner/work/server/server/3rdparty/symfony/console/Application.php(324): SymfonyComponentConsoleApplication->doRunCommand()
#5 /home/runner/work/server/server/3rdparty/symfony/console/Application.php(175): SymfonyComponentConsoleApplication->doRun()
#6 /home/runner/work/server/server/lib/private/Console/Application.php(187): SymfonyComponentConsoleApplication->run()
#7 /home/runner/work/server/server/console.php(91): OCConsoleApplication->run()
#8 /home/runner/work/server/server/occ(33): require_once('...')
#9 {main}

@salmart-dev salmart-dev force-pushed the feature/54562/pathSpecificFSSetup branch from 07f4028 to 89d174e Compare November 17, 2025 16:19
@salmart-dev salmart-dev changed the base branch from master to fix/directoryAsINodeByPath November 17, 2025 16:21
@salmart-dev salmart-dev force-pushed the fix/directoryAsINodeByPath branch from 754f4e5 to 4da6b5f Compare November 17, 2025 16:22
Comment on lines 22 to 24
* todo: $mountInfo may need to be an array of paths (string[])
* @param ICachedMountInfo[] $mountsInfo
* @param ICacheEntry[] $mountsMetadata
Copy link
Member

Choose a reason for hiding this comment

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

I would suggest adding a data class (something like IMountProviderArgs) that has the ICachedMountInfo, ICacheEntry and mountpoint and pass an array of that. So we have a stricter relationship between the various parts.

* todo: $mountInfo may need to be an array of paths (string[])
* @param ICachedMountInfo[] $mountsInfo
* @param ICacheEntry[] $mountsMetadata
* @return IMountPoint[]
Copy link
Member

Choose a reason for hiding this comment

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

@return array<string, IMountPount> and requiring them to be indexed by mountpoint will probably prove useful

protected function logQueryToFile(string $sql, array $params): void {
$logFile = $this->systemConfig->getValue('query_log_file');
if ($logFile !== '' && is_writable(dirname($logFile)) && (!file_exists($logFile) || is_writable($logFile))) {
if ($logFile !== '' && (!file_exists($logFile) || is_writable($logFile))) {
Copy link
Member

Choose a reason for hiding this comment

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

is this related?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No just a temp change to allow outputting query logs when the file is writable but the parent directory is not. It's gone.

Comment on lines 99 to 102
$table->addColumn('parent_id', 'integer', [
'length' => 4,
'notnull' => false,
]);
Copy link
Member

Choose a reason for hiding this comment

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

this will also need it's own migration for existing instances

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, my current problem is how to fill the column 😮‍💨

I was thinking we could populate it when we add or update entries in oc_mounts since at that moment we build a list of all available mounts (although this won't work for long if we need to split) but I ran into a few issues:

  • currently we don't use the id column from oc_mounts at all, so it needs to be exposed
  • the fact we wrap IMountPoints in cache entries gets in the way and I didn't manage to find a way to reliably transport the parent id into the db. I'll need to give it another try.

@salmart-dev salmart-dev force-pushed the feature/54562/pathSpecificFSSetup branch from 89d174e to 1d4abcd Compare November 19, 2025 16:06
@salmart-dev salmart-dev changed the base branch from fix/directoryAsINodeByPath to refactor/files-sharing November 19, 2025 16:12
@salmart-dev salmart-dev self-assigned this Nov 19, 2025
@salmart-dev salmart-dev added the 2. developing Work in progress label Nov 19, 2025
@salmart-dev salmart-dev added this to the Nextcloud 33 milestone Nov 19, 2025
@salmart-dev salmart-dev force-pushed the refactor/files-sharing branch 2 times, most recently from ab0dc8c to 5b58935 Compare November 20, 2025 16:38
@salmart-dev salmart-dev force-pushed the feature/54562/pathSpecificFSSetup branch 2 times, most recently from ae0c613 to cdc7233 Compare November 20, 2025 16:38
@salmart-dev salmart-dev force-pushed the refactor/files-sharing branch from 5b58935 to fd5de92 Compare November 20, 2025 16:39
@salmart-dev salmart-dev changed the base branch from refactor/files-sharing to fix/directoryAsINodeByPath November 20, 2025 16:39
@salmart-dev salmart-dev force-pushed the feature/54562/pathSpecificFSSetup branch from cdc7233 to 70b0ecc Compare November 20, 2025 16:39
@salmart-dev salmart-dev force-pushed the fix/directoryAsINodeByPath branch from d504579 to b5977e7 Compare November 20, 2025 17:23
@salmart-dev salmart-dev force-pushed the feature/54562/pathSpecificFSSetup branch from 70b0ecc to b94b74f Compare November 20, 2025 17:23
Signed-off-by: Salvatore Martire <[email protected]>
This commit adds a workaround to restore the functionality of apps that
rely on descending the file-tree to check for access permissions, like
files_accesscontrol. The navigation is done navigating the tree upwards,
from the target node, to the root node.

Signed-off-by: Salvatore Martire <[email protected]>
Signed-off-by: Salvatore Martire <[email protected]>
@salmart-dev salmart-dev force-pushed the fix/directoryAsINodeByPath branch from b5977e7 to 831e780 Compare November 26, 2025 09:06
@salmart-dev salmart-dev force-pushed the feature/54562/pathSpecificFSSetup branch from b94b74f to 7f26f7e Compare November 26, 2025 09:06
replace array_reduce + array_merge with array_merge(...)
replace conditional assignment with ??=

Signed-off-by: Salvatore Martire <[email protected]>
IMountProviders implementing this interface will be able to take
advantage of authoritative mounts.

The function `getMountsFromMountPoints` will receive the path that
the provider is asked to set-up and an array of IMountProviderArgs
providing information regarding the stored mount points and the
file cache data for the related root. The mount provider should verify
the validity of the mounts and return IMountPoints related to them.

Signed-off-by: Salvatore Martire <[email protected]>
@salmart-dev salmart-dev force-pushed the feature/54562/pathSpecificFSSetup branch from 7f26f7e to 6e43ef9 Compare November 27, 2025 14:07
@salmart-dev salmart-dev force-pushed the feature/54562/pathSpecificFSSetup branch from c0c82fd to 2477163 Compare November 28, 2025 16:31
@salmart-dev salmart-dev force-pushed the fix/directoryAsINodeByPath branch 4 times, most recently from 3959a22 to 7ae8463 Compare December 2, 2025 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. developing Work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Path specific file sytem setup

3 participants