Skip to content

Commit 17aa0d5

Browse files
Revert "Fixed PS-7873 (log_status table reports wrong gtid_executed)"
This reverts commit b7e7bd2.
1 parent 541f682 commit 17aa0d5

File tree

7 files changed

+7
-142
lines changed

7 files changed

+7
-142
lines changed

mysql-test/suite/binlog_gtid/r/binlog_gtid_log_status_mismatch.result

Lines changed: 0 additions & 30 deletions
This file was deleted.

mysql-test/suite/binlog_gtid/t/binlog_gtid_log_status_mismatch.test

Lines changed: 0 additions & 83 deletions
This file was deleted.

sql/binlog.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8873,7 +8873,6 @@ void MYSQL_BIN_LOG::process_commit_stage_queue(THD *thd, THD *first) {
88738873
head->commit_error, YESNO(head->tx_commit_pending)));
88748874
}
88758875

8876-
DEBUG_SYNC(thd, "process_commit_stage_queue_before_handle_gtid");
88778876
/*
88788877
Handle the GTID of the threads.
88798878
gtid_executed table is kept updated even though transactions fail to be

sql/binlog.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,6 @@ class MYSQL_BIN_LOG : public TC_LOG {
978978
inline mysql_mutex_t *get_log_lock() { return &LOCK_log; }
979979
inline mysql_mutex_t *get_commit_lock() { return &LOCK_commit; }
980980
inline mysql_mutex_t *get_after_commit_lock() { return &LOCK_after_commit; }
981-
inline mysql_mutex_t *get_sync_lock() { return &LOCK_sync; }
982981
inline mysql_cond_t *get_log_cond() { return &update_cond; }
983982
inline Binlog_ofile *get_binlog_file() { return m_binlog_file; }
984983

sql/log_resource.cc

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
2323

2424
#include "sql/log_resource.h"
25-
#include "debug_sync.h"
2625
#include "sql-common/json_dom.h"
2726

2827
int MY_ATTRIBUTE((visibility("default")))
@@ -102,23 +101,12 @@ bool Log_resource_binlog_wrapper::collect_info() {
102101
return error;
103102
}
104103

105-
void Log_resource_gtid_state_wrapper::lock() {
106-
DEBUG_SYNC(current_thd, "log_resource_gtid_lock");
107-
mysql_mutex_lock(binlog->get_sync_lock());
108-
mysql_mutex_lock(binlog->get_commit_lock());
109-
global_sid_lock->wrlock();
110-
}
104+
void Log_resource_gtid_state_wrapper::lock() { global_sid_lock->wrlock(); }
111105

112-
void Log_resource_gtid_state_wrapper::unlock() {
113-
global_sid_lock->unlock();
114-
mysql_mutex_unlock(binlog->get_commit_lock());
115-
mysql_mutex_unlock(binlog->get_sync_lock());
116-
}
106+
void Log_resource_gtid_state_wrapper::unlock() { global_sid_lock->unlock(); }
117107

118108
bool Log_resource_gtid_state_wrapper::collect_info() {
119109
bool error = false;
120-
mysql_mutex_assert_owner(binlog->get_sync_lock());
121-
mysql_mutex_assert_owner(binlog->get_commit_lock());
122110
global_sid_lock->assert_some_wrlock();
123111

124112
char *gtid_executed_string;
@@ -163,10 +151,9 @@ Log_resource *Log_resource_factory::get_wrapper(MYSQL_BIN_LOG *binlog,
163151
}
164152

165153
Log_resource *Log_resource_factory::get_wrapper(Gtid_state *gtid_state,
166-
MYSQL_BIN_LOG *binlog,
167154
Json_dom *json) {
168155
Log_resource_gtid_state_wrapper *wrapper;
169-
wrapper = new Log_resource_gtid_state_wrapper(gtid_state, binlog, json);
156+
wrapper = new Log_resource_gtid_state_wrapper(gtid_state, json);
170157
return wrapper;
171158
}
172159

sql/log_resource.h

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -176,23 +176,19 @@ class Log_resource_binlog_wrapper : public Log_resource {
176176
*/
177177
class Log_resource_gtid_state_wrapper : public Log_resource {
178178
Gtid_state *gtid_state = nullptr;
179-
MYSQL_BIN_LOG *binlog = nullptr;
180179

181180
public:
182181
/**
183182
Log_resource_gtid_state_wrapper constructor.
184183
185184
@param[in] gtid_state_arg the pointer to the Gtid_state object resource.
186-
@param[in] binlog_arg the pointer to the MYSQL_BIN_LOG object resource.
187185
@param[in] json_arg the pointer to the JSON object to be populated with the
188186
resource log information.
189187
*/
190188

191189
Log_resource_gtid_state_wrapper(Gtid_state *gtid_state_arg,
192-
MYSQL_BIN_LOG *binlog_arg, Json_dom *json_arg)
193-
: Log_resource(json_arg),
194-
gtid_state(gtid_state_arg),
195-
binlog(binlog_arg) {}
190+
Json_dom *json_arg)
191+
: Log_resource(json_arg), gtid_state(gtid_state_arg) {}
196192

197193
void lock() override;
198194
void unlock() override;
@@ -258,14 +254,12 @@ class Log_resource_factory {
258254
Creates a Log_resource wrapper based on a Gtid_state object.
259255
260256
@param[in] gtid_state the pointer to the Gtid_state object resource.
261-
@param[in] binlog the pointer to the MYSQL_BIN_LOG object resource.
262257
@param[in] json the pointer to the JSON object to be populated with the
263258
resource log information.
264259
@return the pointer to the new Log_resource.
265260
*/
266261

267-
static Log_resource *get_wrapper(Gtid_state *gtid_state,
268-
MYSQL_BIN_LOG *binlog, Json_dom *json);
262+
static Log_resource *get_wrapper(Gtid_state *gtid_state, Json_dom *json);
269263

270264
/**
271265
Creates a Log_resource wrapper based on a handlerton.

storage/perfschema/table_log_status.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,7 @@ int table_log_status::make_row() {
226226
*/
227227
{
228228
Log_resource *res;
229-
res = Log_resource_factory::get_wrapper(gtid_state, &mysql_bin_log,
230-
&json_local);
229+
res = Log_resource_factory::get_wrapper(gtid_state, &json_local);
231230
error = DBUG_EVALUATE_IF("log_status_oom_gtid", 1, !res);
232231
if (error) {
233232
my_error(ER_UNABLE_TO_COLLECT_LOG_STATUS, MYF(0), "LOCAL",

0 commit comments

Comments
 (0)