On 12/18/20 8:02 AM, Eric Bollengier via Bacula-devel wrote:
> Hello Phil,
> 
> On 12/17/20 11:21 PM, Phil Stracchino wrote:
>>
>> 16-Dec 04:39 minbar-dir JobId 28076: Fatal error: sql_create.c:589
>> Create db Path record INSERT INTO Path (Path) VALUES
>> ('/usr/src/linux-5.10.1-gentoo/include/linux/fsl/') failed.
>> ERR=Duplicate entry '/usr/src/linux-5.10.1-gentoo/include/linux/fsl/'
>> for key 'Path'
>> 16-Dec 04:39 minbar-dir JobId 28076: Fatal error: catreq.c:664 attribute
>> create error. ERR=sql_create.c:589 Create db Path record INSERT INTO
>> Path (Path) VALUES ('/usr/src/linux-5.10.1-gentoo/include/linux/fsl/')
>> failed. ERR=Duplicate entry
>> '/usr/src/linux-5.10.1-gentoo/include/linux/fsl/' for key 'Path'
>>
>>
>> I'm going to guess maybe a race condition occurred between separate
>> threads where two jobs happened to try to write the same Path at the
>> same time.  This is a low-probability failure, but should we consider
>> doing an INSERT IGNORE or REPLACE INTO here?
>>
> 
> This is a strange error, it would mean that you don't use the Batch 
> insert mode
> 
> in your job, because we don't insert Path records one by one (Maybe in bscan
> 
> in some cases). With Batch sessions, you should not have duplicates.


That is correct, I run with batch mode disabled because it is not
compatible with Galera clustering, because although Bacula has a batch
size configuration directive, as far as I can tell it is ignored.  This
means that attribute despooling will always cause job failure on any Job
of over 128K files if running against a Galera cluster.

(Galera 3 has a hard limit of 128k files/4GB total data size on
writesets, although it is recommended for performance reasons to keep
batch writes much smaller than that.)


> Note that with MySQL, you can have a duplicate issue because the index is
> 
> based on the first 255 characters, and if your path is very long it 
> might raise
> 
> an error like this (but I'm not sure if we have declared the index unique).

Yes, it is a UNIQUE INDEX over Path(255).  However, path length clearly
isn't the issue in this case.

All jobs ran perfectly last night, and for months previously, which is
what leads me to suspect a race condition between concurrent jobs.


-- 
  Phil Stracchino
  Babylon Communications
  ph...@caerllewys.net
  p...@co.ordinate.org
  Landline: +1.603.293.8485
  Mobile:   +1.603.998.6958


_______________________________________________
Bacula-devel mailing list
Bacula-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-devel

Reply via email to