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

page 1530262 is of wrong type (expected 7, found 5) [CORE2616] #3026

Closed
firebird-automations opened this issue Sep 3, 2009 · 28 comments
Closed

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @samofatov

Relate to CORE2698

Attachments:
TEST.ZIP
firebird 214 wrong pagetype error screenshot.jpg

Votes: 2

The server is showing the "page nnn is of wrong type (expected 7, found 5)" error when under load.
At times the resulting database has corrupted index or data.

We have developed the test case:
http://www.red-soft.biz/files/TestCase-511.ZIP

Commits: d954ef5 17afb2b 6fde607

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

Attach does not exist.

@firebird-automations
Copy link
Collaborator Author

Modified by: @samofatov

assignee: Vlad Khorsun [ hvlad ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

The test case triggers bug in NAV but not lead to real database corruption.
Could you verify that there is NO database corruption after the test shows "wrong page type" error, please ?

@firebird-automations
Copy link
Collaborator Author

Commented by: @samofatov

With artificial test case - there is no corruption.

In the field - there is corruption. It could be that there is more than one problem.
I have a couple corrupted specimens, and my guess is that in addition to NAV problem there is some sort of race condition between page allocation and GC.

This apparently needs more QA.

@firebird-automations
Copy link
Collaborator Author

Commented by: Calin Pirtea (pcalin)

Hi Vlad and Nickolay,

I am getting this daily on one single live system. Sometimes twice a day. This has been hapening since we moved to Firebird 2.1 about 4 months ago. Although Firebird reports corrupted database, once we restart the Firebird service there is no corruption. Backup restore confirms the database is intact.

We get these messages both when using the DB and when using the security DB, like update passwords or create new account.

The server is 2003 standard 32 bit. Firebird 2.1.2 Dialect 1. 2 quad cores. 4GB RAM. over 100 GB free disk space. DB size just over 4GB.

I've been trying for over a month to reproduce the problem without luck while it keeps on happening on site.

We upgraded to Firebird 2.1.3 yesterday and the problem happened again today in the same manner.

The exception message is usually "page nnn is of wrong type (expected 6, found 5)" but it might be different sometimes.
This is the only site that gets the error and the only site with a DB over 4 GB.

Cheers,
Calin.

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

Calin,

Do you use CS or SS ?

I can build 2.1.3 with patch for you to test, if you wish. But it will fix only "expected 7, found X" kind of errors.
Are you sure your case is "expected 6" ?

@firebird-automations
Copy link
Collaborator Author

Commented by: Calin Pirtea (pcalin)

Hi Vlad,

I use SuperServer. I'm not certain of the case when the corruption is reported inside the live DB but when it happens inside security.fdb it is "expected 6".

This is the complete error:
ISC ERROR CODE:335544335

ISC ERROR MESSAGE:
database file appears corrupt (C:\PROGRAM FILES\FIREBIRD\FIREBIRD_2_1\SECURITY2.FDB)
wrong page type
page 67 is of wrong type (expected 6, found 5)
unable to open database.

Effectively no user can logon to Firebird, however those currently logged on can use the system perfectly.

Cheers,
Calin.

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

Calin,

Does you validate (copy of) security2.fdb ?

@firebird-automations
Copy link
Collaborator Author

Commented by: Calin Pirtea (pcalin)

Hi Vlad,

Yes I validated all DBs. All are in perfect state. No disk corruptions ever, for 6 months.

@firebird-automations
Copy link
Collaborator Author

Commented by: Calin Pirtea (pcalin)

Hi Vlad,

We've changed our DB recently to avoid using blobs in certain stored procedures and we also started using temp tables in several places where we were simulating temp tables. Performance is massively better, however, the "corruption" reported by the server has changed slightly.

This is the message from 30 minutes ago:
ISC ERROR CODE:335544335

ISC ERROR MESSAGE:
database file appears corrupt (D:\DATA\COMMUNICARE\CAAC.FDB)
wrong page type
page 12666 is of wrong type (expected 5, found 4)
At trigger 'BIUD_CURRENT_ORGANISATION' line: 38, col: 1
At trigger 'CON_CURRENT_ORGANISATION' line: 35, col: 33

CON_Current_Organisation is a connection trigger for the DB generating the record for Current_Organisation table. 1 record only calculated by logon username.

After restarting the server everything is working fine. Backup/restore shows there is no corruption to the DB. The general impression is that I'm hitting the same bug just manifested somewhere else.

Cheers,
Calin.

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

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

Target: 2.5 RC1, 2.1.4, 2.0.6 [ 10362, 10361, 10303 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

Fix Version: 2.5 RC1 [ 10362 ]

Fix Version: 2.1.4 [ 10361 ]

Fix Version: 2.0.6 [ 10303 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

Fix is committed into 2.5 and 2.1.4.
2.0.6 will follow soon

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

description: The server is showing the "page nnn is of wrong type (expected 7, found 5)" error when under load.
At times the resulting database has corrupted index or data.

We have developed the test case:
http://www.red-soft.biz/files/TestCase-511.ZIP

=>

The server is showing the "page nnn is of wrong type (expected 7, found 5)" error when under load.
At times the resulting database has corrupted index or data.

We have developed the test case:
http://www.red-soft.biz/files/TestCase-511.ZIP

summary: page 1530262 is of wrong type (expected 7, found 5) => page 1530262 is of wrong type (expected 7, found 5)

@firebird-automations
Copy link
Collaborator Author

Commented by: @samofatov

Vlad, can you check please that the locking scheme that you implemented is correct?

All tests passed just fine, and we deployed builds in the field. The following error appears now:

SQL "execute procedure rpl$assign_generation" Execution error:
ISC ERROR CODE:335544336
ISC ERROR MESSAGE:
deadlock
page 35216, page type 7 lock conversion denied
At procedure 'RPL$ASSIGN_GENERATION' line: 48, col: 5
SQL Message: SQL ERROR CODE:-913
SQL ERROR MESSAGE:
deadlock

rpl$assign_generation does something like:

insert into r$asset(rpl$generation, ass_id)
select 123, ass_id from r$asset
where rpl$generation = 2000000000
group by ass_id

Isn't it the case that open navigational cursor now will prevent the table from being updated?

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

The locking i've added don't prevent updates. It only prevent garbage collection in indices, i.e. re-union of almost empty index pages. Note, this is not a page locks (LCK_bdb).

Is this new error reproducible?

@firebird-automations
Copy link
Collaborator Author

Commented by: @samofatov

Sorry this indeed looks like a different issue when analyzed. No reproducible case so far.

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

I've committed fix for all three branches. The fix fixed test case attached to this ticket but i can't said if it fixed all possible cases.
Feel free to create new tickets with new test cases.

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

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

resolution: Fixed [ 1 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @dmitry-starodubov

Vlad, after applying this patch server (2.1.4.18222) hangs on executing procedure V$F_TABLE_MATVIEW from attached database.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dmitry-starodubov

Attachment: TEST.ZIP [ 11509 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

Confirmed.

Hopefully HEAD is not affected. Fix for 2.1.4 and 2.0.6 will follow today.

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

Link: This issue relate to CORE2698 [ CORE2698 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

The fix is committed into 2.1.4. Please, verify it and i'll backport it in to 2.0.6.
See also CORE2698.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

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

@firebird-automations
Copy link
Collaborator Author

Commented by: Neil Pickles (npickles)

Created new ticket

@firebird-automations
Copy link
Collaborator Author

Modified by: Neil Pickles (npickles)

Attachment: firebird 214 wrong pagetype error screenshot.jpg [ 11683 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: No test => Cannot be tested

Test Details: Attach does not exist.

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