1Z0-888 · Question #81
You are using GTIDs in replication. You need to skip a transaction with the GTID of aaa-bbb-ccc-ddd-eee:3 on a slave. Which procedure would you execute from a MySQL prompt?
The correct answer is B. STOP SLAVE; SET GTID_NEXT='aaa-bbb-ccc-ddd-eee:3'; BEGIN; COMMIT; SET GTID_NEXT='AUTOMATIC'; START SLAVE. Option B is correct because in GTID-based replication, you skip a transaction by injecting an empty transaction that "claims" the problematic GTID - SET GTID_NEXT='aaa-bbb-ccc-ddd-eee:3' tells the slave to handle that GTID manually, and BEGIN; COMMIT; creates an empty…
Question
Options
- ASTOP SLAVE; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;
- BSTOP SLAVE; SET GTID_NEXT='aaa-bbb-ccc-ddd-eee:3'; BEGIN; COMMIT; SET GTID_NEXT='AUTOMATIC'; START SLAVE
- CSTOP SLAVE; RESET SLAVE; BEGIN; SKIP NEXT GTID; COMMIT; START SLAVE;
- DSTOP SLAVE; BEGIN; SET GTID_IGNORE='aaa-bbb-ccc-ddd-eee:3'; COMMIT; START SLAVE;
How the community answered
(17 responses)- A12% (2)
- B82% (14)
- D6% (1)
Explanation
Option B is correct because in GTID-based replication, you skip a transaction by injecting an empty transaction that "claims" the problematic GTID - SET GTID_NEXT='aaa-bbb-ccc-ddd-eee:3' tells the slave to handle that GTID manually, and BEGIN; COMMIT; creates an empty transaction that marks it as executed in gtid_executed, effectively skipping it without applying it; GTID_NEXT='AUTOMATIC' then restores normal replication behavior.
Option A fails because SQL_SLAVE_SKIP_COUNTER is the pre-GTID method for binlog position-based replication - MySQL will return an error if you attempt this when gtid_mode=ON, since GTID mode tracks transactions by ID, not position.
Option C is invalid because SKIP NEXT GTID is not a MySQL command - it does not exist in the MySQL syntax.
Option D is invalid because SET GTID_IGNORE is also fabricated syntax - MySQL has no such command.
Memory tip: Think of it as faking the receipt - you tell MySQL "I'll handle GTID X myself," submit an empty transaction as proof, then hand control back to AUTOMATIC. The slave believes it already processed the transaction and moves on.
Topics
Community Discussion
No community discussion yet for this question.