Re: Something amiss in bacula-9.6.7: Possible race condition

Phil Stracchino <[email protected]>
Newsgroups gmane.comp.sysutils.backup.bacula.devel
Organization Babylon Communications
Message-ID <[email protected]>
On 1/15/21 1:37 PM, Martin Simmons wrote:
>>>>>> On Fri, 15 Jan 2021 12:19:29 -0500, Phil Stracchino said:
>>
>> This both filters already-existing Paths out of the batch set much more
>> efficiently, AND does not fail if another job inserts those same Paths
>> first.  If you compare the execution plans for the two queries you will
>> see that the second performs ENORMOUSLY better.
> 
> Batch mode locks the tables, so it is impossible for another job to insert at
> the same time.


OK, though that triple SELECT is still extremely inefficient.  That
probably does make the INSERT IGNORE there moot though.

That said, explicit table locks are usually a bad idea and should be
avoided where possible.



-- 
  Phil Stracchino
  Babylon Communications
  [email protected]
  [email protected]
  Landline: +1.603.293.8485
  Mobile:   +1.603.998.6958
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.