Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index and blob garbage collection doesn't take into accout data in undo log [CORE4701] #5009

Closed
firebird-automations opened this issue Feb 28, 2015 · 7 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @aafemt

Assigned to: @aafemt

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;

Commits: 27395a0 FirebirdSQL/fbt-repository@0ae7bde

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Am I correct in assuming that this issue covers all FB versions, not only v3?

@firebird-automations
Copy link
Collaborator Author

Commented by: @aafemt

Most likely yes. Didn't test.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Version: 2.5.4 [ 10585 ]

Version: 2.5.3 Update 1 [ 10650 ]

Version: 2.1.7 [ 10651 ]

Version: 3.0 Beta 1 [ 10332 ]

Version: 2.5.3 [ 10461 ]

Version: 2.1.6 [ 10460 ]

Version: 3.0 Alpha 2 [ 10560 ]

Version: 3.0 Alpha 1 [ 10331 ]

Version: 2.5.2 Update 1 [ 10521 ]

Version: 2.1.5 Update 1 [ 10522 ]

Version: 2.5.2 [ 10450 ]

Version: 2.5.1 [ 10333 ]

Version: 2.5.0 [ 10221 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @aafemt

Fix Version: 4.0 Initial [ 10621 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @aafemt

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

assignee: Dimitry Sibiryakov [ aafemt ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Fix Version: 4.0 Alpha 1 [ 10731 ]

Fix Version: 4.0 Initial [ 10621 ] =>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment