Issue Details (XML | Word | Printable)

Key: CORE-1481
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Vlad Khorsun
Reporter: fabianobonin
Votes: 0
Watchers: 0
Operations

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

gfix may report false errors when using in-memory metadata

Created: 27/Sep/07 10:03 AM   Updated: 18/Nov/08 01:17 PM
Component/s: GFIX
Affects Version/s: 2.0.3, 2.1 Beta 2
Fix Version/s: 2.1 RC1, 2.0.4

Time Tracking:
Not Specified

Environment: Linux Fedora Core 5 and FB SS 2.0.3


 Description  « Hide
I'm pasting here some parts of a support list thread on 09/26/2007

- I did shut down the database in single user mode
- Before connect to the database, I noticed fbserver is still using the database file
- I did run a large set of DDL and DML instructions to upgrade the database (including dropping 4 tables), using a update application. This application commits after each instruction.
- I closed the upgrade application
- I did run "gfix -v -full" in the database and got the erros:

server.domain.com (Server) Wed Sep 26 08:38:46 2007
       Database: /database.fdb
       Pointer page (sequence 0) lost in table (213)
server.domain.com (Server) Wed Sep 26 08:38:52 2007
       Database: /database.fdb
       Pointer page (sequence 0) lost in table (224)
server.domain.com (Server) Wed Sep 26 08:38:52 2007
       Database: /database.fdb
       Pointer page (sequence 0) lost in table (226)
server.domain.com (Server) Wed Sep 26 08:38:52 2007
       Database: /database.fdb
       Pointer page (sequence 0) lost in table (228)

- The table ID's belongs to the removed tables
- In the next day, i did run gfix again, and there were no errors reported


 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Vlad Khorsun added a comment - 30/Sep/07 06:42 AM
Reproduced :

1st concole>isql
Use CONNECT or CREATE DATABASE to specify a database
SQL> create database 'test.fdb';
SQL> create table t (f int);
SQL> insert into t values (1);
SQL> commit;
SQL> drop table t;
SQL> create view t as select 1 as f from rdb$database;
SQL> select * from t;

           F
============
           1

2nd console>gfix -shut single -force 0 test.fdb

2nd console>gfix -v -f test.fdb
Summary of validation errors
        Number of pointer page errors : 1

Vlad Khorsun added a comment - 30/Sep/07 07:00 AM
Validation code used metadata (jrd_rel) and usually scanned it by himself as validation always performed in exclusive attachment.
But if database was shutdown by administrator and some attachment was left (it is legal as shutdown don't disconnect user attachments) then validation code will use existing metadata.
Error is that validation code didn't check for deleted objects which may left in metadata cache.