Upgrade seems to be slow / takes a lot of time (OD-1071)
wojtek opened 3 years ago

I just upgraded from 7.8.13 to 7.9.0. We currently don't have many projects (like 5 parent projects without any real data). The backup file is only 69KB:

root@onedev-5cdc8886f6-6vfzm:/# ls -lah /opt/onedev/site/db-backup/2023-01-02_14-47-39.zip
-rw-r--r--. 1 root root 69K Jan  2 14:48 /opt/onedev/site/db-backup/2023-01-02_14-47-39.zip

yet the upgrade takes almost 2 minutes (btw. it would be nice to have timestamps for all entries. I guess not using logger here is the culprit?):

INFO  - Backing up old program files as /opt/onedev/site/program-backup/2023-01-02_14-47-39...
INFO  - Backing up database as /opt/onedev/site/db-backup/2023-01-02_14-47-39.zip...

(...)

INFO  - ********** Successfully upgraded /opt/onedev **********
INFO  - Stopping server...
14:49:25 INFO  i.onedev.commons.bootstrap.Bootstrap - Launching application from '/opt/onedev'...
14:49:25 INFO  i.onedev.commons.bootstrap.Bootstrap - Cleaning temp directory...
14:49:25 INFO  io.onedev.commons.loader.AppLoader - Starting server...

This seems like a lot and I fear it will take even longer for when we manage to migrate everything and fill the data (~200 projects, thousands of issues). Have you run any benchmarks in that case? Is there any way to speed up the upgrade process?

  • Robin Shen commented 3 years ago

    This site has thousands of issues and builds, and can be upgraded within one minute. Please test with real data to see how long it takes at your side.

  • Robin Shen changed state to 'Closed' 3 years ago
    Previous Value Current Value
    Open
    Closed
  • wojtek commented 3 years ago

    I just managed to upgrade our installation (from 7.9.0 to 7.9.3) but I guess there weren't any schema changes thus there were no database upgrade even though there is a mention about it:

    INFO  - Launching application from '/app'...
    INFO  - Starting server...
    INFO  - Upgrading /opt/onedev...
    INFO  - >>> INFO  - Launching application from '/opt/onedev'...
    INFO  - >>> INFO  - Cleaning temp directory...
    INFO  - >>> INFO  - Starting server...
    INFO  - Old data version: 107
    INFO  - >>> INFO  - Stopping server...
    INFO  - Backing up old program files as /opt/onedev/site/program-backup/2023-01-09_21-08-32...
    INFO  - Copying new program files into /opt/onedev...
    INFO  - ********** Successfully upgraded /opt/onedev **********
    

    PS. Could you please not close tickets that fast? Without virtually no new version to upgrade that happened at that time to provide you with more data?

  • Robin Shen commented 3 years ago

    Please feel free to reopen the issue if you find it is a problem later.

  • wojtek commented 3 years ago

    So, while working on trying to upgrade the installation (https://code.onedev.io/onedev/server/~issues/1392) I once again ran into the issue. Untill the error the upgrade was already running for about 4-5 minutes...

    Btw. Could you use logger with timestamps? It would make reporting this issue and giving you more precise data easier...

  • wojtek changed state to 'Open' 3 years ago
    Previous Value Current Value
    Closed
    Open
  • Robin Shen changed state to 'Closed' 2 years ago
    Previous Value Current Value
    Open
    Closed
  • Robin Shen commented 2 years ago

    Upgrade needs to export whole database, peforming upgrade, and reimport. It will be slower compared with in-place upgrade via sql, but is much flexible, and easier. The upgrade time is about 15 minutes for 1 million issue record, and should be acceptible for most installations.

issue 1/1
Type
Improvement
Priority
Minor
Assignee
Issue Votes (0)
Watchers (4)
Reference
OD-1071
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover