Issue Details (XML | Word | Printable)

Key: CORE-6073
Type: Bug Bug
Status: Open Open
Priority: Critical Critical
Assignee: Unassigned
Reporter: Kjell Rilbe
Votes: 0
Watchers: 8
Operations

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

Corruption risk on drop table with non exclusive connection

Created: 03/Jun/19 06:42 AM   Updated: 03/Jun/19 08:13 AM
Component/s: Engine
Affects Version/s: 2.5.8, 3.0.4
Fix Version/s: None

Environment: Any, as far as I understand.

QA Status: No test


 Description  « Hide
I have once suffered database corruption due to dropping tables when other users were working with the same database. IBSurgeon helped med repair it, and explained that drop table should be considered an exclusive action, i.e. perform only under exclusive connection.

According to them, the problem still exists in latest released versions 2.5 and 3.0, not sure about 4.0.

This is from Alexey Kovyazin of IBSurgeon in May 2019:

"We know, that drop table during the active users work leads to corruption, but we don't have reproducible test case, only corrupted databases from the people who used to drop tables.

It looks like the reason of the corruption is the interrupted DROP TABLE command - it does not complete properly - data, pointer and index root pages are deleted, but records in RDB$PAGES/RDB$RELATIONS/RDB$RELATION_FIELDS/etc remain.
After that, the access to the partially deleted table is not possible - it gives error "wrong page type expected 4, found XX".

Right now, we don't have time to create the test case to reproduce it - theoretically, it could be some fork of firebird-oltp-test with create-drop-create cycle."

I wish I could create a test case, but just maybe the description of the error would hint at some part of the code?

Anyway, until fixed, I would suggest that the problem be documented in release notes and drop table command documentation, with a recommendation to drop table only in exclusive mode.

 All   Comments   Change History   Subversion Commits      Sort Order: Descending order - Click to sort in ascending order
Kjell Rilbe added a comment - 03/Jun/19 08:13 AM
I don't remember from the time of corruption, and I have only done it under exclusive connection since. I'd have to try to produce a test case to answer it.

Vlad Khorsun added a comment - 03/Jun/19 08:06 AM
Do you run DROP TABLE as single statement in transaction ?
If not, what kind of other statements could be present in the same tx ?