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

Restore success illegally reported when gbak was unable to activate all indices #7465

Closed
tomaszdubiel18 opened this issue Jan 31, 2023 · 0 comments

Comments

@tomaszdubiel18
Copy link

Checked on Firebird 3.0.10 SuperServer, both on Windows and Linux.
When I restore the database, gbak returns:
"gbak:cannot commit index FK_NAGL_NAGL_ID_B_NAGL_BL
gbak: ERROR:violation of FOREIGN KEY constraint "FK_NAGL_NAGL_ID_B_NAGL_BL" on table "NAGL"
gbak: ERROR: Foreign key reference target does not exist
gbak: ERROR: Problematic key value is ("ID_NAGL" = 278228)
(...)
gbak:fixing views dbkey length
gbak:updating ownership of packages, procedures and tables
gbak:adding missing privileges
gbak:adjusting system generators
gbak:finishing, closing, and going home
gbak:adjusting the ONLINE and FORCED WRITES flags
gbak:Database is not online due to failure to activate one or more indices.
gbak:Run gfix -online to bring database online without active indices."

This probably behaved differently on Firebird 2.5, the process was stopped on index error, but I'm not sure.
I assume this was made to avoid having unrestorable database but that also results in having no clear information that something went wrong. Having one index error is not terrible, but what I get when having xxx index errors? Then the restored database is pretty useless.
For example, Jaybird returns no exception. Citing @mrotteveel, "Jaybird simply returns the (verbose) output that the service manager provides and throws exception for errors the service call produces".
We were relying on performing a test restore from made backups and if no exception was returned, we assumed the gbk file is correct.
The idea to restore the most data Firebird can get from gkb file is cool, but I don't think there should be returned success on the database restore. Until I make database changes, activate all indices, the database is not usable.

@AlexPeshkoff AlexPeshkoff self-assigned this Jan 31, 2023
@AlexPeshkoff AlexPeshkoff changed the title Restore success, but not completely Restore success illegally reported when gbak was unable to activate all indices Feb 6, 2023
@AlexPeshkoff AlexPeshkoff reopened this Feb 6, 2023
AlexPeshkoff added a commit that referenced this issue Feb 7, 2023
…to activate all indices

(cherry picked from commit edb12d9)
AlexPeshkoff added a commit that referenced this issue Feb 7, 2023
AlexPeshkoff added a commit that referenced this issue Feb 7, 2023
…to activate all indices

(cherry picked from commit edb12d9)
AlexPeshkoff added a commit that referenced this issue Feb 7, 2023
…nable to activate all indices; syntax

(cherry picked from commit 5c18a21)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment