Azure Blob Storage on IoT Edge: Power Loss and Database Corruption

Ryan Aylward 131 Reputation points
2020-05-28T21:34:26.18+00:00

I am running Blob Storage on IoT Edge using the supplied module and following the recommendations made here: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-store-data-blob

My use case is to stage recurring uploads (~3MB files) from the device to the cloud in case of an intermittent network connection. I am using the functionality built in to the azureblobstorageoniotedge module to do the uploads, so I put blobs into a local storage directory and expect them to be gradually uploaded to the cloud some time later, at which point they are deleted from local storage.

However, it is apparent that azureblobstorageoniotedge maintains a database to do this, and I have seen the database get into a bad state (blob storage module crashes with inability to find a specific database file). The module never recovers from this state unless the Database folder it creates is manually deleted so that it can start over. I suspect that database corruption is related to unexpected power loss. We don't have a controlled shutdown for our device and at least in development this is likely to occur.

Can you confirm that database corruption is a risk with unexpected termination of the azureblobstorageoniotedge module? Note that in this case, the local storage is implemented on an SD card and the OS is Linux, aborted writes to the SD card may be the true root cause.

Assume that we have to accept the possibility of database corruption, but data loss is ok. Is there any way for azureblobstorageoniotedge to recover from a clean slate rather than crashing?

Azure IoT
Azure IoT
A category of Azure services for internet of things devices.
400 questions
Azure IoT Edge
Azure IoT Edge
An Azure service that is used to deploy cloud workloads to run on internet of things (IoT) edge devices via standard containers.
576 questions
{count} vote

Accepted answer
  1. Ryan Aylward 131 Reputation points
    2020-09-02T19:12:55.82+00:00

    I found the root cause of the problem was corruption on the SD card combined with Linux automatically remounting the card in read-only mode when the corruption is detected. If I remount the card in read/write mode, the Azure blob storage module can recover from the failure.

    -Ryan

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. QuantumCache 20,271 Reputation points
    2020-06-05T21:40:13.517+00:00

    Hello @RyanAylward-2010 Just checking back, could you please confirm the Linux OS version of your IoT Edge Device and it's architecture used ?. Also please confirm if you are using Azure Blob Storage on IoT Edge 1.3 version ? We would like to know which system you have used among Tier 1 or Tier 2 ?


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.