[Firebird-devel] [FB-Tracker] Created: (CORE-3922) Sweep does not start if one of connects doing select * from ... where ... FOR UPDATE WITH LOCK without COMMIT or ROLLBACK

2012-09-10 Thread Pavel Zotov (JIRA)
Sweep does not start if one of connects doing select * from  ... where ... FOR 
UPDATE WITH LOCK without COMMIT or ROLLBACK
--

 Key: CORE-3922
 URL: http://tracker.firebirdsql.org/browse/CORE-3922
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Reporter: Pavel Zotov
 Attachments: trace_no_sweep_starts_when_select_for_update_with_lock.zip

session #1
##
C:\1INSTALL\FIREBIRD\Data>isql localhost:C:\1INSTALL\FIREBIRD\Data\t1.fdb -n
Database:  localhost:C:\1INSTALL\FIREBIRD\Data\t1.fdb
SQL> show database;
Database: localhost:C:\1INSTALL\FIREBIRD\Data\t1.fdb
Owner: SYSDBA
PAGE_SIZE 4096
Number of DB pages allocated = 196
Sweep interval = 2
Forced Writes are OFF
Transaction - oldest = 3
Transaction - oldest active = 4
Transaction - oldest snapshot = 4
Transaction - Next = 6
ODS = 11.2
Default Character set: NONE

recreate table tfix1(id int primary key, s01 varchar(1000));
recreate table tfix2(id int primary key, s01 varchar(1000));
recreate table tfix3(id int primary key, s01 varchar(1000));
commit;
insert into tfix1 values(-1,'tfix1');
insert into tfix2 values(-2,'tfix2');
insert into tfix3 values(-2,'tfix2');
commit;

set transaction read committed;
set term ^;
execute block as
  declare n int = 20;
  declare k int;
begin
  while (n>0) do begin
insert into tfix1(id,s01) values(:n, rpad('',1000,'x'));
insert into tfix2(id,s01) values(:n, rpad('',1000,'x'));
insert into tfix3(id,s01) values(:n, rpad('',1000,'x'));
n=n-1;
  end
end^
set term ;^
-- here we must wait a few minutes until this EB is finished ...

session #2
##
session #2

C:\1INSTALL\FIREBIRD\Data>isql localhost:C:\1INSTALL\FIREBIRD\Data\t1.fdb -n
Database:  localhost:C:\1INSTALL\FIREBIRD\Data\t1.fdb
commit;
set transaction read committed;
set term ^;
execute block as
  declare n int = 21000;
  declare k int;
begin
  while (n>0) do begin
in autonomous transaction do select 1 from rdb$database into :k;
n=n-1;
  end
end^
set term ;^
commit;
set list on;
select * from tfix1 where id<0 for update with lock;
set list off;
/*
after 1..2 seconds we will get:
ID  -1
S01 tfix1
*/

session #3
###
start trace with enabled log_sweep.

session #1
##
SQL> rollback;
SQL> show database; -- this action finishes with COMMIT
Database: localhost:C:\1INSTALL\FIREBIRD\Data\t1.fdb
Owner: SYSDBA
PAGE_SIZE 4096
Number of DB pages allocated = 11810
Sweep interval = 2
Forced Writes are OFF
Transaction - oldest = 5
Transaction - oldest active = 21009
Transaction - oldest snapshot = 6
Transaction - Next = 21011
ODS = 11.2
Default Character set: NONE
SQL> select 1 from rdb$database;

CONSTANT

   1

-- sweep does NOT start here (no info about it in trace window)

session #2
##
SQL> commit;
SQL> set list on;
SQL> select * from tfix1 where id<0 for update with lock; -- sweep starts only 
now

ID  -1
S01 tfix1

SQL> set list off;

See firebird.log and trace in attach.

-- 
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



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-3921) "record disappeared (186), file: vio.cpp line: 408" + CPU 100% (when bugcheckabort=1 and sweep starts at gap ~21000)

2012-09-10 Thread Pavel Zotov (JIRA)
"record disappeared (186), file: vio.cpp line: 408" + CPU 100%  (when 
bugcheckabort=1 and sweep starts at gap ~21000)
-

 Key: CORE-3921
 URL: http://tracker.firebirdsql.org/browse/CORE-3921
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Reporter: Pavel Zotov
 Attachments: trace_sweep_vio_error.zip

Intro: create database 't0.fdb'; commit; quit;


session #1
##
C:\1INSTALL\FIREBIRD\Data>isql localhost:C:\1INSTALL\FIREBIRD\Data\t0.fdb -n
Database:  localhost:C:\1INSTALL\FIREBIRD\Data\t0.fdb
SQL> recreate table tfix1(id int primary key, s01 varchar(1000));
SQL> recreate table tfix2(id int primary key, s01 varchar(1000));
SQL> commit;
SQL> insert into tfix1 values(-1,'tfix1');
SQL> insert into tfix2 values(-2,'tfix2');
SQL> commit;
SQL>
SQL> set transaction read committed;
SQL> set term ^;
SQL> execute block as
CON>   declare n int = 20;
CON>   declare k int;
CON> begin
CON>   while (n>0) do begin
CON> --insert into ttmp(id,s01) values(:n, rpad('',1000,'x'));
CON> insert into tfix1(id,s01) values(:n, rpad('',1000,'x'));
CON> insert into tfix2(id,s01) values(:n, rpad('',1000,'x'));
CON> n=n-1;
CON>   end
CON> end^
SQL> set term ;^

session #2 // start it after execute block in session #1 has finished
##
commit;
set transaction read committed;
set term ^;
execute block as
  declare n int = 21000;
  declare k int;
