Uploaded image for project: 'Hawkular Alerts'
  1. Hawkular Alerts
  2. HWKALERTS-220

Schema upgrade is broken

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more



    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Done
    • Affects Version/s: 1.5.0.Final
    • Fix Version/s: 1.5.1.Final
    • Component/s: Install/Upgrade
    • Labels:


      This issue came up earlier today in an OpenShift environment. I briefly talked with Jay Shaughnessy about it and looked at it in more detail later when I had more time. Schema was installed, but no Cassalog updates had been applied. It looks like the problem is in CassCluster.java where it performs some schema checks. Before running Cassalog, it executes some queries in a checker.cql. One of the queries it runs it to check for the existence of the conditions.interval column. Because the column does not yet exist, the checkSchema() method returns false and eventually an exception is thrown with this error message:

      Keyspace hawkular_alerts detected, but failed on check phase.

      And Cassalog never runs. The problem is that the conditions.interval column is supposed to be added in a Cassalog script. That script will never execute in update scenarios due to the schema check logic.

      There were some bad bugs early on with Cassalog that could leave the schema in an inconsistent state. Maybe that's why the schema check logic is there in CassCluster.java. Those bugs have been resolved, and I think that the schema check logic can be removed and just let Cassalog handle it.

      Lastly, I am not sure why hawkular-alerts has a bootstrap.groovy script. I assume you were copying what we did in hawkular-metrics. We had to write the code in our bootstrap.groovy because we retrofitting Cassalog onto existing installations. If hawkular-metrics had not already been in use in production deployments, we would not have a need for that bootstrap.groovy script. I strongly encourage you to reconsider replacing bootstrap.groovy with Cassalog scripts that use the schemaChange function.




            rutlucas Lucas Ponce
            john.sanda John Sanda (Inactive)
            samahaja Sagar Mahajan