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

Corruption risk on drop table with non exclusive connection [CORE6073] #6323

Open
firebird-automations opened this issue Jun 3, 2019 · 3 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Kjell Rilbe (kjellrilbe)

Votes: 2

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.

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

Do you run DROP TABLE as single statement in transaction ?
If not, what kind of other statements could be present in the same tx ?

@firebird-automations
Copy link
Collaborator Author

Commented by: Kjell Rilbe (kjellrilbe)

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.

@firebird-automations
Copy link
Collaborator Author

Commented by: Attila Molnár (e_pluribus_unum)

Time-to-time we get also "wrong page type expected 4, found XX". errors and we do execute DROP TABLE in non-exlusive mode (in a singel statement transaction)

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

No branches or pull requests

1 participant