-
-
Notifications
You must be signed in to change notification settings - Fork 206
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
Error: database file appears corrupted after restore from backup (FB5, RC2) #7942
Comments
To simultaneously run several servers using XNET, you need to configure the IpcName (firebird.conf) in the same way as you configure ports for different FB instances to work via INET. |
I used the connection string |
Moreover, I checked the |
It's IPCNAME parameter that makes it possible to run multiple servers, listening xnet, in parallel. But it's related only to message in the log (XNET error: XNET server initialization failed. Probably, another instance of the server is already running.). What you mention first looks like server crash at the first look. Does it happen for all versions or only one particular? |
I got another backup and now doing restoration. Will come with the result in a few hours. As for XNET, is it enough if I set IPCNAME to FIREBIRD5 for Firebird 5? |
On 1/2/24 19:57, Andrej Kirejeŭ wrote:
As for XNET, is it enough if I set IPCNAME to FIREBIRD5 for Firebird 5?
Enough to avoid mentioned message in the log.
|
as it is a common scenario when multiple versions of Firebird co-exists on the same server, it would be useful to set the default IPCNAME to FIREBIRD5 for Firebird v.5, FIREBIRD6 for the next version etc |
sorry, bug confirmed. another backup -- the same result:
the message during the restore process and then:
during the gfix check. |
What server version is supposed to perform restore ? |
FB5 5.0.0.1304
yes
through IBX component: https://github.com/GoldenSoftwareLtd/gedemin/blob/master/Gedemin/IBX/IBServices.pas it has been doing this way for last 25 years ))
The Presence of localhost in the address string forced IBX to use TCP protocol flag in its components. BTW,
Need to check. |
When run restore with Services API, one should use server name in connection string, not in the target database name. When speak about IBX, it means that server (remote host) name should be specified in In your case In short: you should check and correct values of BTW, what is last message before error ? |
This is how our UI organized. we specify the target server and path to the database in one string, then divide it programmatically and set the corresponding IBX component's properties. The connection definitely goes to the FB5 server because only FB5 process shows activity during the restore process. Before the error message, there are a couple of warnings of unknown UDF functions. These are our functions like BIN_AND and BIN_OR. They duplicate built-in functions. There is no need for them right now, just leftovers in the database we didn't clean up yet. Nevertheless, these warnings were present for years and never resulted into database corruption. |
Could you be more specific and show service properties used ? There is some confusion that better to be cleared up. |
IBConfigService.ServerName := edServer.Text;
if IBConfigService.ServerName > '' then
IBConfigService.Protocol := TCP
else
IBConfigService.Protocol := Local; in our case edServer.text contains It would be easier to check whether the server crashed or not if appropriate records of server starting and server properly shutting down were put into the firebird.log file. |
On 02/01/2024 19:24, Andrej Kirejeŭ wrote:
On 1/2/24 19:57, Andrej Kirejeŭ wrote: As for XNET, is it enough if
I set IPCNAME to FIREBIRD5 for Firebird 5?
Enough to avoid mentioned message in the log.
as it is a common scenario when multiple versions of Firebird co-exists
on the same server, it would be useful to set the default IPCNAME to
FIREBIRD5 for Firebird v.5, FIREBIRD6 for the next version etc
No, it wouldn't be, because that would mean an older Firebird
fbclient.dll wouldn't be able to connect using XNET to a newer Firebird
server (or newer client to older server).
Mark
--
Mark Rotteveel
|
Oh, no. I just changed names to FIREBIRD25, FIREBIRD3, FIREBIRD5... Let us see where it leads now. But, it won't affect network connections, right? |
And regarding failed gfix. The firebird.log now contains thousands of records like:
All errors related to one table in the database. |
No, only XNET. Keep in mind that for a client to now be able to connect to the server with XNET, the firebird.conf of the client library (i.e. located in the same directory as fbclient.dll used by your application) must also contain the right |
Thanks, but...how IBConfigService is related with restore task ? Please, don't add more confusion than we already have.
If Firebird run as a service, look into Windows Event Log. |
If restore was not completed like yours, then it is not surprising that gfix shows errors. Here you should rather look at the errors in firebird.log and the log of restore itself ( You are restoring the database, but where are you restoring it from? What ODS was the backup made from? |
The database was backed up on FB 3 server and restored on FB 5. |
Is restore with gbak ok? Can you share core dumps of crashed server? |
There are no suspicious records in the Windows's logs. So, I assume that FB5 service didn't crash. |
Do error happen when all servers but v5 are stopped? |
cann't check right now. those servers being used. |
well, I'm trying to run from the command prompt and the command just hangs. no CPU activity, no records in the firebird.log file.
|
At this point you can attach debugger to it to see what's happening. |
This command line not uses services and thus not equal to the app case. Could you run quick check with metadata-only restore using services, instead ? Like: gbak -se localhost/3056:service_mgr -r -m -v "K:\Bases\xxx.bk" "g:\Bases\xxx.fdb" |
restoring of metadata goes without any problems:
|
If you run |
How it will help us to catch the crash ? |
It would narrow borders for testcase creation. If problem is related to TCP server, it technically cannot be reproduced in embedded mode. |
relevant records from firebird.log:
|
@hvlad there is a warning in the OS system log:
|
the process started at 1:53, then at 2:22 the warning (see above) had been added to the OSs log, at 4:30 process finished. in contrary to what we had a few months before, now, even though gbak been finishing with the error message, the subsequent gfix call didn't find any corruptions of the database structure. |
You may ignore it. See, for example
|
And empty validation log confirms it. So, what is current state of things ? I see that restore still have some problem on detach or when reconnecting after successful restore, as there is no message 'adjusting the ONLINE and FORCED WRITES flags' and database remains in multi-user maintenance mode. |
Well, I ran restoring using only
last records from the log file:
new entries in the firebird.log
|
Could you provide me with this backup to avoid endless guessing and fix the issue ? |
Anything ? |
Is there an email or messenger through which we can discuss the matter, as it requires arranging access to the database somehow? |
Sure, email me to the hvlad at users sf com |
ok. I will try another restore attempt on the different machine using a backup file from a different day, If an error occurs I will get in touch. |
Spent half of the week conducting tests on three different machines and discovered something interesting. The restoration of the database crashes when the server mode is set to I will attempt to obscure the database and provide a copy to @hvlad for further investigation. |
Good to know, thanks |
With Classic mode the issue is reproduced, fix will follow soon. |
…e from backup (FB5, RC2) Don't use common SortOwner for sorts with different dbb's. After #7671 it could contain cached sort buffers from different pools (dbb_permanent) and then release it to the wrong dbb_sort_buffers making possible usage of deallocated memory later.
The fix is committed into v5, please check next snapshot build. |
…e from backup (FB5, RC2) Don't use common SortOwner for sorts with different dbb's. After #7671 it could contain cached sort buffers from different pools (dbb_permanent) and then release it to the wrong dbb_sort_buffers making possible usage of deallocated memory later.
Confirmed. Everything is ok now. Many thanks! BTW, I have set MaxParallelWorkers = 64 and ParallelWorkers = 16 and the speed of restoring is awesome! |
There are multiple Firebird instances on the server: FB25, FB3, and FB5. Each instance is assigned a dedicated port and an appropriate service name. When using a third-party application to perform a restore, it connects to the server via a TCP connection using the connection string
localhost/3056:some_path_to_database
.At the end of the restoration process, the following error message appears:
Additionally, there is a record in the firebird.log file:
The resulting database file appears to be corrupted, and subsequent
gfix -v -full ...
shows:The text was updated successfully, but these errors were encountered: