3 Replies Latest reply on Mar 25, 2013 3:08 AM by huchangchun

    Could you remove legacy code in RHQ Database Utilities project

    huchangchun

      Dear RHQ Team,

      Since test suite about db upgrade are start from RHQ 3.0.0.GA in latest master branch, some codes are no longer needed as they are not in use. I list the code as below for your information. It is much appreciated if you could remove it? It will be easier for us to read RHQ code. Many thanks.

      1. schemaSpec between 2.70 and 2.90 in /rhq/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml file
        • Because the DB_SCHEMA_VERSION defined in /rhq/modules/core/dbutils/src/main/scripts/dbsetup/2.4.0/db-data-combined-2.4.0.xml. is 2.91, schemaSpecs older than it never be called now.
      2. /rhq/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/AbstractConfigurationObfuscationUpgradeTask.java
      3. /rhq/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java

      Many thanks and best regards.

      Changchun

        • 1. Re: Could you remove legacy code in RHQ Database Utilities project
          lkrejci

          DB upgrade code and XML is there to support upgrading from older versions of RHQ and therefore no code/xml should ever be deleted from it unless we decide that we cannot upgrade from certain revision of the database anymore.

           

          The DB setup on contrary is used when setting up a new database and hence doesn't necessarily have to contain all the past revisions because, well, you only really setup the current version - i.e whatever version of RHQ you download you only want to setup the DB for that particular version, not a past version. I am not 100% sure here, but dbsetup/2.4.0/db-data-combined.xml is the set of data that is used to initialize the database possibly for JBoss ON 2.4.0 (there has never been a version of RHQ with that version). As such I'd consider that a candidate for removal unlike the upgrade-related XML and java code.

          • 2. Re: Could you remove legacy code in RHQ Database Utilities project
            jayshaughnessy

            Actually, I very recently trimmed db-upgrade.xml for the first time in its history.  I removed a lot of old upgrade steps.  At around the same time I had also removed some of the old dbupgrade tests that were testing 2.* upgrades.  I will take another look and see if we can trim further based on your recommendations.  We need  to maintain anything related to supported versions of the JON product, but perhaps there is still more we can remove.

            • 3. Re: Could you remove legacy code in RHQ Database Utilities project
              huchangchun

              Jay and Lukas, thanks for your reply. It helps me understand the story. Best regards.