Index corruption when add data in long-key-indexed field
--------------------------------------------------------

                 Key: CORE-4904
                 URL: http://tracker.firebirdsql.org/browse/CORE-4904
             Project: Firebird Core
          Issue Type: Bug
          Components: Engine
    Affects Versions: 3.0 RC 1
            Reporter: Pavel Zotov


Config:
===
Servermode = SuperClassic
RemoteServicePort = 3330
DefaultDbCachePages = 512

BugCheckAbort=1

AuthClient = Legacy_Auth,Srp,Win_Sspi
AuthServer = Legacy_Auth,Srp
UserManager = Legacy_UserManager
WireCrypt = Disabled

FileSystemCacheThreshold = 65536K

LockMemSize = 64M
LockHashSlots = 22111

MaxUserTraceLogSize = 99999
TempCacheLimit = 2147483647
TempDirectories = /tmp/firebird
===

Create new database, make its FW = OFF and set sweep interval = 100 (one 
hundred).
Run ISQL so that it will show prompt (i.e. do NOT add '-i <file.sql>' in its 
command line).
Then do:

SQL> in file.sql;

-- and wait until it finish. After finish do not continue in this window 
"commit / rollback" and do not close it.

file.sql:
===
===

recreate sequence g;
recreate table fix(id int primary key, s varchar(1000) unique);
insert into fix
select row_number()over(), rpad('', 1000, uuid_to_char(gen_uuid()))
from rdb$types,(select 1 i from rdb$types rows 10) rows 1000;
commit;

insert into fix
select row_number()over(), rpad('', 1000, uuid_to_char(gen_uuid()))
from rdb$types,(select 1 i from rdb$types rows 10) rows 1000;

set list on;
select 'Started at '||current_time msg from rdb$database;
select * from mon$database;
set term ^;
execute block as
  declare n int = 500;
begin
  while (n>0) do
  begin
      in autonomous transaction do
      execute statement '
      merge into fix t
      using (
          select row_number()over() id, rpad('''', 1000, 
uuid_to_char(gen_uuid())) s
          from rdb$types,(select 1 i from rdb$types rows 10) rows 1000
      ) s on t.id = s.id
      when matched then update set t.s = s.s
      '
      ;
      n = n - 1 + 0*gen_id(g,1);
  end
end
^
set term ;^
select 'Done at '||current_time msg from rdb$database;
===

After ISQL show 'Done at ...' and returns to prompt, create another window and 
move database into shutdown state:  gfix -shut full -force 0 <database.fdb>
Then return .fdb to ONLINE and make re-connect in ISQL. It will force sweep to 
start. 
After this sweep will finish, run validation using FBSVCMGR:

fbsvcmgr host/port:service_mgr user sysdba password masterkey action_validate 
dbname <database.fdb>

On LI-V3.0.0.31942 (build of 28-29 july 2015) I got every time on this step:

Index 2 is corrupt on page 21580 level 0 at offset 5100. File: 
/opt/fb30snap/src/jrd/validation.cpp, line: 2052

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

        

------------------------------------------------------------------------------
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to