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

GFIX -online: message "IProvider::attachDatabase failed when loading mapping cache" appears in Classic (only) if access uses remote protocol [CORE4899] #5192

Closed
firebird-automations opened this issue Aug 4, 2015 · 8 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pavel-zotov

Following batch:
0) reads argument %1, which can be:
*** SS_30 -- if we check 3.0 SuperServer
** SC_30 -- for 3.0 SuperClassic
** CS_30 --for pure 3.0 Classic server
(default value = 'SS_30' -- SuperServer)
1) creates database with name derived from this batch own name + suffix, using appropriate FB instance (SS/SC/CS)
2) moves this database to full shutdown
3) attempts to return database to online state using REMOTE access
4) moves database again to offline
5) attempts to return database to online state using LOCAL access

Also, after on each step it gathers info from database header and extract from it only two lines - with database name and its attributes.

Text:

=== begin of batch `shutdown-online.bat` ===
@echo off

setlocal

@Rem remove any occurrence of FB home from path:
set path=%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\system32\WBEM

set fbarch=%1
if .%1.==.. set fbarch=SS_30

if /i .%fbarch%.==.SS_30. (
set fbhome=C:\1INSTALL\FIREBIRD\fb30sS
set fbport=3333
)
if /i .%fbarch%.==.CS_30. (
set fbhome=C:\1INSTALL\FIREBIRD\fb30Cs
set fbport=3329
)
if /i .%fbarch%.==.SC_30. (
set fbhome=C:\1INSTALL\FIREBIRD\fb30Sc
set fbport=3330
)

set dbpath=%~dp0
set dbname=%~n0.fdb.tmp

del %dbpath%%dbname% 2>nul
echo create database 'localhost/%fbport%:%dbpath%%dbname%' user 'SYSDBA' password 'masterkey'; show version; | %fbhome%\isql -q
%fbhome%\gstat localhost/%fbport%:%dbpath%%dbname% -h -user SYSDBA -password masterkey | findstr /i "%dbname% attributes"

@Rem --------------------------------------------------------

@echo on
%fbhome%\gfix localhost/%fbport%:%dbpath%%dbname% -user SYSDBA -password masterkey -shut full -force 0
%fbhome%\gstat localhost/%fbport%:%dbpath%%dbname% -h -user SYSDBA -password masterkey | findstr /i "%dbname% attributes"
@echo off

@Rem --------------------------------------------------------

@echo on
@echo.
@echo Return to ONLINE - attempt to use remote access:
%fbhome%\gfix localhost/%fbport%:%dbpath%%dbname% -user SYSDBA -password masterkey -online
@echo off
%fbhome%\gstat localhost/%fbport%:%dbpath%%dbname% -h -user SYSDBA -password masterkey | findstr /i "%dbname% attributes"

@Rem --------------------------------------------------------

@echo.
@echo Again move in shutdown mode.
%fbhome%\gfix localhost/%fbport%:%dbpath%%dbname% -user SYSDBA -password masterkey -shut full -force 0 1>nul 2>&1
%fbhome%\gstat localhost/%fbport%:%dbpath%%dbname% -h -user SYSDBA -password masterkey | findstr /i "%dbname% attributes"

@Rem --------------------------------------------------------
@echo on
@echo.
@echo Return to ONLINE - attempt to use local access:
%fbhome%\gfix %dbpath%%dbname% -user SYSDBA -password masterkey -online
@echo off
%fbhome%\gstat localhost/%fbport%:%dbpath%%dbname% -h -user SYSDBA -password masterkey | findstr /i "%dbname% attributes"

del %dbpath%%dbname% 2>nul
=== end of batch `shutdown-online.bat` ===

All three architectures were checked on WI-V3.0.0.31981.

Result for SS_30:
#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠

Database "C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP"
Attributes force write

C:\FBTESTING\qa\fbt-repo\tmp>C:\1INSTALL\FIREBIRD\fb30sS\gfix localhost/3333:C:\FBTESTING\qa\fbt-repo\tmp\shutdown-online.fdb.tmp -user SYSDBA -passwo
rd masterkey -shut full -force 0

C:\FBTESTING\qa\fbt-repo\tmp>C:\1INSTALL\FIREBIRD\fb30sS\gstat localhost/3333:C:\FBTESTING\qa\fbt-repo\tmp\shutdown-online.fdb.tmp -h -user SYSDBA -pa
ssword masterkey | findstr /i "shutdown-online.fdb.tmp attributes"
Database "C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP"
Attributes force write, full shutdown

Return to ONLINE - attempt to use remote access:

C:\FBTESTING\qa\fbt-repo\tmp>C:\1INSTALL\FIREBIRD\fb30sS\gfix localhost/3333:C:\FBTESTING\qa\fbt-repo\tmp\shutdown-online.fdb.tmp -user SYSDBA -passwo
rd masterkey -online
Database "C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP"
Attributes force write

Again move in shutdown mode.
Database "C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP"
Attributes force write, full shutdown

Return to ONLINE - attempt to use local access:

