Pause Completed Download Handling While SnapRAID Is Running

Firstly, loving Sonarr, really nice work guys.

I use SnapRAID to protect my TV/Movies storage array. Snapraid is not a real-time raid solution. Mine runs once per day to calculate new hashes, build new parity and scrub the array. While snapraid is running, no writes should happen to the snapraid array.

When Sonarr’s Completed Download Handling function moves a file during a snapraid update, it causes an error and I have to manually run snapraid again to properly sync the array. If another write occurs I need to start it again a third time, and so on. I would imagine anyone using a non-realtime raid program like flexraid or snapraid would have this problem as well.

It would be great if we could have, say, an option to pause the Completed Download Handling function while a certain .exe is running (eg. snapraid.exe). Sonarr can continue to index, download etc. as normal. Only the completed download handling ie. moving of files needs to be paused.

How about running snapraid on another hour ? My downloads normally happen between 01:00-10:00 so if you run the .exe lets say at 14:00 you will not have this problem. Just my two cents

I’m in Australia, my downloads happen all over the place at many different times.
I’ve scheduled snapraid to run at 4:00 am but still sometimes a download will finish at 4:15 am and interrupt the snapraid job.

I’ve been trying to think of a way to sort this out myself, but short of killing nzbdrone.exe altogether and then starting it again afterward, I don’t see how I can solve the problem. Killing the nzbdrone.exe task will stop sonarr from scanning for new episodes and monitoring rss feeds, so I will potentially miss new episodes if I do that.

Sorry for highjacking the thread…
Can I ask you how long the SnapRAID session takes and how much data you have?
I have look into SnapRAID for a “poor mans backup” solution…

I don’t see this being something we directly support, but could (if we go this route) handle it in a pre-processing script.

@markus101 that’s not what he means. he simply wants to pause sonarr processing new downloads while his server to prevent IO.

TBH, Karnov, you should just shutdown sonarr for a while. Depending on how long the rebuild takes it shouldn’t be a problem at all.

Yeah, exactly, that would let a script tell Sonarr to delay processing (if we add it).

Thanks for the replies. If the pre-processing script idea is implemented I might be able to sort something out using that.

If I change my snapraid script to use taskkill to stop Sonarr, I’m kinda worried that my script could kill it while it is in the middle of an important task, leaving Sonarr in an inconsistent state and possibly leading to file corruption? Not sure what happens if you taskkill Sonarr without the /F option? I think windows should give it time to shutdown gracefully (?)
Anyone know for sure?

The other potential issue is that if it is down for an hour+ then it might miss episodes on RSS feeds that change rapidly. I doubt many RSS feeds would change that rapidly, might have to try it and find out. =)

@Tommy_Einarsson

I have a 40TB raw array (32 TB usable with 2 x 4TB parity drives) consisting of 7 x 4TB drives + 6 x 2TB drives. I use snapraid with dual parity. Hashing and parity calculation are both limited entirely by I/O bandwidth. CPU usage normally hovers around 3-5% when syncing. Snapraid is very efficient in this respect. The machine is an i3-4130 on a H87 motherboard with 8GB ram.

A sync normally takes maybe 20-30 minutes, except for example when Sonarr has just replaced a season with a higher quality one. Then it might be an hour or so to sync. Syncing is like an incremental backup. Only files that are new, updated or moved are part of the sync operation. If you only added a few tv show episodes each day then syncing could be done in 5-10 minutes.

Scrubbing depends entirely on how much data is in your array and how much of it you want to scrub each day. I scrub 3% of 21.8TB each day and it takes about 30 minutes to do that.

I’ve heard people say that snapraid is a “poor mans backup” solution. I understand why they say that, but I don’t agree. I have several hardware raid adapters capable of raid 6. I don’t use them except to attach single drives in pass-through mode. I’ve lost data to silent corruption before and don’t trust hardware raid now. I’ve also used ZFS and BTRFS in the past. I moved on to snapraid because it has advantages over all of those systems. See here: http://www.snapraid.it/compare

Why not just pause the download client before snapraid starts and then unpause once it completes?

I’m trying to do this automatically. I don’t know of any way to script a pause of all downloads in uTorrent. Also it is not necessary as uTorrent downloads to another drive which is not part of the array. So uTorrent can continue to download without interrupting snapraid, which I would prefer as pausing downloads for 30-60 mins is a bit of a waste of time. It just means downloads take longer than they need to.

It really is only Sonarr’s completed download handling that interrupts snapraid. I have carefully set up all other automated programs so they don’t interfere with a snapraid sync, but I can’t see a clean way to do this for sonarr. That is unless the devs add a feature to run a pre-processing script as markus101 suggested, or add a way to control/pause completed download handling.

TL;DR It’s not the download client that is causing the problem, but pausing it would prevent the problem I guess. But I don’t know of a way to do that with uTorrent. Thanks for the suggestion though.

uTorrent has a scheduler. and a bandwidth limit.

Seriously, SHUT SONARR DOWN WHILE SCRUBBING! It’s 30 frigging minutes. Depending on the indexer Sonarr can cover anything between 2-24h hour outages.

Alternatively look into simply unmounting the snapraid array, if possible, or make it readonly during scrub.

Edit: see kayone’s response below.

I run snapraid as well, there is really nothing destructive that can happen if your sync or scrub fails because a new file was added to the disk, few suggestions that I have that could resolve your issue is, make sure you are using the latest version of snapraid, I remember they had some issues with corrupted parity in older versions which is much much better now,

the other suggestion is to increase the interval you run sync, maybe every 6 hours, what that’ll do is reduce the window it needs in each sync, and incase a sync fails because new files were added during sync you get another sync soon which should cover for the last failed one.

I was going to add a loop to my sync script, so it backs off for 5 mins after a failed sync then tries again. But I like your suggestion better. I think I will set it up to sync a couple of times a day and if its still not syncing fast enough, then I’ll increase it.

Just checked, I’m on snapraid 9.3 so all is good.

Thanks for your suggestion, I think it should work well. =)

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.