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

Optimize MYSQL_REPLICATION_SLAVE_DUMP behavior #76149

Open
mostafa-rz opened this issue Jan 10, 2025 · 1 comment · May be fixed by #76221
Open

Optimize MYSQL_REPLICATION_SLAVE_DUMP behavior #76149

mostafa-rz opened this issue Jan 10, 2025 · 1 comment · May be fixed by #76221
Assignees
Labels
mysql tech-issues The user has a technical issue about an application triage Triage is needed

Comments

@mostafa-rz
Copy link

Name and Version

bitnami/mysql:8.4-debian-12

What architecture are you using?

amd64

What steps will reproduce the bug?

  1. Enable the MYSQL_REPLICATION_SLAVE_DUMP
  2. Start replica
  3. During the dump process, insert new values
  4. The MySQL table LOCK is not working and it is allowed the insert
  5. The database snapshot is not consistent anymore

What is the expected behavior?

Writing to the database must not be allowed during the dump process.

What do you see instead?

Based on the MySQL documents:

Warning
Leave the client from which you issued the FLUSH TABLES statement running so that the read lock remains in effect. If you exit the client, the lock is released.

The problem relies on this part of the code. The FLUSH TABLES WITH READ LOCK; is executed by a client and afterward it exits, therefore the lock is released.

I will make a pull request that mysqldump take responsibility for locking the tables and finding the binlog position.

Additional information

No response

@mostafa-rz mostafa-rz added the tech-issues The user has a technical issue about an application label Jan 10, 2025
@github-actions github-actions bot added the triage Triage is needed label Jan 10, 2025
@carrodher
Copy link
Member

Thank you for opening this issue and submitting the associated Pull Request. Our team will review and provide feedback. Once the PR is merged, the issue will automatically close.

Your contribution is greatly appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mysql tech-issues The user has a technical issue about an application triage Triage is needed
Projects
None yet
2 participants