summaryrefslogtreecommitdiff
path: root/storage/innobase/trx
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-01-26 09:05:46 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2021-01-27 15:45:39 +0200
commit7f1ab8f742ac42e82dd39a6e11390254cb72319c (patch)
tree3b9ec2bdef07e4f4a151fe1b304291d4396c6cfb /storage/innobase/trx
parentff3f07ce82a664148bbefdb2b7d6266aa8dd09fc (diff)
downloadmariadb-git-7f1ab8f742ac42e82dd39a6e11390254cb72319c.tar.gz
Cleanups:
que_thr_t::fork_type: Remove. QUE_THR_SUSPENDED, TRX_QUE_COMMITTING: Remove. Cleanup lock_cancel_waiting_and_release()
Diffstat (limited to 'storage/innobase/trx')
-rw-r--r--storage/innobase/trx/trx0i_s.cc16
-rw-r--r--storage/innobase/trx/trx0purge.cc5
-rw-r--r--storage/innobase/trx/trx0roll.cc4
-rw-r--r--storage/innobase/trx/trx0trx.cc5
4 files changed, 20 insertions, 10 deletions
diff --git a/storage/innobase/trx/trx0i_s.cc b/storage/innobase/trx/trx0i_s.cc
index b911f2b014b..21bfbe5d92d 100644
--- a/storage/innobase/trx/trx0i_s.cc
+++ b/storage/innobase/trx/trx0i_s.cc
@@ -426,7 +426,21 @@ fill_trx_row(
row->trx_id = trx->id;
row->trx_started = trx->start_time;
- row->trx_state = trx_get_que_state_str(trx);
+ switch (trx->lock.que_state) {
+ case TRX_QUE_RUNNING:
+ row->trx_state = trx->state == TRX_STATE_COMMITTED_IN_MEMORY
+ ? "COMMITTING" : "RUNNING";
+ break;
+ case TRX_QUE_LOCK_WAIT:
+ row->trx_state = "LOCK WAIT";
+ break;
+ case TRX_QUE_ROLLING_BACK:
+ row->trx_state = "ROLLING BACK";
+ break;
+ default:
+ row->trx_state = nullptr;
+ }
+
row->requested_lock_row = requested_lock_row;
ut_ad(requested_lock_row == NULL
|| i_s_locks_row_validate(requested_lock_row));
diff --git a/storage/innobase/trx/trx0purge.cc b/storage/innobase/trx/trx0purge.cc
index 20f6d230690..9fbb90c3bd6 100644
--- a/storage/innobase/trx/trx0purge.cc
+++ b/storage/innobase/trx/trx0purge.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2020, MariaDB Corporation.
+Copyright (c) 2017, 2021, MariaDB Corporation.
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 the Free Software
@@ -148,8 +148,7 @@ purge_graph_build()
trx->op_info = "purge trx";
mem_heap_t* heap = mem_heap_create(512);
- que_fork_t* fork = que_fork_create(
- NULL, NULL, QUE_FORK_PURGE, heap);
+ que_fork_t* fork = que_fork_create(heap);
fork->trx = trx;
for (auto i = innodb_purge_threads_MAX; i; i--) {
diff --git a/storage/innobase/trx/trx0roll.cc b/storage/innobase/trx/trx0roll.cc
index cf51f871d05..73f2bbd7372 100644
--- a/storage/innobase/trx/trx0roll.cc
+++ b/storage/innobase/trx/trx0roll.cc
@@ -604,7 +604,7 @@ trx_rollback_active(
heap = mem_heap_create(512);
- fork = que_fork_create(NULL, NULL, QUE_FORK_RECOVERY, heap);
+ fork = que_fork_create(heap);
fork->trx = trx;
thr = que_thr_create(fork, heap, NULL);
@@ -871,7 +871,7 @@ trx_roll_graph_build(
que_thr_t* thr;
heap = mem_heap_create(512);
- fork = que_fork_create(NULL, NULL, QUE_FORK_ROLLBACK, heap);
+ fork = que_fork_create(heap);
fork->trx = trx;
thr = que_thr_create(fork, heap, NULL);
diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc
index b3ba666b92e..7f704634a42 100644
--- a/storage/innobase/trx/trx0trx.cc
+++ b/storage/innobase/trx/trx0trx.cc
@@ -1579,7 +1579,7 @@ trx_commit_or_rollback_prepare(
if (trx->lock.que_state == TRX_QUE_LOCK_WAIT) {
ut_a(trx->lock.wait_thr != NULL);
- trx->lock.wait_thr->state = QUE_THR_SUSPENDED;
+ trx->lock.wait_thr->state = QUE_THR_COMMAND_WAIT;
trx->lock.wait_thr = NULL;
trx->lock.que_state = TRX_QUE_RUNNING;
@@ -1642,7 +1642,6 @@ trx_commit_step(
trx_commit_or_rollback_prepare(trx);
- trx->lock.que_state = TRX_QUE_COMMITTING;
trx->commit();
ut_ad(trx->lock.wait_thr == NULL);
trx->lock.que_state = TRX_QUE_RUNNING;
@@ -1826,8 +1825,6 @@ state_ok:
fputs("LOCK WAIT ", f); break;
case TRX_QUE_ROLLING_BACK:
fputs("ROLLING BACK ", f); break;
- case TRX_QUE_COMMITTING:
- fputs("COMMITTING ", f); break;
default:
fprintf(f, "que state %lu ", (ulong) trx->lock.que_state);
}