Uploaded image for project: 'VOLTHA'
  1. VOLTHA
  2. VOL-1801

Inconsistent data update

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Resolved (View Workflow)
    • Priority: Medium
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Deprecated - VOLTHA
    • Labels:
      None
    • Story Points:
      3

      Description

      In the code below, during the merge, the model is locked and the device info is retrieved from the cache or db and the new values merged on it. Then the lock is released and the deviceMgr.updateDevice is called to update the db. Sometimes during heavy traffic some other thread(doing DeviceStateUpdate or DeviceUpdate) acquires the lock at that point and changes the device object for current device. In this case the merged device object becomes inconsistent and keeps the old values on it. So the old and inconsistent merged value reverts the device to old values in deviceMgr.updateDevice. This generally cause the ONU device to stay in wrong state. 

      The merging and the update should be in a single lock block.

      //Merge the adapter device info (only the ones an adapter can change) with the latest device data

      if updatedDevice, err := rhp.mergeDeviceInfoFromAdapter(device); err != nil

      { *return* nil, status.Errorf(codes.Internal, "%s", err.Error()) }

      else {

      go rhp.deviceMgr.updateDevice(updatedDevice)

      //if err := rhp.deviceMgr.updateDevice(updatedDevice); err != nil

      { //return nil, err //}

      }

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            mahirgu Mahir Gunyel
            Reporter:
            mahirgu Mahir Gunyel
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes