Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-76181

Disaster recovery replication of installed plugins doesn't remove the file of old versions from the replication directory when a plugin (App) is updated

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low
    • None
    • 8.13.0, 8.20.0, 9.4.0, 9.10.0
    • Data Center - Other
    • None

      Issue Summary

      When installing an App through the UPM UI, App files (jar or obr) are placed in the <jira-shared-home>/plugins/installed-plugin directory – when on non-clustered data center the directory is located in <jira-local-home>.
      With file replication enabled as part of disaster recovery configuration, the same file is replicated to the secondary location.

      When updating an App through the UPM UI, the file of the latest version is placed in the <jira-shared-home>/plugins/installed-plugin directory and the older file is removed.

      The file replication works properly for the new App file, but the old file isn't removed from the replication home directory.

      This may become problematic specially when an App is uninstalled after an update.
      All the plugin files were properly removed from the production instance, while old files are left in the replication directory.

      Steps to Reproduce

      1. Install a vanilla instance of Jira Data Center.
        • This was validated on Jira Software Data Center versions 9.4.8 and 9.10.0.
      2. Configure a jira-home replication directory in the jira-config.properties file as detailed in Disaster Recovery Guide for Jira.
      3. As an administrator, go to Administration > System > Replication and configure replication for all file types.
      4. On the Replication admin page, click on the Synchronize button and confirm the plugins/installed-plugins directory was properly synchronized.
      5. Go to the Atlassian Marketplace and download an old version of your preferred App.
      6. Install the selected App via file upload on the UPM UI.
        1. Go to Administration > Manage Apps > Manage Apps.
        2. Click on Upload App, select the file of the App from the previous step and click on Upload.
      7. Confirm the App .jar file is in the <jira-shared-home>/plugins/installed-plugins directory as well as on the <jira-replication>/plugins/installed-plugins directory.
        • On the testing the file plugin_7106125367713506086_rest-api-browser-3.2.0.jar was placed on both directories.
      8. From the UPM UI, upgrade the target App to the latest version by clicking on the Update button.
      9. Confirm the App .jar files in the <jira-shared-home>/plugins/installed-plugins directory.
        • The file of the previous version was removed and the file for the new version is there.
        • For the testing, plugin_7106125367713506086_rest-api-browser-3.2.0.jar file was removed and plugin.7025042876026987400.rest-api-browser-3.2.3.jar is there for the latest version of the App.
      10. Confirm the App .jar files in the <jira-replication>/plugins/installed-plugins directory.

      Expected Results

      The results are the same as from the <jira-shared-home>/plugins/installed-plugins.
      The file of the previous version was removed and the file for the new version is there.

      Actual Results

      Both files are there in the <jira-replication>/plugins/installed-plugins directory.
      The new jar file is properly synchronized as expected.
      The jar file for the previous version isn't removed, which is the bug.

       jira-prod-shared-home % ls -ltra plugins/installed-plugins/plugin*
      -rw-r-----  1 jira  jira  1207456 Aug 21 12:32 plugins/installed-plugins/plugin.7025042876026987400.rest-api-browser-3.2.3.jar
      
       jira-replication-home-test % ls -ltra plugins/installed-plugins/plugin* 
      -rw-r-----  1 jira  jira  1207755 Aug 21 12:29 plugins/installed-plugins/plugin_7106125367713506086_rest-api-browser-3.2.0.jar
      -rw-r-----  1 jira  jira  1207456 Aug 21 12:33 plugins/installed-plugins/plugin.7025042876026987400.rest-api-browser-3.2.3.jar
      

      Workaround

      Disable the feature to replicate Apps/plugins and rely on external replication tools such as:

      • Periodically run rsync to ensure manual and automatic changes are replicated.
      • Use inotify to monitor changes and trigger a synchronization through rsync.

              Unassigned Unassigned
              tmasutti Thiago Masutti (Inactive)
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: