1
0
mirror of https://github.com/MariaDB/server.git synced 2025-11-09 11:41:36 +03:00

Merge branch '11.8' into 12.0

main/statistics_json.result is updated for f8ba5ced55 (MDEV-36099)

The test uses 'delete from t1' in many places and then populates
the table again. The natural order of rows in a MyISAM table is well
defined and the test was implicitly relying on that.

before f8ba5ced55 delete was deleting rows one by one, using
ha_myisam::delete_row() because the connection was stuck in rbr mode.
This caused rows to be shown in the reverse insertion order (because of
the delete link list).

MDEV-36099 fixes this bug and the server now correctly uses
ha_myisam::delete_all_rows(). This makes rows to be shown in the
insertion order as expected.
This commit is contained in:
Sergei Golubchik
2025-07-31 20:55:47 +02:00
426 changed files with 11594 additions and 2855 deletions

View File

@@ -104,6 +104,17 @@ handle_queued_pos_update(THD *thd, rpl_parallel_thread::queued_event *qev)
(e->force_abort && !rli->stop_for_until))
return;
#ifdef ENABLED_DEBUG_SYNC
DBUG_EXECUTE_IF("pause_sql_thread_on_fde",
DBUG_ASSERT(!debug_sync_set_action(thd, STRING_WITH_LEN(
"now SIGNAL paused_on_fde WAIT_FOR sql_thread_continue"
)));
DBUG_ASSERT(!debug_sync_set_action(thd, STRING_WITH_LEN(
"now SIGNAL main_sql_thread_continue"
)));
);
#endif
mysql_mutex_lock(&rli->data_lock);
cmp= compare_log_name(rli->group_relay_log_name, qev->event_relay_log_name);
if (cmp < 0)
@@ -1541,6 +1552,14 @@ handle_rpl_parallel_thread(void *arg)
else
rgi->mark_start_commit();
DEBUG_SYNC(thd, "rpl_parallel_after_mark_start_commit");
#ifdef ENABLED_DEBUG_SYNC
DBUG_EXECUTE_IF("halt_past_mark_start_commit",
{
DBUG_ASSERT(!debug_sync_set_action
(thd, STRING_WITH_LEN("now WAIT_FOR past_mark_continue")));
DBUG_SET_INITIAL("-d,halt_past_mark_start_commit");
};);
#endif
}
}
@@ -3054,13 +3073,21 @@ rpl_parallel::stop_during_until()
}
bool
rpl_parallel::workers_idle(Relay_log_info *rli)
bool Relay_log_info::are_sql_threads_caught_up()
{
mysql_mutex_assert_owner(&rli->data_lock);
return !rli->last_inuse_relaylog ||
rli->last_inuse_relaylog->queued_count ==
rli->last_inuse_relaylog->dequeued_count;
mysql_mutex_assert_owner(&data_lock);
if (!sql_thread_caught_up)
return false;
/*
The SQL thread sets @ref worker_threads_caught_up to `false` but not `true`.
Therefore, this place needs to check if it can now be `true`.
*/
if (!worker_threads_caught_up && ( // No need to re-check if already `true`.
!last_inuse_relaylog || // `nullptr` case
last_inuse_relaylog->queued_count == last_inuse_relaylog->dequeued_count
))
worker_threads_caught_up= true; // Refresh
return worker_threads_caught_up;
}