Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-9602

EventParameterMigratorOffline task fails when eventparms contains empty strings

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 21.0.0
    • Fix Version/s: 21.0.0
    • Component/s: Database
    • Security Level: Default (Default Security Scheme)
    • Labels:
      None
    • Sprint:
      Horizon - August 23rd

      Description

      While running the upgrade task on a database:

      opennms=# select count(*) from events;
        count
      ---------
       1197013
      (1 row)
      

      The upgrade task got stuck in a continuous loop:

        Processed 1290160 eventparms entries, 7289355 event parameters inserted...
        Processed 1291812 eventparms entries, 7289355 event parameters inserted...
        Processed 1293464 eventparms entries, 7289355 event parameters inserted...
        Processed 1295116 eventparms entries, 7289355 event parameters inserted...
        Processed 1296768 eventparms entries, 7289355 event parameters inserted...
        Processed 1298420 eventparms entries, 7289355 event parameters inserted...
        Processed 1300072 eventparms entries, 7289355 event parameters inserted...
        Processed 1301724 eventparms entries, 7289355 event parameters inserted...
      

      The remaining events have an empty string for eventparms:

      SELECT eventid, eventparms FROM events WHERE eventparms IS NOT NULL LIMIT 2000;
       eventid | eventparms
      ---------+------------
          1764 |
            91 |
           131 |
          1847 |
          1845 |
          1848 |
          1856 |
      

      I think we need to make sure that we "nullify" these rows as well:
      https://github.com/OpenNMS/opennms/blob/709bd43d72cfbc40bf58e9dffec11b5b25334b36/core/upgrade/src/main/java/org/opennms/upgrade/implementations/EventParameterMigratorOffline.java#L116

      Workaround for now is to run this prior to starting the task:

      opennms=# UPDATE events SET eventparms=NULL WHERE eventparms='';
      UPDATE 1652
      

        Attachments

          Activity

            People

            • Assignee:
              cpape Christian Pape
              Reporter:
              j-white Jesse White
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: