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

"BLOB not found" error at rollback after insert into table with expression index [CORE4713] #5020

Closed
firebird-automations opened this issue Mar 18, 2015 · 7 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @hvlad

Is related to QA618

create table T1 (
ID integer not null,
N1 blob sub_type text,
);
create index T_IDX on T1 computed by (cast(substring(N1 from 1 for 100) as varchar(100)));
commit;

insert into T1 (ID, N1) values (1, 'www');
rollback;

Result:
Unsuccessful execution caused by system error that does not preclude successful execution of subsequent statements.
BLOB not found.

Commits: 1332ff2 b0b9431 FirebirdSQL/fbt-repository@73dcadb FirebirdSQL/fbt-repository@88f4aa2

====== Test Details ======

2.5.3 (WI-V2.5.3.26780): no error.
2.5.2 (WI-V2.5.2.26540):
Statement failed, SQLSTATE = HY000
BLOB not found
. . .
Statement failed, SQLSTATE = 08003
invalid transaction handle (expecting explicit transaction start)
2.5.1 (WI-V2.5.1.26351):
the same as 2.5.2 + crash ("08006 / -Error reading data from the connection")

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

assignee: Vlad Khorsun [ hvlad ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

The issue is that garbage collection first removes blobs and then index entries - obviously, index expression can't find just removed blob.

The issue present at least since expression indices was implemented but it was almost not visible to end user as error was hidded
inside the engine. Only v2.5 re-raised it and only at rollback. Both v2.1 and v3 still hides it. Only possibility to see bug effect is to look
at index statistics (by gstat) and see not cleared index entries.

Note, index entries not removed during any kind of garbage collection
- rollback
- regular garbage collection of obsolete record versions
- update in place

The solution is to change order of GC operations - first remove index entries and then remove blobs.

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

Fix Version: 2.5.4 [ 10585 ]

Fix Version: 3.0 Beta 2 [ 10586 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

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

resolution: Fixed [ 1 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: Done successfully

Test Details: 2.5.3 (WI-V2.5.3.26780): no error.
2.5.2 (WI-V2.5.2.26540):
Statement failed, SQLSTATE = HY000
BLOB not found
-BLOB not found
-BLOB not found
-BLOB not found
Statement failed, SQLSTATE = 08003
invalid transaction handle (expecting explicit transaction start)
2.5.1 (WI-V2.5.1.26351):
the same as 2.5.2 + crash ("08006 / -Error reading data from the connection")

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

Test Details: 2.5.3 (WI-V2.5.3.26780): no error.
2.5.2 (WI-V2.5.2.26540):
Statement failed, SQLSTATE = HY000
BLOB not found
-BLOB not found
-BLOB not found
-BLOB not found
Statement failed, SQLSTATE = 08003
invalid transaction handle (expecting explicit transaction start)
2.5.1 (WI-V2.5.1.26351):
the same as 2.5.2 + crash ("08006 / -Error reading data from the connection")

=>

2.5.3 (WI-V2.5.3.26780): no error.
2.5.2 (WI-V2.5.2.26540):
Statement failed, SQLSTATE = HY000
BLOB not found
. . .
Statement failed, SQLSTATE = 08003
invalid transaction handle (expecting explicit transaction start)
2.5.1 (WI-V2.5.1.26351):
the same as 2.5.2 + crash ("08006 / -Error reading data from the connection")

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue is related to QA618 [ QA618 ]

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