SMART Schedule bug?

FrankWard

Explorer
Joined
Feb 13, 2023
Messages
71
I've got a schedule setup in Core running for about a year no issue, and I am using the exact same approach in Scale.
  • LONG - Bi-Weekly - 10th/24th - 5AM, 5 10,24 * *

  • SHORT - Weekly - Sunday - 5AM, 5 * * sun
I create the Long test in the GUI and save. I the create Short test and it spits out this error which is wrong (A LONG test already runs at Day 10th of every month, Sun, 05:00). If I set the time to 6:00 it will work. Is this a bug or am I missing something?

ValidationErrors​

[EINVAL] smart_test_update.data.schedule: A LONG test already runs at Day 10th of every month, Sun, 05:00
remove_circle_outlineMore info...
Error: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/middlewared/main.py", line 204, in call_method result = await self.middleware._call(message['method'], serviceobj, methodobj, params, app=self) File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1344, in _call return await methodobj(*prepared_call.args) File "/usr/lib/python3/dist-packages/middlewared/service.py", line 951, in update rv = await self.middleware._call( File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1344, in _call return await methodobj(*prepared_call.args) File "/usr/lib/python3/dist-packages/middlewared/schema.py", line 1378, in nf return await func(*args, **kwargs) File "/usr/lib/python3/dist-packages/middlewared/schema.py", line 1246, in nf res = await f(*args, **kwargs) File "/usr/lib/python3/dist-packages/middlewared/plugins/smart.py", line 365, in do_update verrors.check() File "/usr/lib/python3/dist-packages/middlewared/service_exception.py", line 70, in check raise self middlewared.service_exception.ValidationErrors: [EINVAL] smart_test_update.data.schedule: A LONG test already runs at Day 10th of every month, Sun, 05:00
 

Ryan892

Cadet
Joined
Apr 12, 2023
Messages
5
The issue here is that Scale won't let you create multiple SMART schedules that run at the same time, or can overlap with other SMART schedules. Both your long and short tests run at 5am which opens the door for an overlap date. The long test is a bi-weekly setup that will only run on the 10th or 24th of each month. The important part here is that your short test is a weekly test that runs each Sunday. Your long test runs on specific date numbers, not week date names, so the 10th or 24th has a chance of falling on a Sunday.

An example of this on this year's calendar is the date 12-10-23 which is a Sunday.

You can fix this by changing the schedules a bit, or as you did, changing the hour at which they run. Though in my opinion, I would change your short test to happen at a different date from the long test since it doesn't make sense to have the long test start, then not give it enough time (1 hour only from your example) to complete before running a short test. There are multiple ways to set up the schedule to run in ways that both don't interfere with each other.
 

FrankWard

Explorer
Joined
Feb 13, 2023
Messages
71
Thanks Ryan. As stated, this schedule has been running for a year on Core which never reported this as an issue. I guess this a bug in Core that allows this overlap?
 

Ryan892

Cadet
Joined
Apr 12, 2023
Messages
5
I'm not sure. It could be a bug on Core. Then again, I'm not sure what happens if both a short and long test are ran on the same disks at the same time.

Maybe it only checks for date overlaps for up to a single year, and when you created it previously on Core, it didn't overlap on any date of that calendar year. Just a guess, but I don't use Core, so I can't test this out to see if you can re-create your smart tests again.
 
Top