[MDEV-4827] [PATCH] mysqldump --dump-slave=2 --master-data=2 doesn't record both Created: 2013-07-30 Updated: 2024-02-08 Resolved: 2024-02-08 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Scripts & Clients |
| Affects Version/s: | 5.5.32, 5.5 |
| Fix Version/s: | 10.5.25, 10.6.18, 10.11.8, 11.0.6, 11.1.5, 11.2.4, 11.3.3 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Daniel Black | Assignee: | Daniel Black |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | beginner-friendly, patch, replication, upstream, verified | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
from
only the following replication position was recorded.
Its useful too have both since in a backup scenario its unknown whether the dump is going to be use used to replace the master or configured as the new slave. |
| Comments |
| Comment by Elena Stepanova [ 2013-07-30 ] |
|
Hi Daniel, I agree, nothing in documentation suggests that these options are mutually exclusive, and comments in the code also don't explain why it's done this way, they only mention preserving master logs, but it's irrelevant to master_data: /* We don't delete master logs if slave data option */ if (opt_master_data) { opt_lock_all_tables= !opt_single_transaction; opt_slave_data= 0; }The fix is primitive unless there is a secret reason why it was done this way: === modified file 'client/mysqldump.c' @@ -966,7 +965,6 @@ if (opt_single_transaction || opt_lock_all_tables) However, since it comes from upstream, it would be good to (try to) get it fixed there. Are you willing to file a bug at bugs.mysql.com? I can do it on your behalf, but yours might have a better chance, besides it will be easier for you to track. |
| Comment by Daniel Black [ 2013-07-31 ] |
|
ok. Thanks for the analysis - logged http://bugs.mysql.com/bug.php?id=69875 |
| Comment by kurt.ding [ 2022-09-21 ] |
|
Ok, I check the mysql code in branch 8.0 , but slave data and master data is still exclusive. So this suggested patch is not included. |
| Comment by kurt.ding [ 2022-09-21 ] |
|
In my opinion , when a user uses mysqldump, he need to know which role the machine is basiclly . And he still can manually STOP SLAVE SQL_THREAD or STOP SLAVE; |
| Comment by Daniel Black [ 2023-07-18 ] |
|
Can I get a review on https://github.com/MariaDB/server/pull/2701 please? |
| Comment by Brandon Nesterenko [ 2023-10-27 ] |
|
Hi Daniel! I left a comment on the PR for your consideration. |