stefanprodan/mgob

Azure blob storage filename issue

rprinsen opened this issue · 0 comments

Hey Stefan!
Firstly, thanks for developing this. Tool works like a charm.
However, I found an issue with Azure blob storage.

The default name for a backup file is something like this:
"/storage/daily/daily-1561690800.gz"

However, as I found out from Azure tech support, they seem to have an issue with file names starting with an '/'.
It writes fine to the storage, however, because there's a leading slash, the lifecycle policy system cant delete this file (lifecycle policy is an azure system that can automatically delete files in cold storage).

To quote Azure support:

Update on 22/08: PG has addressed the issue and provided the workaround.
Root Cause:
Lifecycle management has hit a bug which prevents lifecycle policy from working on blobs which have start with “/” in their name.

Workaround:
The bug fix required is involved and will take time (in the order of months) to get fully deployed. In the meantime, we recommend that you explicitly call delete on such blobs until the fix is fully deployed. The rest of blobs which don’t start with / should be able to be managed automatically
by the policy.

Currently I do hourly backups within the mgob pod (which expire after 24 hours), but upload a daily backup to Azure cool storage. However GDPR guidelines force me (for good reason) to remove backups after a month. Azure Lifecycle Policy helps me to do this automatically.

I am fully aware that this is an Azure issue, however, is it possible to remove the leading slash in the filename when uploading the file to Azure?

I'm not well versed in Go, but I can imagine removing a leading slash is something I can fix myself and submit a pull request. However am not sure if that would break something down the line (or if the PR will be accepted because technically this no issue in mgob).

So filing this issue to let you (and others) know that Azure Lifecycle Policy isn't working well with mgob, and possibly some tips for a workaround :)

Thanks and best regards,
Rienk