FirebirdSQL / firebird

Firebird server, client and tools
https://firebirdsql.org
1.26k stars 217 forks source link

gbak on classic with ParallelWorkers > 1 doesn't restore indices, giving a cryptic error message #8263

Closed ttyrakow closed 1 month ago

ttyrakow commented 1 month ago

Setup: Firebird 5.0.1, classic mode, with ParallelWorkers=2 (or more) in firebird.conf.

Restoring a database with a common gbak -C backup.fbk database.fdb (without the -PAR option) results in an error like this one:

gbak:cannot commit index PK_XYZ 
gbak: ERROR:invalid database handle (no active connection) 
gbak: ERROR:action cancelled by trigger (3) to preserve data integrity 
gbak: ERROR: Cannot deactivate index used by a PRIMARY/UNIQUE constraint 
gbak:Exiting before completion due to errors 

firebird.log contains an entry:

Failed to create worker attachment
        database /path/to/database.fdb shutdown

The error message gbak shows doesn't correspond to the actual cause of the error (the database is in shutdown mode, and additional worker attachments can't be created).