Skip to content

fix(metadata): set background job on fresh setup - #52375

Merged
provokateurin merged 1 commit into
masterfrom
fix/noid/metadata-on-fresh-setup
May 7, 2025
Merged

fix(metadata): set background job on fresh setup#52375
provokateurin merged 1 commit into
masterfrom
fix/noid/metadata-on-fresh-setup

Conversation

@ArtificialOwl

@ArtificialOwlArtificialOwl commented Apr 23, 2025

Copy link
Copy Markdown
Member

until now, only an upgrade will add the job to the list:

https://github.com/nextcloud/server/blob/master/lib/private/Repair/AddMetadataGenerationJob.php#L24

The background job is mainly to create metadata on files added previously to the upgrade that implemented the FilesMetadata feature.
This background job is useless on fresh setup that already implement the feature.
Adding the background job on fresh setup instead of waiting for the next execution of the Repair Step disable the huge process at first upgrade once the cloud and filesystem are filled with users+documents

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
@ArtificialOwl
ArtificialOwl requested a review from a team as a code ownerApril 23, 2025 14:58
@ArtificialOwl
ArtificialOwl requested review from Altahrim, come-nc and provokateurin and removed request for a teamApril 23, 2025 14:58
@ArtificialOwl

Copy link
Copy Markdown
MemberAuthor

/backport to stable31

@ArtificialOwl

Copy link
Copy Markdown
MemberAuthor

/backport to stable30

@ArtificialOwlArtificialOwl added the 3. to review Waiting for reviews label Apr 23, 2025
@ArtificialOwlArtificialOwl added this to the Nextcloud 32 milestone Apr 23, 2025

@provokateurinprovokateurin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Makes sense 🙈

@nextcloudnextcloud deleted a comment from ArtificialOwlApr 23, 2025
@provokateurin

Copy link
Copy Markdown
Member

@ArtificialOwl 29 is EOL so no backports anymore ;)

@come-nc

Copy link
Copy Markdown
Contributor

The background job is mainly to create metadata on files added previously to the upgrade that implemented the FilesMetadata feature. This background job is useless on fresh setup that already implement the feature. Adding the background job on fresh setup instead of waiting for the next execution of the Repair Step disable the huge process at first upgrade once the cloud and filesystem are filled with users+documents

I do not understand, if the job is useless on fresh setup, why add it 🤔

@ArtificialOwl

Copy link
Copy Markdown
MemberAuthor

The background job is mainly to create metadata on files added previously to the upgrade that implemented the FilesMetadata feature. This background job is useless on fresh setup that already implement the feature. Adding the background job on fresh setup instead of waiting for the next execution of the Repair Step disable the huge process at first upgrade once the cloud and filesystem are filled with users+documents

I do not understand, if the job is useless on fresh setup, why add it 🤔

to not restart the job with more files later

@come-nc

Copy link
Copy Markdown
Contributor

I do not understand, if the job is useless on fresh setup, why add it 🤔

to not restart the job with more files later

How does that prevent it?

@ArtificialOwl

Copy link
Copy Markdown
MemberAuthor

I do not understand, if the job is useless on fresh setup, why add it 🤔

to not restart the job with more files later

How does that prevent it?

The background job will set a value in appconfig once over
https://github.com/nextcloud/server/blob/master/core/BackgroundJobs/GenerateMetadataJob.php#L76

There is no need to run it on the next upgrade because Metadata are generated on the fly during file creation

@come-nc

Copy link
Copy Markdown
Contributor

I do not understand, if the job is useless on fresh setup, why add it 🤔

to not restart the job with more files later

How does that prevent it?

The background job will set a value in appconfig once over https://github.com/nextcloud/server/blob/master/core/BackgroundJobs/GenerateMetadataJob.php#L76

There is no need to run it on the next upgrade because Metadata are generated on the fly during file creation

Feels like it would’ve been easier to set the value than add a background job for it, but okay.

@provokateurin
provokateurin merged commit 7880a5c into masterMay 7, 2025
@provokateurin
provokateurin deleted the fix/noid/metadata-on-fresh-setup branch May 7, 2025 07:40
@backportbot

Copy link
Copy Markdown

The backport to stable30 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable30
git pull origin stable30
# Create the new backport branch
git checkout -b backport/52375/stable30
# Cherry pick the change from the commit sha1 of the change against the default branch# This might cause conflicts, resolve them
git cherry-pick 65a2b3b6
# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/52375/stable30

Error: Failed to push branch backport/52375/stable30: remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/nextcloud/server.git/'


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@solracsf

Copy link
Copy Markdown
Member

/backport to stable30

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@ArtificialOwl@provokateurin@come-nc@solracsf@skjnldsv