View Issue Details

IDProjectCategoryView StatusLast Update
0001166bareos-core[All Projects] directorpublic2020-01-07 16:05
ReportertastydrAssigned Topstorz 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionreopened 
PlatformLinuxOSDebianOS Version9
Product Version18.2.5 
Fixed in Version 
Summary0001166: try entire counter range before giving up on labeling Volume
DescriptionBareos is failing to label a new Volume with log entries like this:
06-Jan 09:30 bareos-dir JobId 33140: Warning: Wanted to create Volume "Merged-2541", but it already exists. Trying again.
[...]
06-Jan 09:25 bareos-dir JobId 33140: Warning: Wanted to create Volume "Merged-2639", but it already exists. Trying again.
06-Jan 09:25 bareos-dir JobId 33140: Error: Too many failures. Giving up creating Volume name.

But it did not try the entire range of possibly counter range of 0001-9999 (Dir -> Maxumum Volumes is set to 9999).
This is a File storage type which has fragmented ranges of volume name. There are names available outside that tried by Bareos.
TagsNo tags attached.
bareos-master: impact
bareos-master: action
bareos-19.2: impact
bareos-19.2: action
bareos-18.2: impact
bareos-18.2: action
bareos-17.2: impact
bareos-17.2: action
bareos-16.2: impact
bareos-16.2: action
bareos-15.2: impact
bareos-15.2: action
bareos-14.2: impact
bareos-14.2: action
bareos-13.2: impact
bareos-13.2: action
bareos-12.4: impact
bareos-12.4: action

Activities

pstorz

pstorz

2020-01-07 14:44

administrator   ~0003716

Please read the following first before you create a bug report.

Thank you!

https://www.bareos.org/en/HOWTO/articles/how-to-create-a-bugreport.html

tastydr

tastydr

2020-01-07 15:53

reporter   ~0003717

Here is where the problem is:
core/src/dird/newvol.cc from master branch
in
static bool CreateSimpleName(JobControlRecord* jcr,
                             MediaDbRecord* mr,
                             PoolDbRecord* pr)
line 149
for (int i = (int)ctx.value + 1; i < (int)ctx.value + 100; i++)

A database lookup is performed to get the maximum MediaId of an existing volume, then the for loop tries approximately 100 MediaIds after that.

In the case where MediaId are used in non-continuous chucks there may be available MediaIds which are numerically less than the maximum MediaId. For this reason the for loop should start at the first possible MediaId and end at the last possible MediaId.
pstorz

pstorz

2020-01-07 16:05

administrator   ~0003718

Please create a Pull Request with your fixes including a documentation how to reproduce the problem.

Thank you

Issue History

Date Modified Username Field Change
2020-01-06 16:37 tastydr New Issue
2020-01-07 14:44 pstorz Assigned To => pstorz
2020-01-07 14:44 pstorz Status new => closed
2020-01-07 14:44 pstorz Resolution open => not fixable
2020-01-07 14:44 pstorz Note Added: 0003716
2020-01-07 15:53 tastydr Status closed => new
2020-01-07 15:53 tastydr Resolution not fixable => reopened
2020-01-07 15:53 tastydr Note Added: 0003717
2020-01-07 16:05 pstorz Note Added: 0003718