Re: [Firebird-devel] Virtual metadata

2017-01-15 Thread Dimitry Sibiryakov
15.01.2017 19:00, Adriano dos Santos Fernandes wrote:
> So what I call virtual metadata and how would it solve the problems:

   Sounds not bad, but requires more programming and is less effective than 
versioned 
metadata cache.

> When a DDL command is issued, it will not change metadata directly. It
> will change metadata in a memory structure tied to the current transaction.

   I would prefer other approach: DDL command change metadata in database 
directly and 
immediately. Every other transaction use ordinary versioning mechanics to see 
database 
(including metadata) in consistent state according to TIL. Metadata cache is 
either 
reduced or expanded to follow metadata versions in database. DFW is reduced to 
simple 
check for object valid state which is performed on base of ordinary undo log. 
No problems 
with circular references, no problem with mixing of DDL and DML.


-- 
   WBR, SD.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] rare segfault in fb_shutdown()

2017-01-15 Thread Alex Peshkoff
On 01/15/17 12:24, Damyan Ivanov wrote:
> -=| Alex Peshkoff, 13.01.2017 14:32:09 +0300 |=-
>> On 01/03/17 00:38, Damyan Ivanov wrote:
>>> I've been chasing this for some time, and finally I've come (with help
>>> from others) to a environment which makes the segfault relatively easy
>>> to reproduce, although it still requires patience.
>>>
>> 
>>> I browsed the commits in the B3_0_Release branch, but none seemed to touch 
>>> any
>>> code that seems relevant to me.
>> Not strange that you've missed that commit - races when thread is
>> closing are present since interbase times, but presence of provider
>> architecture in FB3 made them more often visible.
>>
>> Should be fixed, see http://tracker.firebirdsql.org/browse/CORE-5452
> Thank you, Alex.
>
> I have added the patch to the Debian package and the specially-crafted
> single-core environment seems to no longer expose the crash.
>
>

Wow, that's great that it's successfully tested it in initial 
environment. Artificial tricks I've used to reproduce on local box do 
not always give correct result.



--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Code style - right margin

2017-01-15 Thread Adriano dos Santos Fernandes
Em 15/01/2017 12:53, Dimitry Sibiryakov escreveu:
> 15.01.2017 15:50, Adriano dos Santos Fernandes wrote:
>> What is our maximum code right margin?
> 
> http://www.firebirdsql.org/en/coding-style/
> 
> 

Its funny that it's not where it need to be: README.coding.style.


Adriano

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] Virtual metadata

2017-01-15 Thread Adriano dos Santos Fernandes
All,

First, must say this is based on state-of-the-art modern architecture of
a different field: web libraries/frameworks, using the Virtual DOM.

First, the (Firebird) problem, but I'll abstain to comment internal
details of DFW.

About multiple Firebird metadata update (DDL commands) in the same
transaction:
- Is not recommended (at least by me)
- Difficult (if not impossible) to develop right (without bugs)
- Leaves things inconsistently (maybe with corruptions) if DDL and DML
changes same objects
- Is very restrictive on the allowed changes for the users

At the same time, Firebird adopts the model of not leaving database with
invalidated objects, so allow a single DDL command in auto-commit mode,
more than restrictive, is a no option.

When users want to change, say, a view, it needs in most cases help from
tools that drop and recreate dependencies.

Update metadata in production is very problematic. And in todays
business, update in production is necessary.

So what I call virtual metadata and how would it solve the problems:

When a DDL command is issued, it will not change metadata directly. It
will change metadata in a memory structure tied to the current transaction.

It may read metadata from database as needed and change it (in memory
structures).

At commit time, changed metadata is validated (including validation with
dependencies) and changes are applied to database.

We may even allow concurrent transactions to change the same objects, as
at commit time we validate and apply changes against the latest
committed metadata. It's a simple approach, diif against initial state
(same transaction), validate and applies to latest committed state.

(This proposal does not deal with potential problems with metadata
changes in read committed transactions.)

It will allow database to go from a good state to a good state without
restrictions, inconsistencies, corruptions and few locks.

To make this work, we need to have two type of validations, validation
phase 1 (v1, when DDL command is executed), and validation phase 2 (v2,
at commit).

At v1 we validate things like:
- Cannot DROP a non existent object
- Cannot ALTER a non existent object
- Cannot CREATE an object that already exist

At v2 we validate everything else:
- No disallowed circular dependencies
- State of changed objects are good
- State of objects depending on the changed ones are good


Adriano

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Code style - right margin

2017-01-15 Thread Dmitry Yemanov
15.01.2017 17:50, Adriano dos Santos Fernandes wrote:

> What is our maximum code right margin?
>
> AFAIK it used to be 100 and I remember some discussion to increase it.
>
> Some people is thinking it's infinite.
>
> I think currently 100 is too low and 120 would be better.

It used to be 80 and Claudio had suggested to raise it up to 100 (since 
FB3, IIRC).

Perhaps I could live with 120, but it's pretty close to the limit of my 
personal comfort. Let's see what others think.


Dmitry


--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Code style - right margin

2017-01-15 Thread Dimitry Sibiryakov
15.01.2017 15:50, Adriano dos Santos Fernandes wrote:
> What is our maximum code right margin?

http://www.firebirdsql.org/en/coding-style/


-- 
   WBR, SD.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] Code style - right margin

2017-01-15 Thread Adriano dos Santos Fernandes
What is our maximum code right margin?

