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

sweep running on read_only databases [CORE342] #680

Closed
firebird-automations opened this issue Jul 14, 2005 · 14 comments
Closed

sweep running on read_only databases [CORE342] #680

firebird-automations opened this issue Jul 14, 2005 · 14 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Mustafa YILMAZ (myilmaz)

Attachments:
core_0342_raw_fdb_files_prepared_for_running_on_FB_253_254_256.7z
core_0342_raw_fdb_files_prepared_for_running_on_FB_30.7z

SFID: 1238128#⁠
Submitted By: myilmaz

versions: fb 1.5.2, fb 2 alpha 2

test case:
create test db
set sweep internal to 0
set read_only to true

reconnect test db
execute 20000 times (move up transaction counter)
SELECT COUNT(*) FROM RDB$DATABASE;
COMMIT;

firebird 2 log message
internal gds software consistency check (cannot find tip
page (165), file: tra.cpp line: 2475)

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Workflow: jira [ 10366 ] => Firebird [ 14611 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

It was fixed at CORE4134 which disabled sweep on read-only databases

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

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

resolution: Fixed [ 1 ]

Fix Version: 2.5.3 [ 10461 ]

Fix Version: 3.0 Alpha 1 [ 10331 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

I still _can_ reproduce message in FB 2.5.3 ... 2.5.6 about "cannot find tip page", but with different line numbers:

internal Firebird consistency check (cannot find tip page (165), file: tra.cpp line: 2375) // WI-V2.5.3.26780
internal Firebird consistency check (cannot find tip page (165), file: tra.cpp line: 2383) // WI-V2.5.4.26856
internal Firebird consistency check (cannot find tip page (165), file: tra.cpp line: 2428) // WI-V2.5.6.26979

For each FB version I did following:
1) created empty database + quit
2) <this_FB_home>\bin\gfix -h 0 /:path\empty_database.fdb
3) <this_FB_home>\bin\gfix -mode read_only /:path\empty_database.fdb

Then I did connect to that database (by ISQL) and run script ("core_0342-run.sql " -- see attached .7z):

set list on;
select current_transaction from rdb$database;
set term ^;
execute block as
declare n int = 100000;
declare i int;
begin
while (n>0) do
in autonomous transaction do
select :n-1 from rdb$database into n
;
end
^
set term ;^

(yes, it does 100'000 moves Tx counter instead of 20'000).

Please see attached .7z - there are all raw .fdb files (which were after step "3)" but before applying script) + .sql

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

Attachment: core_0342_raw_fdb_files_prepared_for_running_on_FB_253_254_256.7z [ 12913 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

The same on 3.0! Please look:

Database: localhost/3333:C:\MIX\firebird\QA\fbt-repo\tmp\E30.FDb, User: SYSDBA
SQL> show version;
ISQL Version: WI-V3.0.0.32376 Firebird 3.0 Release Candidate 2
Server version:
Firebird/Windows/Intel/i386 (access method), version "WI-V3.0.0.32376 Firebird 3.0 Release Candidate 2"
Firebird/Windows/Intel/i386 (remote server), version "WI-V3.0.0.32376 Firebird 3.0 Release Candidate 2/tcp (cs
prog)/P13"
Firebird/Windows/Intel/i386 (remote interface), version "WI-V3.0.0.32376 Firebird 3.0 Release Candidate 2/tcp
(csprog)/P13"
on disk structure version 12.0
SQL> in core_0342-run.sql ;

CURRENT_TRANSACTION 5

Statement failed, SQLSTATE = XX000
internal Firebird consistency check (cannot find tip page (165), file: tra.cpp line: 2303)

Checked on SS, SC.

Classic (and ONLY this arch.) will add into firebird.log (after text about "cannot find tip page ") also this:

CSPROG Tue Mar 08 15:02:37 2016
INET/inet_error: read errno = 10054, client host = csprog, address = 192.168.43.154/1882, user = zotov

SuperServer will be crashed (service will be stopped).
Raw database for testing in FB 3.0 see also in attached .7z

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

Attachment: core_0342_raw_fdb_files_prepared_for_running_on_FB_30.7z [ 12914 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

I found thresholds for 2.5.6 and 3.0: maximal number of autonomous transactions (which move Tx counters) should not exceed 16297 for 2.5.6 and 32681 for 3.0.0 -- at least for databases which are attached above:

So, the following script contains max. available values for 'n'; if we'll increase 'n' by 1 we get "internal Firebird consistency check (cannot find tip page (165), file: tra.cpp line: NNNN)":

set list on;
select current_transaction from rdb$database;
set term ^;
execute block as
--declare n int = 16297; -- max for 2.5.6
--declare n int = 32681; -- max for 3.0
declare i int;
begin
while (n>0) do
in autonomous transaction do
select :n-1 from rdb$database into n
;
end
^
set term ;^

BTW, I have *no* firebird.conf which contain 'bugcheckabort = 1'.

So, from where this does appear (I mean "bugcheck" word in following text):

Statement failed, SQLSTATE = XX000
internal Firebird consistency check (can't continue after bugcheck)

-- ?

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Your "threasholds" are easy to explain, they depend on the default page size (4KB in v2.5 and 8KB in v3.0). Every transaction state occupies two bits in TIP, so the page size should be multiplied by four to get these numbers.

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

But what about this ticket state (resolved / fixed) ?

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

Pavel,
do you see a sweep in your tests ?

As for "cannot find tip page" see CORE4645 and test next snapshot build of 2.5.6

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

> do you see a sweep in your tests ?

_NO_ messages about sweep did appear in firebird.log for 2.5.3, 2.5.4, 2.5.6 & 3.0

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

> do you see a sweep in your tests ?

OK, I understand. One need to make "integral test" for several tickets at once.

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

I have to correct myself about 2.5.6: on _LAST_ snapshot (WI-V2.5.6.26980) all works fine.

Checked on SS and SC, with script that tries to increase Tx counter up to 1'000'000.
This script was launched in single and in two ISQL sessions (i.e. making Tx counters be increased in "parallel" mode, separately).

As of 4.0 - still get error message (see above; checked on WI-T4.0.0.32386 , build of 08-mar-2016).

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

2 participants