Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Predict database migration impact of upgrades #45943

Open
1 of 5 tasks
ChristophWurst opened this issue Jun 18, 2024 · 5 comments
Open
1 of 5 tasks

Predict database migration impact of upgrades #45943

ChristophWurst opened this issue Jun 18, 2024 · 5 comments

Comments

@ChristophWurst
Copy link
Member

ChristophWurst commented Jun 18, 2024

How to use GitHub

  • Please use the 👍 reaction to show that you are interested into the same feature.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Is your feature request related to a problem? Please describe.

As a Nextcloud admin I want to be able to plan when to do the next upgrade based on how long it will take. Quick updates that pass in 10 minutes can be done without any significant downtime. If the upgrade runs for 12h it needs a scheduled maintenance window, e.g. on a weekend, where Nextcloud is not available and users have to be warned in advance.

Describe the solution you'd like

Collect information about the changes done in migration files for server and the apps. Distribute the information through the updater server and the app store. Use the information locally diff applied and new migrations, then show a digest of all the changes that will be done, or tell me that there will be no database changes when I upgrade.

Work packages

  • Add PHP attributes to annotate migration classes, e.g. "adds a new column to oc_filecache", "creates a new table" or "drops a column from oc_accounts".
  • Adapt the server release script so it dumps a list of migrations and their changes for server and shipped apps. It's important that the list contains all migrations, not just the ones that are "new" because we don't know which version is upgraded from.
  • Adapt the updater server to ship a list of all migrations inside a specific release
  • Adapt the app store to ship a list of all migrations inside a specific release
  • Add an occ command to query for updates
    • Query the updater server for the next release and its migration data
    • Check for app upgrades necessary (e.g. doing a major update of the server)
    • Show a list of the changes that will happen on server and apps upgrade

Follow-ups

  • Adapt the admin updater UI
    • Fetch migrations of the upcoming release
    • Check for app upgrades necessary (e.g. doing a major update of the server)
    • Show a list of the changes that will happen on server and apps upgrade
  • Adapt the app management (changelog tab?)
    • Diff currently applied migrations with the list of migrations provided through the app store
    • Show a list of the changes that will happen on app upgrade

Describe alternatives you've considered

Download server and apps, look at the migration files and parse the code to find out the information.

Additional context

N/a

@ChristophWurst
Copy link
Member Author

@AndyScherzinger @juliushaertl as discussed

@AndyScherzinger
Copy link
Member

@sorbaugh @artonge something for next week to discuss.

@AndyScherzinger AndyScherzinger added this to the Nextcloud 30 milestone Jun 28, 2024
@ChristophWurst ChristophWurst added 1. to develop Accepted and waiting to be taken care of and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Jul 8, 2024
@ArtificialOwl
Copy link
Member

After some discussions:

  • details about migrations will be defined by \Attributes for each Migrations files,
  • core migrations will be extracted during the release process and stored in the update server,
  • apps migrations will be parsed and stored by the appstore,
  • data from update server and appstore will be compared with already done migration and data will be generated.
  • data will be available from an occ command and a resume should be made available on the webpage that displays available new versions.

@AndyScherzinger AndyScherzinger linked a pull request Jul 18, 2024 that will close this issue
11 tasks
@AndyScherzinger AndyScherzinger removed a link to a pull request Jul 27, 2024
11 tasks
@juliushaertl
Copy link
Member

We should also think about a ci check so that we make those attributes mandatory on shipped apps, otherwise we risk missing those in the future

@ChristophWurst
Copy link
Member Author

A visitor like \OcpSinceChecker could do this in Psalm

@skjnldsv skjnldsv modified the milestones: Nextcloud 30, Nextcloud 31 Aug 14, 2024
@susnux susnux added 2. developing Work in progress and removed 1. to develop Accepted and waiting to be taken care of labels Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ☑️ Done
Development

No branches or pull requests

7 participants