Issue Details (XML | Word | Printable)

Key: CORE-3549
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Vlad Khorsun
Reporter: alainsegura
Votes: 0
Watchers: 3

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

Database corruption after end of session : page xxx is of wrong type expected 4 found 7

Created: 08/Jul/11 10:50 PM   Updated: 14/Jul/15 12:45 PM
Component/s: Engine
Affects Version/s: 2.5.1
Fix Version/s: 2.5.1, 2.1.5, 3.0 Alpha 1

Environment: Windows (All versions) -- Engine version 32Bits Superserver.

QA Status: Done successfully
Test Details:
NOTE: could NOT reproduce on official 2.5.1 (WI-V2.5.1.26351, issued 03-oct-2011).
Fix for this ticket in 2.5.1 was before official 2.5.1 release: 17-jul-2011, rev. 53327

 Description  « Hide

* When a run my software with the engine all is ok, in ALL cases.

* When a run my software with a "small" (100000) set of operations, and with the engine nothing special happen (all is ok).

* When a run my software with the engine with a huge number (10000000) of transactions including operations such as:
insert/update, select, create procedure, drop procedure The work end normally (no error message) while connected.

BUT after disconnection and reconnection to the database, the engine return the following error :

"page 266 is of wrong type expected 4 found 7"

and the database is corrupted and unusable !!

Same problem under various OS version (windows) and databases. The engine "itself" is the cause of the problem.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
alainsegura added a comment - 09/Jul/11 05:45 AM
The database seem to be in a correct state while the initial connection is active. When the connection is closed, impossible to reconnect to the database, the engine return the error page X is of wrong type expected 4 found 7.

Vlad Khorsun added a comment - 09/Jul/11 02:01 PM
Reproducible test case required.

alainsegura added a comment - 09/Jul/11 02:46 PM
I'am investigating this problem, at this time a have found this:

*without the usage of global temporary table
on commit preserve rows

-> no database corrution

*with the usage of command
recreate table xxxx global temporary
on commit preserve rows

--> after hundred of transactions --> the database get corrupted.

reproductible case coming soon...

alainsegura added a comment - 10/Jul/11 06:47 AM
Sorry, i have created a new issue (core 3550) for a new problem, but in fact, it's the same issue, see core-3550 for detail and a reproductible case

Vlad Khorsun added a comment - 10/Jul/11 09:32 AM
Why do you think CORE-3550 is the same issue ? Here we see the "wrong page type" error while at CORE-3550 we see the crash.

Vlad Khorsun added a comment - 17/Jul/11 09:34 AM
To reproduce:

1. Create GTT ON COMMIT PRESERVE ROWS and index on it in the same transaction :

set autoddl off;
create global temporary table test (x int) on commit preserve rows;
create index xtest on test (x);

2. Make engine write record into RDB$PAGES with RDB$RELATION_ID = 0. It happens when new TIP or generator page is created.
For example, start page_size * 4 transactions to create new TIP page:

execute block
declare variable i integer = 0;
  while (i < 32800) do -- i have page size 8KB
    in autonomous transaction do
      execute statement 'insert into test values (1)';
    i = i + 1;

3. Disconnect and connect again.


page XXX is of wrong type expected 4 found YYY

Error while trying to read from file
Reached the end of the file.

will be raised.

Vlad Khorsun added a comment - 17/Jul/11 09:54 AM
The bug was introduced with patch for CORE-1361 but became visible after the patch for CORE-3503