[MXS-3383] Debug assertion with delayed_retry and master failure Created: 2021-01-26  Updated: 2021-01-28  Resolved: 2021-01-27

Status: Closed
Project: MariaDB MaxScale
Component/s: readwritesplit
Affects Version/s: 2.5.6
Fix Version/s: 2.5.7

Type: Bug Priority: Major
Reporter: markus makela Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: None


 Description   

When delayed_retry is enabled and the following SQL is executed:

CREATE TABLE test.t1 (id INT);
SET @a = (SELECT SLEEP(@@server_id));
INSERT INTO test.t1 SELECT SLEEP(10);

If the slaves have larger server_id values than the master, they will execute the SET statement slower. This means that the INSERT will be started on the master before all of the results have been received from the slaves. If the master fails before the INSERT completes but after at least one slave has responded to the SET command, a debug assertion will be hit.

This is happens because RWSplitSession::manage_transactions unconditionally erases the query without checking whether the backend in question is the one where the query was being executed on (implied by backend->has_session_commands() being false).

In non-debug versions this would manifest as a failure to retry the query even though it should've been possible. An error would also be logged stating that readwritesplit was not expecting this state.


Generated at Thu Feb 08 04:21:01 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.