Skip to content

Add replication journal cleanup when drop database #8626

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

XaBbl4
Copy link
Contributor

@XaBbl4 XaBbl4 commented Jun 25, 2025

Problem: when deleting a DB, log segment files remain, which break replication in the future

First fix - when deleting a DB using DBMS query (drop database), add deleting segments

  1. There is a DB with replication, create a backup
  2. One of two options:
    2.1. Execute the drop database command
    2.2. Restore via gbak with the -recreate_database overwrite or -replace_database option, without deleting the DB and without clearing the journal directory
  3. Old segments will be deleted as unnecessary

Second fix - add a unique GUID of the DB to the segment filename pattern

  1. There is a DB with replication, create a backup
  2. Delete the DB file via the file system
  3. Restore via gbak, without clearing the journal directory
  4. Old segments will remain in the file system, but will not interfere with replication, since the names of the new ones will be different

Also add GUID to filename pattern of journal
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.

1 participant