View Issue Details

IDProjectCategoryView StatusLast Update
0001166bareos-coredirectorpublic2023-12-13 13:59
Reportertastydr Assigned Topstorz  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionreopened 
PlatformLinuxOSDebianOS Version9
Product Version18.2.5 
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.

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
bruno-at-bareos

bruno-at-bareos

2023-12-13 13:59

manager   ~0005631

No PR proposed

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
2023-12-13 13:59 bruno-at-bareos Status new => closed
2023-12-13 13:59 bruno-at-bareos Note Added: 0005631