diff --git a/sql/log_event_server.cc b/sql/log_event_server.cc index 69a27ed6350..2a5019281ef 100644 --- a/sql/log_event_server.cc +++ b/sql/log_event_server.cc @@ -1721,10 +1721,7 @@ int Query_log_event::do_apply_event(rpl_group_info *rgi, Gtid_log_event::FL_COMPLETED_XA))) || rpl_filter->db_ok(thd->db.str)) { -#ifdef WITH_WSREP - if (!wsrep_thd_is_applying(thd)) -#endif - thd->set_time(when, when_sec_part); + thd->set_time(when, when_sec_part); thd->set_query_and_id((char*)query_arg, q_len_arg, thd->charset(), next_query_id()); thd->variables.pseudo_thread_id= thread_id; // for temp tables @@ -2863,10 +2860,7 @@ int Load_log_event::do_apply_event(NET* net, rpl_group_info *rgi, */ if (rpl_filter->db_ok(thd->db.str)) { -#ifdef WITH_WSREP - if (!wsrep_thd_is_applying(thd)) -#endif - thd->set_time(when, when_sec_part); + thd->set_time(when, when_sec_part); thd->set_query_id(next_query_id()); thd->get_stmt_da()->opt_clear_warning_info(thd->query_id); @@ -5701,10 +5695,7 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi) TIMESTAMP column to a table with one. So we call set_time(), like in SBR. Presently it changes nothing. */ -#ifdef WITH_WSREP - if (!wsrep_thd_is_applying(thd)) -#endif - thd->set_time(when, when_sec_part); + thd->set_time(when, when_sec_part); if (m_width == table->s->fields && bitmap_is_set_all(&m_cols)) set_flags(COMPLETE_ROWS_F); diff --git a/sql/wsrep_applier.cc b/sql/wsrep_applier.cc index 0ec8e6e7f47..feb78507bf9 100644 --- a/sql/wsrep_applier.cc +++ b/sql/wsrep_applier.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2013-2019 Codership Oy +/* Copyright (C) 2013-2024 Codership Oy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -211,7 +211,17 @@ int wsrep_apply_events(THD* thd, } ev->thd= thd; + thd->set_time(); + + if (!ev->when) + { + my_hrtime_t hrtime= my_hrtime(); + ev->when= hrtime_to_my_time(hrtime); + ev->when_sec_part= hrtime_sec_part(hrtime); + } + exec_res= ev->apply_event(thd->wsrep_rgi); + DBUG_PRINT("info", ("exec_event result: %d", exec_res)); if (exec_res) diff --git a/sql/wsrep_high_priority_service.cc b/sql/wsrep_high_priority_service.cc index 1838095687f..798398b1bd9 100644 --- a/sql/wsrep_high_priority_service.cc +++ b/sql/wsrep_high_priority_service.cc @@ -215,7 +215,6 @@ int Wsrep_high_priority_service::start_transaction( const wsrep::ws_handle& ws_handle, const wsrep::ws_meta& ws_meta) { DBUG_ENTER(" Wsrep_high_priority_service::start_transaction"); - m_thd->set_time(); DBUG_RETURN(m_thd->wsrep_cs().start_transaction(ws_handle, ws_meta) || trans_begin(m_thd)); }