Re: [Firebird-devel] File lookup

2016-03-15 Thread Alex Peshkoff
On 03/15/2016 12:40 PM, Dimitry Sibiryakov wrote: > 15.03.2016 10:33, Alex Peshkoff wrote: >> Where do we have races in_current_ codebase? > Dunno, you told about them. > I've said that _if_ you remove filenames comparison from initAttachment() in jrd.cpp or make it case-insensitive on posix

Re: [Firebird-devel] File lookup

2016-03-15 Thread Dimitry Sibiryakov
15.03.2016 10:33, Alex Peshkoff wrote: > Where do we have races in_current_ codebase? Dunno, you told about them. -- WBR, SD. -- Transform Data into Opportunity. Accelerate data analysis in your applications with

Re: [Firebird-devel] File lookup

2016-03-15 Thread Alex Peshkoff
On 03/14/2016 08:56 PM, Dimitry Sibiryakov wrote: > 14.03.2016 18:39, Alex Peshkoff wrote: >> Do you suggest to lock db list mutex from yvalve? And from network >> server? :) > This is a separate discussion about thread races on database file > creation and open, if > you haven't noticed. Y-va

Re: [Firebird-devel] File lookup

2016-03-14 Thread Dimitry Sibiryakov
14.03.2016 22:51, Vlad Khorsun wrote: > You must consider detach, drop and database shutdown to get full picture. Yes, and all the same for classic mode as well, so the picture is quite complex. But MSDN promises file ID to be stable as long as at least one handle is open, so there may b

Re: [Firebird-devel] File lookup

2016-03-14 Thread Vlad Khorsun
14.03.2016 19:29, Dimitry Sibiryakov wrote: > 14.03.2016 18:12, Alex Peshkoff wrote: >> But use of by name search if ID is unusable due to file not >> exists appears unavoidable. > > Not true. Thread that is going to create file must do it while keeps db > list mutex. In > this case it can be

Re: [Firebird-devel] File lookup

2016-03-14 Thread Leyne, Sean
> 14.03.2016 20:25, Leyne, Sean wrote: > > - try to open/create file with non-shared access attribute, if success then > get fileID else fail/ throw "file already exists" > >In superserver at this point other thread can attach to this file and get > broken (non-initialized) database. Actual

Re: [Firebird-devel] File lookup

2016-03-14 Thread Dimitry Sibiryakov
14.03.2016 20:25, Leyne, Sean wrote: > - try to open/create file with non-shared access attribute, if success then > get fileID else fail/ throw "file already exists" In superserver at this point other thread can attach to this file and get broken (non-initialized) database. > - create dbb

Re: [Firebird-devel] File lookup (was: RFC: File names with non-ASCII non-ANSI letters)

2016-03-14 Thread Leyne, Sean
>I.e. sequence like this: > > 1) create dbb with flag "creating" > 2) get list mutex > 3) create the file and get its id 1- This would destroy any existing file, no? 2- why "get list mutex" before the create file and/or get fileID? Wouldn't the better "creating" order be: - try to open/cr

Re: [Firebird-devel] File lookup

2016-03-14 Thread Dimitry Sibiryakov
14.03.2016 18:39, Alex Peshkoff wrote: > Do you suggest to lock db list mutex from yvalve? And from network > server? :) This is a separate discussion about thread races on database file creation and open, if you haven't noticed. Y-valve has nothing to do with that. -- WBR, SD.

Re: [Firebird-devel] File lookup

2016-03-14 Thread Alex Peshkoff
On 03/14/2016 08:29 PM, Dimitry Sibiryakov wrote: > 14.03.2016 18:12, Alex Peshkoff wrote: >> But use of by name search if ID is unusable due to file not >> exists appears unavoidable. > Not true. Thread that is going to create file must do it while keeps db > list mutex. Do you suggest to lo

Re: [Firebird-devel] File lookup (was: RFC: File names with non-ASCII non-ANSI letters)

2016-03-14 Thread Dimitry Sibiryakov
14.03.2016 18:12, Alex Peshkoff wrote: > But use of by name search if ID is unusable due to file not > exists appears unavoidable. Not true. Thread that is going to create file must do it while keeps db list mutex. In this case it can be sure that no other thread can try to create the file in