C:\FBTESTING\qa\fbt-repo\tmp>C:\1INSTALL\FIREBIRD\fb30sS\gfix C:\FBTESTING\qa\fbt-repo\tmp\shutdown-online.fdb.tmp -user SYSDBA -password masterkey -o
nline
Database "C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP"
Attributes force write

(i.e. all fine - the're no errors occur)

Result for SC_30:
#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠

Database "C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP"
Attributes force write

C:\FBTESTING\qa\fbt-repo\tmp>C:\1INSTALL\FIREBIRD\fb30Sc\gfix localhost/3330:C:\FBTESTING\qa\fbt-repo\tmp\shutdown-online.fdb.tmp -user SYSDBA -passwo
rd masterkey -shut full -force 0

C:\FBTESTING\qa\fbt-repo\tmp>C:\1INSTALL\FIREBIRD\fb30Sc\gstat localhost/3330:C:\FBTESTING\qa\fbt-repo\tmp\shutdown-online.fdb.tmp -h -user SYSDBA -pa
ssword masterkey | findstr /i "shutdown-online.fdb.tmp attributes"
Database "C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP"
Attributes force write, full shutdown

Return to ONLINE - attempt to use remote access:

C:\FBTESTING\qa\fbt-repo\tmp>C:\1INSTALL\FIREBIRD\fb30Sc\gfix localhost/3330:C:\FBTESTING\qa\fbt-repo\tmp\shutdown-online.fdb.tmp -user SYSDBA -passwo
rd masterkey -online
Database "C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP"
Attributes force write

Again move in shutdown mode.
Database "C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP"
Attributes force write, full shutdown

Return to ONLINE - attempt to use local access:

C:\FBTESTING\qa\fbt-repo\tmp>C:\1INSTALL\FIREBIRD\fb30Sc\gfix C:\FBTESTING\qa\fbt-repo\tmp\shutdown-online.fdb.tmp -user SYSDBA -password masterkey -o
nline
Database "C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP"
Attributes force write

(also all fine, no errors)

Result for CS_30:
#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠

Database "C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP"
Attributes force write

C:\FBTESTING\qa\fbt-repo\tmp>C:\1INSTALL\FIREBIRD\fb30Cs\gfix localhost/3329:C:\FBTESTING\qa\fbt-repo\tmp\shutdown-online.fdb.tmp -user SYSDBA -passwo
rd masterkey -shut full -force 0

C:\FBTESTING\qa\fbt-repo\tmp>C:\1INSTALL\FIREBIRD\fb30Cs\gstat localhost/3329:C:\FBTESTING\qa\fbt-repo\tmp\shutdown-online.fdb.tmp -h -user SYSDBA -pa
ssword masterkey | findstr /i "shutdown-online.fdb.tmp attributes"
Database "C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP"
Attributes force write, full shutdown

Return to ONLINE - attempt to use remote access:

C:\FBTESTING\qa\fbt-repo\tmp>C:\1INSTALL\FIREBIRD\fb30Cs\gfix localhost/3329:C:\FBTESTING\qa\fbt-repo\tmp\shutdown-online.fdb.tmp -user SYSDBA -passwo
rd masterkey -online
database C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP shutdown
-IProvider::attachDatabase failed when loading mapping cache
Database "C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP"
Attributes force write, full shutdown

Again move in shutdown mode.
Database "C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP"
Attributes force write, full shutdown

Return to ONLINE - attempt to use local access:

C:\FBTESTING\qa\fbt-repo\tmp>C:\1INSTALL\FIREBIRD\fb30Cs\gfix C:\FBTESTING\qa\fbt-repo\tmp\shutdown-online.fdb.tmp -user SYSDBA -password masterkey -o
nline
Database "C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP"
Attributes force write

Messages in Classic differ from other two architectures here:
. . .
Return to ONLINE - attempt to use remote access:

C:\FBTESTING\qa\fbt-repo\tmp>C:\1INSTALL\FIREBIRD\fb30Cs\gfix localhost/3329:C:\FBTESTING\qa\fbt-repo\tmp\shutdown-online.fdb.tmp -user SYSDBA -passwo
rd masterkey -online
database C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP shutdown
-IProvider::attachDatabase failed when loading mapping cache
. . .

PS. I have no guess what is correct in above text: maybe it is Classic behave like it was intended and SS & SC are wrong ?

Commits: ef78fed FirebirdSQL/fbt-repository@e5f9d77

@firebird-automations
Copy link
Collaborator Author

Commented by: @sim1984

Did you change the parameter ServerMode in firebird.conf under each architecture?

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

I have three FB instances (CS/SC/SS), each live in separate folder. And of course, their `firebird.conf` files differ in this value.

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

In cases when authentication is possible without maps that can't be currently read from shutdown database attach() error is ignored. In case when authentication fails (no context) an error message about failed access to maps is added to make conditions better understood by user.

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

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

resolution: Fixed [ 1 ]

Fix Version: 3.0 RC 1 [ 10584 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: No test => Done successfully

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

Test Specifics: [Architecture (SS/CS) specific]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

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