firebird icon indicating copy to clipboard operation
firebird copied to clipboard

Database stops responding and only backup-restore fix it

Open PavelEmelyanov opened this issue 4 years ago • 10 comments

Hello,

We have a firebird database and it stops responding every 2-3 days and fails with "Unable to complete network request to host "localhost"".

Firebird restart doesn't fix the problem. The only way to fix the db is to make back-up and then restore it.

We have a .NET application and use EF Core.

Does anybody have ideas how to fix it?

PavelEmelyanov avatar Oct 15 '21 07:10 PavelEmelyanov

What Firebird version and architecture ? OS ? Did you check firebird.log ? Did you run validation of broken database ? Do you have one for analyze ?

hvlad avatar Oct 15 '21 07:10 hvlad

What Firebird version and architecture ? OS ? Did you check firebird.log ? Did you run validation of broken database ? Do you have one for analyze ?

Firebird 2.5 OS - Windows Server 2008

I checked firebird.log. It contains many records like that INET/inet_error: read errno = 10054, client address = 127.0.0.1/65525, user = АДМИНИСТРАТОР.-1.-1

We didn't run validation.

Here is the database for analyze https://disk.yandex.ru/d/4gMlQoGOqkDaOQ

Thank you!

PavelEmelyanov avatar Oct 15 '21 08:10 PavelEmelyanov

Pls, no yandex or other resourses not awailable in Ukraine.

hvlad avatar Oct 15 '21 08:10 hvlad

Sorry, moved to Google Drive - https://drive.google.com/file/d/1rqO9SH-baLjIXt8XBg-MG2-HXqBLE4zF/view?usp=sharing

PavelEmelyanov avatar Oct 15 '21 08:10 PavelEmelyanov

I see no corruption at your db. It have stuck OIT and needs to run sweep. Also, FW=OFF is not recommended. What exact Firebird version do you use ? And what architecture (SS\CS\SC) ? When Firebird "stop responding" do you able to make new connection and run simple query, such as SELECT * FROM RDB$DATABASE ?

hvlad avatar Oct 15 '21 08:10 hvlad

Run gstat -r and you'll see two tables with a lot of record backversions:

NumberOfVehiclesOnRoute (165)
    Primary pointer page: 249, Index root page: 250
    Average record length: 28.30, total records: 2557028
    Average version length: 10.29, total versions: 415523, max versions: 156
    Data pages: 23380, data page slots: 23380, average fill: 67%
	
OBJECTS (128)
    Primary pointer page: 175, Index root page: 176
    Average record length: 137.26, total records: 4667
    Average version length: 21.65, total versions: 18503156, max versions: 123690
    Data pages: 91100, data page slots: 91100, average fill: 96%

Note, the table OBJECTS have record versions ~4000 time more than records !

So, check transactions management in your apps, run sweep regularly and keep an eye on stats. More questions you may ask at our support group https://groups.google.com/g/firebird-support or at https://www.sql.ru/forum/interbase

hvlad avatar Oct 15 '21 09:10 hvlad

Thanks for the answer.

I'm not a firebird guru, so could you provide more details?

As for transaction management, all queries are made with EF Core (.NET Firebird client), so not sure how to change it.

As for sweep. Do you recommend to run gfix -s[weep] [-i[gnore]] database_name on nightly basis, e.g. ??

PavelEmelyanov avatar Oct 15 '21 10:10 PavelEmelyanov

On 2021-10-15 12:13, PavelEmelyanov wrote:

Thanks for the answer.

I'm not a firebird guru, so could you provide more details?

As for transaction management, all queries are made with EF Core (.NET Firebird client), so not sure how to change it.

As for sweep. Do you recommend to run gfix -s[weep] [-i[gnore]] database_name on nightly basis, e.g. ??

The GitHub issues of the Firebird project is intended for reporting bugs, not for support questions.

For support questions on Firebird itself, please use firebird-support (https://groups.google.com/g/firebird-support) as your first port of call. For questions specifically related to using Firebird from .NET (core), use firebird-net-provider (https://groups.google.com/g/firebird-net-provider).

Mark

mrotteveel avatar Oct 15 '21 11:10 mrotteveel

@PavelEmelyanov please answer all my questions - I'm not asking them for fun. Most likely there are no problem with Firebird itself. To ensure, I need answers on my questions.

To learn about best practices for application development and transaction control, use the sources Mark and I showed above.

hvlad avatar Oct 15 '21 15:10 hvlad

I see no corruption at your db. It have stuck OIT and needs to run sweep. Also, FW=OFF is not recommended. What exact Firebird version do you use ? And what architecture (SS\CS\SC) ? When Firebird "stop responding" do you able to make new connection and run simple query, such as SELECT * FROM RDB$DATABASE ?

I'm sorry, I didn't notice your questions. I'll go back with answers

PavelEmelyanov avatar Oct 15 '21 16:10 PavelEmelyanov