auto-labeling new volumes takes too long
Summary
Reproducibility | Platform | OS | OS Version | Product Version |
---|---|---|---|---|
always | AMD64 | debian | 10 | 9.4.2 |
Description
Something is not right with volume labeling. It takes too much time to auto-label a new volume.
Here's the current situation with a relatively new pool:
| 16 | Offsite | 1,331 | 5,000 | 4,294,967,296 | 15,552,000 | 1 | Backup | Offsite-
05-Mar 08:31 x-sd JobId 228951: End of medium on Volume "Offsite-15335" Bytes=4,294,950,902 Blocks=66,576 at 05-Mar-2024 08:31.
05-Mar 08:33 x:dir JobId 228951: Created new Volume="Offsite-15336", Pool="Offsite", MediaType="File" in catalog.
2 mins for labeling.
Here's the situation for old pool with hell lot of jobs:
| 8 | Full-Pool | 9,813 | 9,850 | 4,294,967,296 | 15,552,000 | 1 | Backup | Full- |
29-Feb 11:11 x-sd JobId 228793: End of medium on Volume "Full-13978" Bytes=4,294,958,966 Blocks=66,581 at 29-Feb-2024 11:11.
29-Feb 11:16 x:dir JobId 228793: Created new Volume="Full-13987", Pool="Full-Pool", MediaType="File" in catalog.
29-Feb 11:16 x-sd JobId 228793: Labeled new Volume "Full-13987" on File device "xx" (/xx).
5 mins wait time.
During this time, it seems to be going through volumes and jobs(?) in the DB:
SELECT 1 FROM JobMedia WHERE MediaId=14014 LIMIT 1
SELECT 1 FROM JobMedia WHERE MediaId=14032 LIMIT 1
SELECT DISTINCT JobMedia.JobId FROM JobMedia,Job WHERE MediaId=14316 AND Job.JobId=JobMedia.JobId AND Job.JobTDate\<1694104985 AND Job.JobStatus NOT IN ('R', 'C')
.... and so on, alternating...
SELECT 1 FROM JobMedia WHERE MediaId=15302 LIMIT 1
I hope you've got the idea. It's doing something that's highly irrelevant to new volume labeling. If you're about to label a new volume, why go through all that DB work? Just label and attach, and start writing. Is it doing pruning? Why after (before?) each new volume labeling, why not on schedule or before/after a job run?
We've got a pretty standard config, nothing exceptional. The DB is on SSD. I can't imagine the time it would take had it been on HDD. Thanks.
Additional Information
+-------+-------------+--------------------+
| Jobs | Files | Bytes |
+-------+-------------+--------------------+
| 4,746 | 773,689,444 | 58,658,979,648,483 |
Pool {
Name = Full-Pool
Pool Type = Backup
Recycle = yes
AutoPrune = yes
Volume Retention = 6 months
Maximum Volume Bytes = 4g
Maximum Volumes = 9850
Label Format = "Full-"
Recycle Oldest Volume = yes
Storage = FullBackupsStorage
Next Pool = Offsite
}