[MDEV-28700] MariaDB will produce binlog even though I canceled with `control-c` signal when the master with rpl_semi_sync_master_enabled=1 and has no slave nodes Created: 2022-05-30 Updated: 2023-08-08 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Replication |
| Affects Version/s: | 10.6.7 |
| Fix Version/s: | 10.6 |
| Type: | Bug | Priority: | Major |
| Reporter: | Kuijun Cui | Assignee: | Andrei Elkin |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
LSB Version: :core-4.1-amd64:core-4.1-noarch
|
||
| Issue Links: |
|
||||||||
| Description |
|
I'm doing test about
Repeatedly doing the above operation, and found that this will keep the gtid increasing every time. Is it right logic for semi-sync produce this behavior? |
| Comments |
| Comment by Daniel Black [ 2022-05-31 ] | |||||||||
|
It seems quite normal for rolled back transactions to discard the gtid. There can be gaps in the gtid because of this. The important bit is because its semisync there shouldn't be a committed insert and nor should the transaction be in the binary log. As a final check, start all slaves, do a transaction that succeeds, and check the binary log to ensure that despite the gaps, the new transaction is there and the rolled back transaction isn't. | |||||||||
| Comment by Kuijun Cui [ 2022-06-01 ] | |||||||||
|
I tested with go mysql connector driver, need to do more logic to handle this scenario for long transaction operation, and timeout logic to cancel this operation, something else to retry the failed transaction. | |||||||||
| Comment by Daniel Black [ 2022-06-01 ] | |||||||||
|
Let the server cancel it for you: SET STATEMENT max_statement_time=10 FOR INSERT INTO .... Please report if this doesn't work. So the title here indicates that it will produce binlog. Is that correct or are you making the assumption based on gtid increments? | |||||||||
| Comment by Kuijun Cui [ 2022-06-01 ] | |||||||||
|
did not take effect with this way | |||||||||
| Comment by Daniel Black [ 2022-07-28 ] | |||||||||
|
bnestere do you think max_statement_time should be respected by semisync? It might be harder on a COMMIT to return with an error, however galera would. | |||||||||
| Comment by Brandon Nesterenko [ 2022-08-09 ] | |||||||||
|
Sorry for the late reply, I was on vacation last week. I think this situation is captured by rpl_semi_sync_master_wait_point. When set to AFTER_COMMIT (the default), I think max_statement_time would not be respected. If set to AFTER_SYNC, I think max_statement_time should be respected. Note too, however, rpl_semi_sync_master_timeout is considered independently from max_statement_time. That is, if rpl_semi_sync_master_timeout > max_statement_time, the server would await an ACK for rpl_semi_sync_master_timeout, even if it is greater than max_statement_time. With that said, it would make sense to me that if AFTER_SYNC is used, the ACK wait would be overridden with max_statement_time if it is less than rpl_semi_sync_master_timeout. In AFTER_COMMIT mode; however, they make sense to be independent to me. Elkin, what are your thoughts? |