begin
  while (n>0) do begin
in autonomous transaction do select 1 from rdb$database into :k;
n=n-1;
  end
end^
set term ;^
commit;

session #1 // switch in it only after EB in session #2 has finished
##
rollback;

/* at this point we have:
Database "T0.FDB"
Database header page information:
<...>
Page size   4096
ODS version 11.2
Oldest transaction  5
Oldest active   6
Oldest snapshot 6
Next transaction21008
<...>
Database dialect3
Creation date   Sep 11, 2012 8:09:28
Attributes  force write

Variable header data:
*END*
*/

session #3
##
Start  user trace with the following config file:

  enabled true
  log_connections true
  log_transactions true

  log_statement_prepare true
  log_statement_free true

  log_statement_start true
  log_statement_finish true

#  log_trigger_start true
  log_trigger_finish true

  log_blr_requests true

  log_errors true  
  log_sweep true # <<  ENABLE sweep info to be logged 
<<<

  print_perf true
  print_blr true

  time_threshold 0
  max_sql_length 4000
  max_blr_length 1000
  max_dyn_length 1000
  max_log_size 0
  #log_procedure_finish true


session #1
#
update tfix2 set s01='' where id<0; -- стартует sweep, в трейсе по нему 
появляется туча сообщений 


session #2
#
SQL> select count(*) from tfix1;

   COUNT

   1

After this point I got standard 'critical error windows' on my Windows-2000 
machine (fb_inet_server.exe  - The application has requested the Runtime to 
terminate it in an unusial way).
Trace window has been stopped (like if I press Ctrl-C in it) and the following 
messages appeared in firebird.log:

BALAHA  Tue Sep 11 08:25:40 2012
Sweep is started by SWEEPER
Database "C:\1INSTALL\FIREBIRD\DATA\T0.FDB" 
OIT 5, OAT 6, OST 6, Next 21009


BALAHA  Tue Sep 11 08:25:50 2012
Database: C:\1INSTALL\FIREBIRD\DATA\T0.FDB
internal Firebird consistency check (record disappeared (186), file: 
vio.cpp line: 408)


BALAHA (Client) Tue Sep 11 08:26:11 2012
XNET error: Server shutdown detected

No any actions could be done in both the sessions #1 and 2:
SQL> select count(*) from tfix1;
Statement failed, SQLSTATE = 08006
Unable to complete network request to host "localhost".
-Error writing data to the connection.

Trace text has been attached in ZIP.

-- 
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

   

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-3920) Updating Null Column values Will Raise an Exception -605

2012-09-10 Thread JIRA
Updating Null Column values Will Raise an Exception -605


 Key: CORE-3920
 URL: http://tracker.firebirdsql.org/browse/CORE-3920
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 2.1.3
 Environment: Windows, Delphi, IBOConsole, AMDTurion X2 
Reporter: Sérgio


ENDDATE is date and was created after the table being created and it allows 
nulls so it filled the colum with nulls.

So i want to set ENDDATE then i do :

UPDATE MYTABLE
SET ENDDATE=CURRENT_DATE
WHERE MYID=1

Error -605  value null
This wasnt supposed to happen ? It should Set RowID MYID primarykey ENDDATE 
with th CURRENT_DATE .The problem yet is in the IBOConsole and My Application 
Components if i change it manualy it accepts it with no problem only Query 
Problem.

I dont undestand wheres the problem.

-- 
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

   

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Restore improvements?

2012-09-10 Thread Leyne, Sean
Thomas,

> I'm currently running a restore of a Firebird 2.5.2 TPC-H scale 1 database
> (both, backup and restore are on a consumer SDD) and in that case the index
> creation process is mainly CPU bound, basically fully utilizing 1 core of my
> hexa-core desktop.

Are you testing using IB XE3?

Being CPU bound is what I would expect.


> Is this something where Firebird could benefit as well? If yes, would this be
> possible across all architectures or does this need a shared page cache etc.

Yes, this is something that FB could benefit from.

Yes, it should be possible across all architectures.

No, it should not require a shared page cache.  I don't think the cache factors 
into it.


> Another improvement for the index creation process during a restore might
> be to allow a temporary bigger page cache, so perhaps a -cache, -buffers or
> whatever option might be helpful. Pretty much what e.g isql already allows at
> connection level etc.

I don't see how a larger cache or more buffers would help the index creation 
process.

The ideal process would have a single pass of a table collect data from columns 
in all indexes, into a temporary file (or multiple), then pass that data to 
appropriate sorting/index create routines.  In which case, the number of pages 
not going to make a significant difference because each page would be read only 
once.  The cache is beneficial when multiple page accesses are involved.


Sean


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] Restore improvements?

2012-09-10 Thread Thomas Steinmaurer
Hello,

InterBase XE3 got something which allows to create indexes during 
restore in parallel.
http://docwiki.embarcadero.com/RADStudio/en/InterBase_XE3

I'm currently running a restore of a Firebird 2.5.2 TPC-H scale 1 
database (both, backup and restore are on a consumer SDD) and in that 
case the index creation process is mainly CPU bound, basically fully 
utilizing 1 core of my hexa-core desktop.

Is this something where Firebird could benefit as well? If yes, would 
this be possible across all architectures or does this need a shared 
page cache etc.

Another improvement for the index creation process during a restore 
might be to allow a temporary bigger page cache, so perhaps a -cache, 
-buffers or whatever option might be helpful. Pretty much what e.g isql 
already allows at connection level etc.


Thoughts?

Thanks,
Thomas

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel