[Commits] d09b88fb9: Make treenode::swap_in_place swap the m_owners, too.

psergey sergey at mariadb.com
Tue Nov 26 19:24:11 EET 2019


revision-id: d09b88fb9ee1ebdb13cedf5f6b49bea268188366 (v5.8-1897-gd09b88fb9)
parent(s): 670bbd25c10c47638f41ee7f635a99443d21e937
author: Sergei Petrunia
committer: Sergei Petrunia
timestamp: 2019-11-26 20:24:11 +0300
message:

Make treenode::swap_in_place swap the m_owners, too.

Failure to do so caused random crashes under load.

---
 utilities/transactions/range_locking/locktree/treenode.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/utilities/transactions/range_locking/locktree/treenode.cc b/utilities/transactions/range_locking/locktree/treenode.cc
index 5bf349749..029646d18 100644
--- a/utilities/transactions/range_locking/locktree/treenode.cc
+++ b/utilities/transactions/range_locking/locktree/treenode.cc
@@ -132,6 +132,10 @@ void treenode::swap_in_place(treenode *node1, treenode *node2) {
     bool tmp_is_shared= node1->m_is_shared;
     node1->m_is_shared= node2->m_is_shared;
     node2->m_is_shared= tmp_is_shared;
+
+    auto tmp_m_owners = node1->m_owners;
+    node1->m_owners = node2->m_owners;
+    node2->m_owners = tmp_m_owners;
 }
 
 void treenode::add_shared_owner(TXNID txnid) {


More information about the commits mailing list