AFAIK it used to be 100 and I remember some discussion to increase it.

Some people is thinking it's infinite.

I think currently 100 is too low and 120 would be better.


Adriano

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] Concurrency bugs in posting events?

2017-01-15 Thread Mark Rotteveel
I have a test in Jaybird that post multiple events 
(https://github.com/FirebirdSQL/jaybird/blob/master/src/test/org/firebirdsql/event/TestFBEventManager.java#L173)

Essentially it inserts on multiple threads (100 inserts per thread, 5 
threads, a commit after each insert) which causes a trigger to post

POST_EVENT 'TEST_EVENT_A'
POST_EVENT 'TEST_EVENT_B'
POST_EVENT 'TEST_EVENT_A'

(yes, it is posting TEST_EVENT_A twice)

Which should lead to posting TEST_EVENT_A 1000 times and TEST_EVENT_B 
500 times. This test occasionally fails (about 1 in 3 runs on Firebird 
3). I initially thought I wasn't waiting long enough for all events to 
be received.

After adding some extra debug logging, it looks like Firebird is 
occasionally losing event registrations (not posting them, but the event 
is unregistered), or posting an event with the id of TEST_EVENT_A, but 
posting the count of TEST_EVENT_B (or vice versa), but both events are 
unregistered, which seems to indicate some sort of race condition or 
interleaved writes of the event.

I can reproduce this problem both with Jaybird 2.2 and Jaybird 3, which 
have a totally different implementations.

As far as I can tell it is not version specific, but it is more easily 
reproducible on Firebird 3 and 4 (probably because I'm using SuperServer).

Could someone take a look at this?

Mark
-- 
Mark Rotteveel

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Windows build of Firebird 3 is broken

2017-01-15 Thread Vlad Khorsun
15.01.2017 11:53, Mark Rotteveel wrote:
> The windows build of Firebird 3 is broken (note: I haven't checked the
> Firebird 4 build, might have the same problem).
>
> It fails when building gpre_boot, this failure is introduced in:
>
> commit 40f782ae3e918c4f3842571ff8064be1c4f54961
> Author: AlexPeshkoff 
> Date:   Fri Jan 13 14:29:54 2017 +0300
>
>  Backported fix for CORE-5452: Segfault when engine's dynamic
> library is unloaded right after closing worker threads (GC and/or cache
> writer)
>
> Not 100% sure, but the cause seems to be:
>
> ..\..\..\src\common\isc_sync.cpp(2151): error C2653: 'Thread': is not a
> class or namespace name
> ..\..\..\src\common\isc_sync.cpp(2151): error C3861: 'sleep': identifier
> not found

   Fixed, thanks

Regards,
Vlad


--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] Windows build of Firebird 3 is broken

2017-01-15 Thread Mark Rotteveel
The windows build of Firebird 3 is broken (note: I haven't checked the 
Firebird 4 build, might have the same problem).

It fails when building gpre_boot, this failure is introduced in:

commit 40f782ae3e918c4f3842571ff8064be1c4f54961
Author: AlexPeshkoff 
Date:   Fri Jan 13 14:29:54 2017 +0300

 Backported fix for CORE-5452: Segfault when engine's dynamic 
library is unloaded right after closing worker threads (GC and/or cache 
writer)

Not 100% sure, but the cause seems to be:

..\..\..\src\common\isc_sync.cpp(2151): error C2653: 'Thread': is not a 
class or namespace name
..\..\..\src\common\isc_sync.cpp(2151): error C3861: 'sleep': identifier 
not found

Mark
-- 
Mark Rotteveel

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] rare segfault in fb_shutdown()

2017-01-15 Thread Damyan Ivanov
-=| Alex Peshkoff, 13.01.2017 14:32:09 +0300 |=-
> On 01/03/17 00:38, Damyan Ivanov wrote:
> > I've been chasing this for some time, and finally I've come (with help
> > from others) to a environment which makes the segfault relatively easy
> > to reproduce, although it still requires patience.
> >
> 
> > I browsed the commits in the B3_0_Release branch, but none seemed to touch 
> > any
> > code that seems relevant to me.
> 
> Not strange that you've missed that commit - races when thread is 
> closing are present since interbase times, but presence of provider 
> architecture in FB3 made them more often visible.
> 
> Should be fixed, see http://tracker.firebirdsql.org/browse/CORE-5452

Thank you, Alex.

I have added the patch to the Debian package and the specially-crafted 
single-core environment seems to no longer expose the crash.


Cheers,
dam

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5453) ALTER DOMAIN DROP CONSTRAINT and ADD CHECK too slow

2017-01-15 Thread Maxim Kuzmin (JIRA)
ALTER DOMAIN DROP CONSTRAINT and ADD CHECK too slow
---

 Key: CORE-5453
 URL: http://tracker.firebirdsql.org/browse/CORE-5453
 Project: Firebird Core
  Issue Type: Bug
Affects Versions: 2.5.6
Reporter: Maxim Kuzmin
Priority: Minor


Our database has a domain DOM$DATE. It is used in 300 tables and 500 stored 
procedure. Executing and commit of each of these query's take's about 1 minute:
ALTER DOMAIN DOM$DATE
  DROP CONSTRAINT;

ALTER DOMAIN DOM$DATE
  ADD CHECK (VALUE BETWEEN DATE '01.01.1900' AND DATE '31.12.2100');

P.S. Vlad Khorsun's said it was due to the restructuring of dependencies, but 
in this case it is not necessary.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel