Issue Details (XML | Word | Printable)

Key: CORE-4701
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Dimitry Sibiryakov
Reporter: Dimitry Sibiryakov
Votes: 0
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Index and blob garbage collection doesn't take into accout data in undo log

Created: 28/Feb/15 02:31 PM   Updated: 02/Mar/16 08:46 PM
Component/s: Engine
Affects Version/s: 2.5.0, 2.5.1, 2.5.2, 2.1.5 Update 1, 2.5.2 Update 1, 3.0 Alpha 1, 3.0 Alpha 2, 2.1.6, 2.5.3, 3.0 Beta 1, 2.1.7, 2.5.3 Update 1, 2.5.4, 3.0 Beta 2
Fix Version/s: 4.0 Alpha 1


 Description  « Hide
When indexes and blobs are garbage collected during savepoint release, list_staying() collect data only from versions on disk, but not from undo log. As the result following script produces missing index entry:

create database "d_test";
create table g_test (f integer);
create index g_ind on g_test (f);
insert into g_test values (1);
commit;
update g_test set f=2;
savepoint a;
update g_test set f=3;
savepoint b;
update g_test set f=3;
savepoint c;
update g_test set f=4;
savepoint d;
update g_test set f=4;
release savepoint b only;
rollback to savepoint c;
commit;
select * from g_test;
select * from g_test where f=3;

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Dmitry Yemanov added a comment - 05/Jul/15 10:26 AM
Am I correct in assuming that this issue covers all FB versions, not only v3?

Dimitry Sibiryakov added a comment - 05/Jul/15 10:47 AM
Most likely yes. Didn't test.

Pavel Zotov added a comment - 05/Jul/15 11:25 AM
WI-V2.5.5.26907, new empty database, FW = ON:

Database: localhost/3255:e25
SQL> create table g_test (f integer);
SQL> create index g_ind on g_test (f);
SQL> insert into g_test values (1);
SQL> commit;
SQL> update g_test set f=2;
SQL> savepoint a;
SQL> update g_test set f=3;
SQL> savepoint b;
SQL> update g_test set f=3;
SQL> savepoint c;
SQL> update g_test set f=4;
SQL> savepoint d;
SQL> update g_test set f=4;
SQL> release savepoint b only;
SQL> rollback to savepoint c;
SQL> commit;
SQL> select * from g_test;

           F
============
           3

SQL> select * from g_test where f=3;
SQL> quit;

C:\1INSTALL\FIREBIRD\fb25sC\bin>fbsvcmgr.exe localhost/3255:service_mgr user SYSDBA password masterkey action_validate dbname e25
14:24:06.14 Validation started

14:24:06.14 Relation 128 (G_TEST)
14:24:06.14 process pointer page 0 of 1
14:24:06.14 Index 1 (G_IND)
14:24:06.14 Index 1 is corrupt (record 0 have missing entries)
14:24:06.14 Relation 128 (G_TEST) : 1 ERRORS found

14:24:06.14 Validation finished