Skip to content

Conversation

@GeF0rs
Copy link
Contributor

@GeF0rs GeF0rs commented Jul 3, 2024

Fixed database recovery aborting on the first failure of the first problematic deferred index gbak (#7269)

I took the database to check from #7269
Previously, recovery was interrupted when trying to activate PK_A3.
image

Now the recovery continues, which allows you to smoothly restore PK_A2.
image

The foreign key, however, is still not restored because requires an active primary key, but this still allows you to greatly reduce the number of non-activated indexes (on our industrial base, 3000+ indexes were not activated due to one non-activated one)

Fixed database recovery aborting on the first failure of the first problematic deferred index
gbak (FirebirdSQL#7269)
@GeF0rs GeF0rs changed the title fixed restore deferred primary key indexes Fix #7269: Restore deferred primary key indexes Jul 3, 2024
@GeF0rs
Copy link
Contributor Author

GeF0rs commented Aug 9, 2024

?

@hvlad
Copy link
Member

hvlad commented Aug 9, 2024

What about extracting code, copied from "creating FK" block below, into separate routine to avoid duplication ?

@GeF0rs
Copy link
Contributor Author

GeF0rs commented Sep 2, 2024

I moved the activation of indexes into a separate function, please take a look

@GeF0rs
Copy link
Contributor Author

GeF0rs commented Sep 24, 2024

?

@hvlad
Copy link
Member

hvlad commented Sep 29, 2024

Please, be patient and wait a bit, I'll return to it when time permits.

@hvlad hvlad self-assigned this Oct 24, 2024
@hvlad
Copy link
Member

hvlad commented Oct 24, 2024

I will add some additional fix after merge.

@aafemt
Copy link
Contributor

aafemt commented Oct 24, 2024

JFYI: You can create a pull request to a pull request improving it before merging.

@hvlad
Copy link
Member

hvlad commented Oct 24, 2024

JFYI: You can create a pull request to a pull request improving it before merging.

Yes. But it is too much bureaucracy and not needed in this case.

@hvlad hvlad merged commit 178d83a into FirebirdSQL:master Oct 24, 2024
23 of 24 checks passed
hvlad added a commit that referenced this pull request Oct 24, 2024
- move more duplicated code into activateIndex,
- cache request that modifies RDB$INDICES.RDB$INDEX_INACTIVE.
hvlad pushed a commit that referenced this pull request Oct 24, 2024
* fixed restore deferred primary key indexes

Fixed database recovery aborting on the first failure of the first problematic deferred index
gbak (#7269)

* Extract function activateIndex

Extracted "activateIndex" function to remove duplicate code when restoring the database
hvlad added a commit that referenced this pull request Oct 24, 2024
- move more duplicated code into activateIndex,
- cache request that modifies RDB$INDICES.RDB$INDEX_INACTIVE.
@GeF0rs
Copy link
Contributor Author

GeF0rs commented Oct 25, 2024

Thank you for accepting my fix.
I have studied your additions and taken them into account for future use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FR] Database restore must make every effort on activating deferred indexes

3 participants