Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confused about scrub frequency #34

Closed
Ovear opened this issue Sep 16, 2022 · 4 comments · May be fixed by #35
Closed

Confused about scrub frequency #34

Ovear opened this issue Sep 16, 2022 · 4 comments · May be fixed by #35

Comments

@Ovear
Copy link

Ovear commented Sep 16, 2022

Hi,
The scrub settings in omv are described as "scrub frequency's unit is day", which means it will determined how many days when it executed.

But according code, the currently implements add scrub counter one by one when execute. Code here.

So with default settings, system executes omv-snapraid-diff every week, and scrub counter target is set to 7, in this situation it will only scrub every 7 * 7 = 49 days.

But if change settings to run this script every days, it will scrub array every 7days.

The describe here is a bit confused, so i will suggest to change description or reimplement this feature to fit it claimed currently.

I think we can reocrd last date that the scripts scubed, and use current date to compared with it to determin if should scrub again.

@Ovear
Copy link
Author

Ovear commented Sep 17, 2022

I noticed that scrub will only run if there are change in array, and will only scrub after sync completed.

According documents from snapraid, the scrub job should run every week at least even there are nothing change in array to proect data from damaged(particularly silent error), and only scrub in synced array.

That's means we should run scrub jobs even there are nothing change in array if it's a synced array.

I am also going to implemet this in scripts and submit to previous pull request.

@thenebular
Copy link

Scrub absolutely needs to be run regularly even if there has been no change, but if there has been changes but it's below the threshold set for a sync, then a scrub won't have the information for the current data and it could end up trying to fix something that was changed. I think that the script should be changed to run a sync after a predetermined time regardless if there are no, or so few changes that it didn't trigger a sync earlier. That way you can make sure the scrub is run regularly sync data that reflects the current state of the disk.

@Ovear
Copy link
Author

Ovear commented Sep 27, 2022

Hi,
This is exactly what I implemented on the new version scripts. And I have changed to using new scripts without any problem for a few weeks.

But according to the author's' suggestion, we may find another volunteer who is also using SnapRaid to test it and ensure everything works as expected. So, @thenebular could you have a test?

The usage is simple, just disable cron of old version, and upload the new version to anywhere you want, just remember to give it execute permission. Then add scripts to cron according to your settings. And we may go on to that PR.

Scripts action that I implemented currently just for your reference.

  1. Try to sync our array and will exit with an email if hit our threshold.
  2. Regardless of whether the array is changed or not, once we have synced array and meet our scrub interval, scrub array as we configured.
  3. Send an email with full logs the scripts ran.

Scrub absolutely needs to be run regularly even if there has been no change, but if there has been changes but it's below the threshold set for a sync, then a scrub won't have the information for the current data and it could end up trying to fix something that was changed. I think that the script should be changed to run a sync after a predetermined time regardless if there are no, or so few changes that it didn't trigger a sync earlier. That way you can make sure the scrub is run regularly sync data that reflects the current state of the disk.

@ryecoaaron
Copy link
Member

Closing due to age.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants