MySQL 9.5.0
Source Code Documentation
sync0types.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (c) 1995, 2025, Oracle and/or its affiliates.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License, version 2.0, as published by the
7Free Software Foundation.
8
9This program is designed to work with certain software (including
10but not limited to OpenSSL) that is licensed under separate terms,
11as designated in a particular file or component or in included license
12documentation. The authors of MySQL hereby grant you an additional
13permission to link the program and your derivative works with the
14separately licensed software that they have either included with
15the program or referenced in the documentation.
16
17This program is distributed in the hope that it will be useful, but WITHOUT
18ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
20for more details.
21
22You should have received a copy of the GNU General Public License along with
23this program; if not, write to the Free Software Foundation, Inc.,
2451 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
26*****************************************************************************/
27
28/** @file include/sync0types.h
29 Global types for sync
30
31 Created 9/5/1995 Heikki Tuuri
32 *******************************************************/
33
34#ifndef sync0types_h
35#define sync0types_h
36
37#include <iostream>
38#include <vector>
39
40#include "sync0sync.h"
41#include "univ.i"
42#include "ut0counter.h"
43#include "ut0log.h"
44#include "ut0new.h"
45
46#ifdef UNIV_DEBUG
47/** Set when InnoDB has invoked exit(). */
48extern bool innodb_calling_exit;
49#endif /* UNIV_DEBUG */
50
51#ifdef _WIN32
52/** Native mutex */
53typedef CRITICAL_SECTION sys_mutex_t;
54#else
55/** Native mutex */
56typedef pthread_mutex_t sys_mutex_t;
57#endif /* _WIN32 */
58
59/*
60 LATCHING ORDER WITHIN THE DATABASE
61 ==================================
62
63The mutex or latch in the central memory object, for instance, a rollback
64segment object, must be acquired before acquiring the latch or latches to
65the corresponding file data structure. In the latching order below, these
66file page object latches are placed immediately below the corresponding
67central memory object latch or mutex.
68
69Synchronization object Notes
70---------------------- -----
71
72Dictionary mutex If we have a pointer to a dictionary
73| object, e.g., a table, it can be
74| accessed without reserving the
75| dictionary mutex. We must have a
76| reservation, a memoryfix, to the
77| appropriate table object in this case,
78| and the table must be explicitly
79| released later.
80V
81Dictionary header
82|
83V
84Secondary index tree latch The tree latch protects also all
85| the B-tree non-leaf pages. These
86V can be read with the page only
87Secondary index non-leaf bufferfixed to save CPU time,
88| no s-latch is needed on the page.
89| Modification of a page requires an
90| x-latch on the page, however. If a
91| thread owns an x-latch to the tree,
92| it is allowed to latch non-leaf pages
93| even after it has acquired the fsp
94| latch.
95V
96Secondary index leaf The latch on the secondary index leaf
97| can be kept while accessing the
98| clustered index, to save CPU time.
99V
100Clustered index tree latch To increase concurrency, the tree
101| latch is usually released when the
102| leaf page latch has been acquired.
103V
104Clustered index non-leaf
105|
106V
107Clustered index leaf
108|
109V
110Transaction system header
111|
112V
113Transaction undo mutex The undo log entry must be written
114| before any index page is modified.
115| Transaction undo mutex is for the undo
116| logs the analogue of the tree latch
117| for a B-tree. If a thread has the
118| trx undo mutex reserved, it is allowed
119| to latch the undo log pages in any
120| order, and also after it has acquired
121| the fsp latch.
122V
123Rollback segment mutex The rollback segment mutex must be
124| reserved, if, e.g., a new page must
125| be added to an undo log. The rollback
126| segment and the undo logs in its
127| history list can be seen as an
128| analogue of a B-tree, and the latches
129| reserved similarly, using a version of
130| lock-coupling. If an undo log must be
131| extended by a page when inserting an
132| undo log record, this corresponds to
133| a pessimistic insert in a B-tree.
134V
135Rollback segment header
136|
137V
138Purge system latch
139|
140V
141Undo log pages If a thread owns the trx undo mutex,
142| or for a log in the history list, the
143| rseg mutex, it is allowed to latch
144| undo log pages in any order, and even
145| after it has acquired the fsp latch.
146| If a thread does not have the
147| appropriate mutex, it is allowed to
148| latch only a single undo log page in
149| a mini-transaction.
150V
151File space management latch If a mini-transaction must allocate
152| several file pages, it can do that,
153| because it keeps the x-latch to the
154| file space management in its memo.
155V
156File system pages
157|
158V
159lock_sys_wait_mutex Mutex protecting lock timeout data
160|
161V
162lock_sys->global_sharded_latch Sharded rw-latch protecting lock_sys_t
163|
164V
165lock_sys->table_mutexes Mutexes protecting lock_sys_t table
166| lock queues
167|
168V
169lock_sys->page_mutexes Mutexes protecting lock_sys_t page
170| lock queues
171|
172V
173trx_sys->mutex Mutex protecting trx_sys_t
174|
175V
176Threads mutex Background thread scheduling mutex
177|
178V
179query_thr_mutex Mutex protecting query threads
180|
181V
182trx_mutex Mutex protecting trx_t fields
183|
184V
185Search system mutex
186|
187V
188Buffer pool mutexes
189|
190V
191Log mutex
192|
193Any other latch
194|
195V
196Memory pool mutex */
197
198/** Latching order levels. If you modify these, you have to also update
199LatchDebug internals in sync0debug.cc */
200
203
205
211
213
215
217
219
221
223
233
235
237
239
245
260
274
276
278
284
286
306
309
320
322
324
326
328
330
331 /** Level is varying. Only used with buffer pool page locks, which
332 do not have a fixed level, but instead have their level set after
333 the page is locked; see e.g. ibuf_bitmap_get_map_page(). */
334
336
337 /** This can be used to suppress order checking. */
339
340 /** Maximum level value */
343
344/** Each latch has an ID. This id is used for creating the latch and to look
345up its meta-data. See sync0debug.c. The order does not matter here, but
346alphabetical ordering seems useful */
473
474/** OS mutex, without any policy. It is a thin wrapper around the
475system mutexes. The interface is different from the policy mutexes,
476to ensure that it is called directly and not confused with the
477policy mutexes. */
478struct OSMutex {
479 /** Constructor */
481
482 /** Create the mutex by calling the system functions. */
484 ut_ad(m_freed);
485
486#ifdef _WIN32
487 InitializeCriticalSection((LPCRITICAL_SECTION)&m_mutex);
488#else
489 {
490 int ret = pthread_mutex_init(&m_mutex, nullptr);
491 ut_a(ret == 0);
492 }
493#endif /* _WIN32 */
494
495 ut_d(m_freed = false);
496 }
497
498 /** Destructor */
499 ~OSMutex() = default;
500
501 /** Destroy the mutex */
504#ifdef _WIN32
505 DeleteCriticalSection((LPCRITICAL_SECTION)&m_mutex);
506#else
507 int ret;
508
509 ret = pthread_mutex_destroy(&m_mutex);
510
511 if (ret != 0) {
512#ifdef UNIV_NO_ERR_MSGS
513 ib::error()
514#else
515 ib::error(ER_IB_MSG_1372)
516#endif
517 << "Return value " << ret << " when calling pthread_mutex_destroy().";
518 }
519#endif /* _WIN32 */
520 ut_d(m_freed = true);
521 }
522
523 /** Release the mutex. */
526#ifdef _WIN32
527 LeaveCriticalSection(&m_mutex);
528#else
529 int ret = pthread_mutex_unlock(&m_mutex);
530 ut_a(ret == 0);
531#endif /* _WIN32 */
532 }
533
534 /** Acquire the mutex. */
537#ifdef _WIN32
538 EnterCriticalSection((LPCRITICAL_SECTION)&m_mutex);
539#else
540 int ret = pthread_mutex_lock(&m_mutex);
541 ut_a(ret == 0);
542#endif /* _WIN32 */
543 }
544
545 void lock() { enter(); }
546 void unlock() { exit(); }
547
548 /** @return true if locking succeeded */
551#ifdef _WIN32
552 return (TryEnterCriticalSection(&m_mutex) != 0);
553#else
554 return (pthread_mutex_trylock(&m_mutex) == 0);
555#endif /* _WIN32 */
556 }
557
558 /** Required for os_event_t */
559 operator sys_mutex_t *() UNIV_NOTHROW { return (&m_mutex); }
560
561#if defined(UNIV_LIBRARY) && defined(UNIV_DEBUG)
562 bool is_owned() {
563 /* This should never be reached. This is
564 added to fix is_owned() compilation errors
565 for library. We will never reach here because
566 mutexes are disabled in library. */
567 ut_error;
568 return (false);
569 }
570#endif /* UNIV_LIBRARY && UNIV_DEBUG */
571
572 private:
573#ifdef UNIV_DEBUG
574 /** true if the mutex has been freed/destroyed. */
576#endif /* UNIV_DEBUG */
577
579};
580
581#ifndef UNIV_LIBRARY
582#ifdef UNIV_PFS_MUTEX
583/** Latch element
584Used for mutexes which have PFS keys defined under UNIV_PFS_MUTEX.
585@param[in] id Latch id
586@param[in] level Latch level
587@param[in] key PFS key */
588#define LATCH_ADD_MUTEX(id, level, key) \
589 latch_meta[LATCH_ID_##id] = ut::new_withkey<latch_meta_t>( \
590 UT_NEW_THIS_FILE_PSI_KEY, LATCH_ID_##id, #id, level, #level, key)
591
592#ifdef UNIV_PFS_RWLOCK
593/** Latch element.
594Used for rwlocks which have PFS keys defined under UNIV_PFS_RWLOCK.
595@param[in] id Latch id
596@param[in] level Latch level
597@param[in] key PFS key */
598#define LATCH_ADD_RWLOCK(id, level, key) \
599 latch_meta[LATCH_ID_##id] = ut::new_withkey<latch_meta_t>( \
600 UT_NEW_THIS_FILE_PSI_KEY, LATCH_ID_##id, #id, level, #level, key)
601#else
602#define LATCH_ADD_RWLOCK(id, level, key) \
603 latch_meta[LATCH_ID_##id] = \
604 ut::new_withkey<latch_meta_t>(UT_NEW_THIS_FILE_PSI_KEY, LATCH_ID_##id, \
605 #id, level, #level, PSI_NOT_INSTRUMENTED)
606#endif /* UNIV_PFS_RWLOCK */
607
608#else
609#define LATCH_ADD_MUTEX(id, level, key) \
610 latch_meta[LATCH_ID_##id] = ut::new_withkey<latch_meta_t>( \
611 UT_NEW_THIS_FILE_PSI_KEY, LATCH_ID_##id, #id, level, #level)
612#define LATCH_ADD_RWLOCK(id, level, key) \
613 latch_meta[LATCH_ID_##id] = ut::new_withkey<latch_meta_t>( \
614 UT_NEW_THIS_FILE_PSI_KEY, LATCH_ID_##id, #id, level, #level)
615#endif /* UNIV_PFS_MUTEX */
616
617/** Default latch counter */
619 public:
620 /** The counts we collect for a mutex */
621 struct Count {
622 /** Constructor */
624 /* No op */
625 }
626
627 /** Rest the values to zero */
629 m_spins = 0;
630 m_waits = 0;
631 m_calls = 0;
632 }
633
634 /** Number of spins trying to acquire the latch. */
635 uint32_t m_spins;
636
637 /** Number of waits trying to acquire the latch */
638 uint32_t m_waits;
639
640 /** Number of times it was called */
641 uint32_t m_calls;
642
643 /** true if enabled */
645 };
646
647 /** Constructor */
649
650 /** Destructor */
653
654 for (Count *count : m_counters) {
656 }
657 }
658
659 /** Reset all counters to zero. It is not protected by any
660 mutex and we don't care about atomicity. Unless it is a
661 demonstrated problem. The information collected is not
662 required for the correct functioning of the server. */
664 m_mutex.enter();
665
666 for (Count *count : m_counters) {
667 count->reset();
668 }
669
670 m_mutex.exit();
671 }
672
673 /** @return the aggregate counter */
675 m_mutex.enter();
676
677 Count *count;
678
679 if (m_counters.empty()) {
680 count = ut::new_withkey<Count>(UT_NEW_THIS_FILE_PSI_KEY);
681 m_counters.push_back(count);
682 } else {
683 ut_a(m_counters.size() == 1);
684 count = m_counters[0];
685 }
686
687 m_mutex.exit();
688
689 return (count);
690 }
691
692 /** Deregister the count. We don't do anything
693 @param[in] count The count instance to deregister */
695 [[maybe_unused]]) const UNIV_NOTHROW { /* Do nothing */
696 }
697
698 /** Register a single instance counter */
700 m_mutex.enter();
701
702 m_counters.push_back(count);
703
704 m_mutex.exit();
705 }
706
707 /** Deregister a single instance counter
708 @param[in] count The count instance to deregister */
710 m_mutex.enter();
711
712 m_counters.erase(std::remove(m_counters.begin(), m_counters.end(), count),
713 m_counters.end());
714
715 m_mutex.exit();
716 }
717
718 /** Iterate over the counters */
719 template <typename Callback>
720 void iterate(Callback &&callback) const UNIV_NOTHROW {
721 m_mutex.enter();
722 for (const Count *count : m_counters) {
723 std::forward<Callback>(callback)(count);
724 }
725 m_mutex.exit();
726 }
727
728 /** Disable the monitoring */
730 m_mutex.enter();
731
732 for (Count *count : m_counters) {
733 count->m_enabled = true;
734 }
735
736 m_active = true;
737
738 m_mutex.exit();
739 }
740
741 /** Disable the monitoring */
743 m_mutex.enter();
744
745 for (Count *count : m_counters) {
746 count->m_enabled = false;
747 }
748
749 m_active = false;
750
751 m_mutex.exit();
752 }
753
754 /** @return if monitoring is active */
755 bool is_enabled() const UNIV_NOTHROW { return (m_active); }
756
757 private:
758 /* Disable copying */
761
762 private:
763 typedef OSMutex Mutex;
764 typedef std::vector<Count *> Counters;
765
766 /** Mutex protecting m_counters */
767 mutable Mutex m_mutex;
768
769 /** Counters for the latches */
771
772 /** if true then we collect the data */
774};
775
776/** Latch meta data */
777template <typename Counter = LatchCounter>
779 public:
781
782#ifdef UNIV_PFS_MUTEX
784#endif /* UNIV_PFS_MUTEX */
785
786 /** Constructor */
789 m_name(),
792#ifdef UNIV_PFS_MUTEX
793 ,
794 m_pfs_key()
795#endif /* UNIV_PFS_MUTEX */
796 {
797 }
798
799 /** Destructor */
800 ~LatchMeta() = default;
801
802 /** Constructor
803 @param[in] id Latch id
804 @param[in] name Latch name
805 @param[in] level Latch level
806 @param[in] level_name Latch level text representation
807 @param[in] key PFS key */
808 LatchMeta(latch_id_t id, const char *name, latch_level_t level,
809 const char *level_name
810#ifdef UNIV_PFS_MUTEX
811 ,
813#endif /* UNIV_PFS_MUTEX */
814 )
815 : m_id(id),
816 m_name(name),
817 m_level(level),
818 m_level_name(level_name)
819#ifdef UNIV_PFS_MUTEX
820 ,
822#endif /* UNIV_PFS_MUTEX */
823 {
824 /* No op */
825 }
826
827 /* Less than operator.
828 @param[in] rhs Instance to compare against
829 @return true if this.get_id() < rhs.get_id() */
830 bool operator<(const LatchMeta &rhs) const {
831 return (get_id() < rhs.get_id());
832 }
833
834 /** @return the latch id */
835 latch_id_t get_id() const { return (m_id); }
836
837 /** @return the latch name */
838 const char *get_name() const { return (m_name); }
839
840 /** @return the latch level */
841 latch_level_t get_level() const { return (m_level); }
842
843 /** @return the latch level name */
844 const char *get_level_name() const { return (m_level_name); }
845
846#ifdef UNIV_PFS_MUTEX
847 /** @return the PFS key for the latch */
848 pfs_key_t get_pfs_key() const { return (m_pfs_key); }
849#endif /* UNIV_PFS_MUTEX */
850
851 /** @return the counter instance */
852 Counter *get_counter() { return (&m_counter); }
853
854 private:
855 /** Latch id */
857
858 /** Latch name */
859 const char *m_name;
860
861 /** Latch level in the ordering */
863
864 /** Latch level text representation */
865 const char *m_level_name;
866
867#ifdef UNIV_PFS_MUTEX
868 /** PFS key */
870#endif /* UNIV_PFS_MUTEX */
871
872 /** For gathering latch statistics */
874};
875
877typedef std::vector<latch_meta_t *, ut::allocator<latch_meta_t *>>
879
880/** Note: This is accessed without any mutex protection. It is initialised
881at startup and elements should not be added to or removed from it after
882that. See sync_latch_meta_init() */
884
885/** Get the latch meta-data from the latch ID
886@param[in] id Latch ID
887@return the latch meta data */
889 ut_ad(static_cast<size_t>(id) < latch_meta.size());
890 ut_ad(id == latch_meta[id]->get_id());
891
892 return (*latch_meta[id]);
893}
894
895/** Fetch the counter for the latch
896@param[in] id Latch ID
897@return the latch counter */
900
901 return (meta.get_counter());
902}
903
904/** Get the latch name from the latch ID
905@param[in] id Latch ID
906@return the name, will assert if not found */
907inline const char *sync_latch_get_name(latch_id_t id) {
908 const latch_meta_t &meta = sync_latch_get_meta(id);
909
910 return (meta.get_name());
911}
912
913/** Get the latch ordering level
914@param[in] id Latch id to lookup
915@return the latch level */
917 const latch_meta_t &meta = sync_latch_get_meta(id);
918
919 return (meta.get_level());
920}
921
922#ifdef UNIV_PFS_MUTEX
923/** Get the latch PFS key from the latch ID
924@param[in] id Latch ID
925@return the PFS key */
927 const latch_meta_t &meta = sync_latch_get_meta(id);
928
929 return (meta.get_pfs_key());
930}
931#endif /* UNIV_PFS_MUTEX */
932
933#ifndef UNIV_HOTBACKUP
934/** String representation of the filename and line number where the
935latch was created
936@param[in] id Latch ID
937@param[in] created Filename and line number where it was created
938@return the string representation */
939std::string sync_mutex_to_string(latch_id_t id, const std::string &created);
940
941/** Print the filename "basename"
942@return the basename */
943const char *sync_basename(const char *filename);
944#endif /* !UNIV_HOTBACKUP */
945
946/** Register a latch, called when it is created
947@param[in] ptr Latch instance that was created
948@param[in] filename Filename where it was created
949@param[in] line Line number in filename */
950void sync_file_created_register(const void *ptr, const char *filename,
951 uint16_t line);
952
953/** Deregister a latch, called when it is destroyed
954@param[in] ptr Latch to be destroyed */
955void sync_file_created_deregister(const void *ptr);
956
957/** Get the string where the file was created. Its format is "name:line"
958@param[in] ptr Latch instance
959@return created information or "" if can't be found */
960std::string sync_file_created_get(const void *ptr);
961
962#endif /* !UNIV_LIBRARY */
963
964#ifdef UNIV_DEBUG
965
966/** All (ordered) latches, used in debugging, must derive from this class. */
967struct latch_t {
968 /** Constructor
969 @param[in] id The latch ID */
971 m_rw_lock(),
972 m_temp_fsp() {}
973
974 latch_t &operator=(const latch_t &) = default;
975
976 /** Destructor */
977 virtual ~latch_t() UNIV_NOTHROW = default;
978
979 /** @return the latch ID */
980 latch_id_t get_id() const { return (m_id); }
981
982 /** @return true if it is a rw-lock */
983 bool is_rw_lock() const UNIV_NOTHROW { return (m_rw_lock); }
984
985 /** Print the latch context
986 @return the string representation */
987 virtual std::string to_string() const = 0;
988
989 /** @return "filename:line" from where the latch was last locked */
990 virtual std::string locked_from() const = 0;
991
992 /** @return the latch level */
995
996#ifndef UNIV_LIBRARY
997 return (sync_latch_get_level(m_id));
998#else
999 /* This should never be reached. This is
1000 added to fix compilation errors
1001 for library. We will never reach here because
1002 mutexes are disabled in library. */
1003 ut_error;
1004 return (SYNC_UNKNOWN);
1005#endif /* !UNIV_LIBRARY */
1006 }
1007
1008 /** @return true if the latch is for a temporary file space*/
1009 bool is_temp_fsp() const UNIV_NOTHROW { return (m_temp_fsp); }
1010
1011 /** Set the temporary tablespace flag. The latch order constraints
1012 are different for intrinsic tables. We don't always acquire the
1013 index->lock. We need to figure out the context and add some special
1014 rules during the checks. */
1017 m_temp_fsp = true;
1018 }
1019
1020 /** @return the latch name, m_id must be set */
1021 const char *get_name() const UNIV_NOTHROW {
1023
1024#ifndef UNIV_LIBRARY
1025 return (sync_latch_get_name(m_id));
1026#else
1027 /* This should never be reached. This is
1028 added to fix compilation errors
1029 for library. We will never reach here because
1030 mutexes are disabled in library. */
1031 ut_error;
1032 return (nullptr);
1033#endif /* !UNIV_LIBRARY */
1034 }
1035
1036 /** Latch ID */
1038
1039 /** true if it is a rw-lock. In debug mode, rw_lock_t derives from
1040 this class and sets this variable. */
1042
1043 /** true if it is an temporary space latch */
1045};
1046
1047/** Subclass this to iterate over a thread's acquired latch levels. */
1049 virtual ~sync_check_functor_t() = default;
1050 virtual bool operator()(const latch_level_t) = 0;
1051 virtual bool result() const = 0;
1052};
1053
1054/** Functor to check whether the calling thread owns the btr search mutex. */
1056 /** Constructor
1057 @param[in] has_search_latch true if owns the latch */
1058 explicit btrsea_sync_check(bool has_search_latch)
1059 : m_result(), m_has_search_latch(has_search_latch) {}
1060
1061 /** Destructor */
1062 ~btrsea_sync_check() override = default;
1063
1064 /** Called for every latch owned by the calling thread.
1065 @param[in] level Level of the existing latch
1066 @return true if the predicate check fails */
1067 bool operator()(const latch_level_t level) override {
1068 /* If calling thread doesn't hold search latch then
1069 check if there are latch level exception provided.
1070
1071 Note: Optimizer has added InnoDB intrinsic table as an
1072 alternative to MyISAM intrinsic table. With this a new
1073 control flow comes into existence, it is:
1074
1075 Server -> Plugin -> SE
1076
1077 Plugin in this case is I_S which is sharing the latch vector
1078 of InnoDB and so there could be lock conflicts. Ideally
1079 the Plugin should use a difference namespace latch vector
1080 as it doesn't have any dependency with SE latching protocol.
1081
1082 Added check that will allow thread to hold I_S latches */
1083
1084 if (!m_has_search_latch &&
1085 (level != SYNC_SEARCH_SYS && level != SYNC_DICT &&
1086 level != SYNC_FTS_CACHE && level != SYNC_UNDO_DDL &&
1087 level != SYNC_DICT_OPERATION && level != SYNC_TRX_I_S_LAST_READ &&
1088 level != SYNC_TRX_I_S_RWLOCK)) {
1089 m_result = true;
1090#ifdef UNIV_NO_ERR_MSGS
1091 ib::error()
1092#else
1093 ib::error(ER_IB_MSG_1373)
1094#endif
1095 << "Debug: Calling thread does not hold search "
1096 "latch but does hold latch level "
1097 << level << ".";
1098
1099 return (m_result);
1100 }
1101
1102 return (false);
1103 }
1104
1105 /** @return result from the check */
1106 bool result() const override { return (m_result); }
1107
1108 private:
1109 /** True if all OK */
1111
1112 /** If the caller owns the search latch */
1114};
1115
1116/** Functor to check for dictionary latching constraints. */
1118 /** Constructor
1119 @param[in] dict_mutex_allowed true if the dict mutex
1120 is allowed */
1121 explicit dict_sync_check(bool dict_mutex_allowed)
1122 : m_result(), m_dict_mutex_allowed(dict_mutex_allowed) {}
1123
1124 /** Destructor */
1125 ~dict_sync_check() override = default;
1126
1127 /** Check the latching constraints
1128 @param[in] level The level held by the thread */
1129 bool operator()(const latch_level_t level) override {
1130 if (!m_dict_mutex_allowed ||
1131 (level != SYNC_DICT && level != SYNC_UNDO_SPACES &&
1132 level != SYNC_FTS_CACHE && level != SYNC_DICT_OPERATION &&
1133 /* This only happens in recv_apply_hashed_log_recs. */
1134 level != SYNC_RECV_WRITER && level != SYNC_NO_ORDER_CHECK)) {
1135 m_result = true;
1136#ifdef UNIV_NO_ERR_MSGS
1137 ib::error()
1138#else
1139 ib::error(ER_IB_MSG_1374)
1140#endif
1141 << "Debug: Dictionary latch order violation for level " << level
1142 << ".";
1143
1144 return (true);
1145 }
1146
1147 return (false);
1148 }
1149
1150 /** @return the result of the check */
1151 virtual bool result() const override { return (m_result); }
1152
1153 private:
1154 /** True if all OK */
1156
1157 /** True if it is OK to hold the dict mutex */
1159};
1160
1161/** Functor to check for given latching constraints. */
1163 /** Constructor
1164 @param[in] from first element in an array of latch_level_t
1165 @param[in] to last element in an array of latch_level_t */
1167 : m_result(), m_latches(from, to) {}
1168
1169 /** Default constructor. The list of allowed latches is empty. */
1171
1172 /** Check whether the given latch_t violates the latch constraint.
1173 This object maintains a list of allowed latch levels, and if the given
1174 latch belongs to a latch level that is not there in the allowed list,
1175 then it is a violation.
1176
1177 @param[in] level The latch level to check
1178 @return true if there is a latch ordering violation */
1179 virtual bool operator()(const latch_level_t level) override {
1180 for (latch_level_t allowed_level : m_latches) {
1181 if (level == allowed_level) {
1182 m_result = false;
1183
1184 /* No violation */
1185 return (m_result);
1186 }
1187 }
1188
1189#ifdef UNIV_NO_ERR_MSGS
1190 ib::error()
1191#else
1192 ib::error(ER_IB_MSG_1375)
1193#endif
1194 << "Debug: sync_allowed_latches violation for level=" << level;
1195 m_result = true;
1196 return (m_result);
1197 }
1198
1199 /** @return the result of the check */
1200 virtual bool result() const override { return (m_result); }
1201
1202 private:
1203 /** Save the result of validation check here
1204 True if all OK */
1206
1207 typedef std::vector<latch_level_t, ut::allocator<latch_level_t>> latches_t;
1208
1209 /** List of latch levels that are allowed to be held */
1211};
1212
1214
1215/* Flags to specify lock types for rw_lock_own_flagged() */
1219 RW_LOCK_FLAG_SX = 1 << 2
1221
1222#endif /* UNIV_DBEUG */
1223
1224#endif /* sync0types_h */
Class that stores callback function reference as well as the result of the callback function call (in...
Definition: keyring_service.cc:44
Default latch counter.
Definition: sync0types.h:618
LatchCounter(const LatchCounter &)
bool is_enabled() const 1
Definition: sync0types.h:755
void single_deregister(Count *count) 1
Deregister a single instance counter.
Definition: sync0types.h:709
Counters m_counters
Counters for the latches.
Definition: sync0types.h:770
LatchCounter() 1
Constructor.
Definition: sync0types.h:648
void sum_deregister(Count *count) const 1
Deregister the count.
Definition: sync0types.h:694
void iterate(Callback &&callback) const 1
Iterate over the counters.
Definition: sync0types.h:720
Mutex m_mutex
Mutex protecting m_counters.
Definition: sync0types.h:767
void disable() 1
Disable the monitoring.
Definition: sync0types.h:742
LatchCounter & operator=(const LatchCounter &)
OSMutex Mutex
Definition: sync0types.h:763
~LatchCounter() 1
Destructor.
Definition: sync0types.h:651
bool m_active
if true then we collect the data
Definition: sync0types.h:773
void single_register(Count *count) 1
Register a single instance counter.
Definition: sync0types.h:699
std::vector< Count * > Counters
Definition: sync0types.h:764
void enable() 1
Disable the monitoring.
Definition: sync0types.h:729
void reset() 1
Reset all counters to zero.
Definition: sync0types.h:663
Count * sum_register() 1
Definition: sync0types.h:674
Latch meta data.
Definition: sync0types.h:778
const char * get_level_name() const
Definition: sync0types.h:844
bool operator<(const LatchMeta &rhs) const
Definition: sync0types.h:830
mysql_pfs_key_t pfs_key_t
Definition: sync0types.h:783
Counter * get_counter()
Definition: sync0types.h:852
Counter CounterType
Definition: sync0types.h:780
pfs_key_t get_pfs_key() const
Definition: sync0types.h:848
latch_level_t m_level
Latch level in the ordering.
Definition: sync0types.h:862
pfs_key_t m_pfs_key
PFS key.
Definition: sync0types.h:869
latch_level_t get_level() const
Definition: sync0types.h:841
Counter m_counter
For gathering latch statistics.
Definition: sync0types.h:873
latch_id_t m_id
Latch id.
Definition: sync0types.h:856
~LatchMeta()=default
Destructor.
const char * get_name() const
Definition: sync0types.h:838
latch_id_t get_id() const
Definition: sync0types.h:835
LatchMeta(latch_id_t id, const char *name, latch_level_t level, const char *level_name, pfs_key_t key)
Constructor.
Definition: sync0types.h:808
LatchMeta()
Constructor.
Definition: sync0types.h:787
const char * m_level_name
Latch level text representation.
Definition: sync0types.h:865
const char * m_name
Latch name.
Definition: sync0types.h:859
The class error is used to emit error messages.
Definition: ut0log.h:231
static int count
Definition: myisam_ftdump.cc:45
Sharded atomic counter.
Definition: ut0counter.h:221
static mysql_service_status_t remove(reference_caching_channel channel, const char *implementation_name) noexcept
Definition: component.cc:137
pid_type get_id()
Definition: process.h:48
void delete_(T *ptr) noexcept
Releases storage which has been dynamically allocated through any of the ut::new*() variants.
Definition: ut0new.h:811
const char * filename
Definition: pfs_example_component_population.cc:67
required string key
Definition: replication_asynchronous_connection_failover.proto:60
case opt name
Definition: sslopt-case.h:29
The counts we collect for a mutex.
Definition: sync0types.h:621
uint32_t m_spins
Number of spins trying to acquire the latch.
Definition: sync0types.h:635
void reset() 1
Rest the values to zero.
Definition: sync0types.h:628
uint32_t m_calls
Number of times it was called.
Definition: sync0types.h:641
Count() 1
Constructor.
Definition: sync0types.h:623
uint32_t m_waits
Number of waits trying to acquire the latch.
Definition: sync0types.h:638
bool m_enabled
true if enabled
Definition: sync0types.h:644
OS mutex, without any policy.
Definition: sync0types.h:478
void exit() 1
Release the mutex.
Definition: sync0types.h:524
OSMutex() 1
Constructor.
Definition: sync0types.h:480
bool try_lock() 1
Definition: sync0types.h:549
void enter() 1
Acquire the mutex.
Definition: sync0types.h:535
sys_mutex_t m_mutex
Definition: sync0types.h:578
~OSMutex()=default
Destructor.
void lock()
Definition: sync0types.h:545
bool m_freed
true if the mutex has been freed/destroyed.
Definition: sync0types.h:575
void init() 1
Create the mutex by calling the system functions.
Definition: sync0types.h:483
void unlock()
Definition: sync0types.h:546
void destroy() 1
Destroy the mutex.
Definition: sync0types.h:502
Functor to check whether the calling thread owns the btr search mutex.
Definition: sync0types.h:1055
const bool m_has_search_latch
If the caller owns the search latch.
Definition: sync0types.h:1113
btrsea_sync_check(bool has_search_latch)
Constructor.
Definition: sync0types.h:1058
bool m_result
True if all OK.
Definition: sync0types.h:1110
bool operator()(const latch_level_t level) override
Called for every latch owned by the calling thread.
Definition: sync0types.h:1067
~btrsea_sync_check() override=default
Destructor.
bool result() const override
Definition: sync0types.h:1106
Functor to check for dictionary latching constraints.
Definition: sync0types.h:1117
dict_sync_check(bool dict_mutex_allowed)
Constructor.
Definition: sync0types.h:1121
const bool m_dict_mutex_allowed
True if it is OK to hold the dict mutex.
Definition: sync0types.h:1158
bool m_result
True if all OK.
Definition: sync0types.h:1155
bool operator()(const latch_level_t level) override
Check the latching constraints.
Definition: sync0types.h:1129
~dict_sync_check() override=default
Destructor.
virtual bool result() const override
Definition: sync0types.h:1151
All (ordered) latches, used in debugging, must derive from this class.
Definition: sync0types.h:967
latch_level_t get_level() const 1
Definition: sync0types.h:993
bool is_rw_lock() const 1
Definition: sync0types.h:983
bool m_temp_fsp
true if it is an temporary space latch
Definition: sync0types.h:1044
latch_id_t m_id
Latch ID.
Definition: sync0types.h:1037
virtual ~latch_t() 1=default
Destructor.
void set_temp_fsp() 1
Set the temporary tablespace flag.
Definition: sync0types.h:1015
latch_t & operator=(const latch_t &)=default
bool is_temp_fsp() const 1
Definition: sync0types.h:1009
virtual std::string locked_from() const =0
bool m_rw_lock
true if it is a rw-lock.
Definition: sync0types.h:1041
latch_id_t get_id() const
Definition: sync0types.h:980
virtual std::string to_string() const =0
Print the latch context.
latch_t(latch_id_t id=LATCH_ID_NONE) 1
Constructor.
Definition: sync0types.h:970
const char * get_name() const 1
Definition: sync0types.h:1021
Define for performance schema registration key.
Definition: sync0sync.h:51
Functor to check for given latching constraints.
Definition: sync0types.h:1162
virtual bool result() const override
Definition: sync0types.h:1200
std::vector< latch_level_t, ut::allocator< latch_level_t > > latches_t
Definition: sync0types.h:1207
bool m_result
Save the result of validation check here True if all OK.
Definition: sync0types.h:1205
sync_allowed_latches(const latch_level_t *from, const latch_level_t *to)
Constructor.
Definition: sync0types.h:1166
latches_t m_latches
List of latch levels that are allowed to be held.
Definition: sync0types.h:1210
sync_allowed_latches()
Default constructor.
Definition: sync0types.h:1170
virtual bool operator()(const latch_level_t level) override
Check whether the given latch_t violates the latch constraint.
Definition: sync0types.h:1179
Subclass this to iterate over a thread's acquired latch levels.
Definition: sync0types.h:1048
virtual bool operator()(const latch_level_t)=0
virtual bool result() const =0
virtual ~sync_check_functor_t()=default
Mutex, the basic synchronization primitive.
LatchMetaData latch_meta
Note: This is accessed without any mutex protection.
Definition: sync0debug.cc:1195
pthread_mutex_t sys_mutex_t
Native mutex.
Definition: sync0types.h:56
LatchMeta< LatchCounter > latch_meta_t
Definition: sync0types.h:876
std::string sync_mutex_to_string(latch_id_t id, const std::string &created)
String representation of the filename and line number where the latch was created.
Definition: sync0sync.cc:236
latch_level_t sync_latch_get_level(latch_id_t id)
Get the latch ordering level.
Definition: sync0types.h:916
const char * sync_latch_get_name(latch_id_t id)
Get the latch name from the latch ID.
Definition: sync0types.h:907
std::vector< latch_meta_t *, ut::allocator< latch_meta_t * > > LatchMetaData
Definition: sync0types.h:878
void sync_file_created_register(const void *ptr, const char *filename, uint16_t line)
Register a latch, called when it is created.
Definition: sync0debug.cc:1651
latch_meta_t & sync_latch_get_meta(latch_id_t id)
Get the latch meta-data from the latch ID.
Definition: sync0types.h:888
latch_id_t
Each latch has an ID.
Definition: sync0types.h:347
@ LATCH_ID_LOG_SN_MUTEX
Definition: sync0types.h:384
@ LATCH_ID_LOG_WRITE_NOTIFIER
Definition: sync0types.h:389
@ LATCH_ID_DBLR
Definition: sync0types.h:467
@ LATCH_ID_DICT_TABLE
Definition: sync0types.h:366
@ LATCH_ID_FILE_OPEN
Definition: sync0types.h:462
@ LATCH_ID_SRV_INNODB_MONITOR
Definition: sync0types.h:416
@ LATCH_ID_LOG_CHECKPOINTER
Definition: sync0types.h:385
@ LATCH_ID_RTR_SSN_MUTEX
Definition: sync0types.h:411
@ LATCH_ID_WORK_QUEUE
Definition: sync0types.h:440
@ LATCH_ID_CLONE_TASK
Definition: sync0types.h:464
@ LATCH_ID_TRX_POOL_MANAGER
Definition: sync0types.h:422
@ LATCH_ID_LOG_WRITER
Definition: sync0types.h:387
@ LATCH_ID_BUF_POOL_ZIP
Definition: sync0types.h:354
@ LATCH_ID_LOCK_FREE_HASH
Definition: sync0types.h:378
@ LATCH_ID_FTS_DOC_ID
Definition: sync0types.h:372
@ LATCH_ID_LOG_LIMITS
Definition: sync0types.h:391
@ LATCH_ID_DBLWR_SPACE_CACHE
Definition: sync0types.h:361
@ LATCH_ID_TEST_MUTEX
Definition: sync0types.h:470
@ LATCH_ID_BUF_POOL_ZIP_HASH
Definition: sync0types.h:358
@ LATCH_ID_LOCK_SYS_PAGE
Definition: sync0types.h:380
@ LATCH_ID_LOG_SN
Definition: sync0types.h:383
@ LATCH_ID_TRX
Definition: sync0types.h:424
@ LATCH_ID_FLUSH_LIST
Definition: sync0types.h:368
@ LATCH_ID_EVENT_MANAGER
Definition: sync0types.h:431
@ LATCH_ID_TEMP_SPACE_RSEG
Definition: sync0types.h:408
@ LATCH_ID_UNDO_SPACE_RSEG
Definition: sync0types.h:409
@ LATCH_ID_BUF_CHUNK_MAP_LATCH
Definition: sync0types.h:459
@ LATCH_ID_DICT_PERSIST_CHECKPOINT
Definition: sync0types.h:402
@ LATCH_ID_LOCK_SYS_GLOBAL
Definition: sync0types.h:379
@ LATCH_ID_LOG_ARCH
Definition: sync0types.h:395
@ LATCH_ID_DICT_PERSIST_DIRTY_TABLES
Definition: sync0types.h:400
@ LATCH_ID_RW_LOCK_LIST
Definition: sync0types.h:415
@ LATCH_ID_IBUF_BITMAP
Definition: sync0types.h:375
@ LATCH_ID_RECV_SYS
Definition: sync0types.h:406
@ LATCH_ID_DICT_TABLE_STATS
Definition: sync0types.h:456
@ LATCH_ID_FTS_CACHE
Definition: sync0types.h:450
@ LATCH_ID_IBUF_INDEX_TREE
Definition: sync0types.h:454
@ LATCH_ID_DICT_FOREIGN_ERR
Definition: sync0types.h:364
@ LATCH_ID_PERSIST_AUTOINC
Definition: sync0types.h:401
@ LATCH_ID_UNDO_SPACES
Definition: sync0types.h:447
@ LATCH_ID_LOG_FILES
Definition: sync0types.h:392
@ LATCH_ID_FTS_OPTIMIZE
Definition: sync0types.h:371
@ LATCH_ID_RTR_ACTIVE_MUTEX
Definition: sync0types.h:412
@ LATCH_ID_PURGE_SYS_PQ
Definition: sync0types.h:404
@ LATCH_ID_MASTER_KEY_ID_MUTEX
Definition: sync0types.h:461
@ LATCH_ID_PAGE_ARCH
Definition: sync0types.h:396
@ LATCH_ID_RW_LOCK_DEBUG
Definition: sync0types.h:410
@ LATCH_ID_IBUF_PESSIMISTIC_INSERT
Definition: sync0types.h:377
@ LATCH_ID_TRX_SYS
Definition: sync0types.h:425
@ LATCH_ID_AHI_ENABLED
Definition: sync0types.h:349
@ LATCH_ID_FIL_SHARD
Definition: sync0types.h:367
@ LATCH_ID_OS_AIO_WRITE_MUTEX
Definition: sync0types.h:436
@ LATCH_ID_TRX_UNDO
Definition: sync0types.h:420
@ LATCH_ID_TRX_I_S_CACHE
Definition: sync0types.h:452
@ LATCH_ID_UNDO_DDL
Definition: sync0types.h:448
@ LATCH_ID_BTR_SEARCH
Definition: sync0types.h:441
@ LATCH_ID_HASH_TABLE_MUTEX
Definition: sync0types.h:374
@ LATCH_ID_PAGE_ARCH_CLIENT
Definition: sync0types.h:398
@ LATCH_ID_ROW_DROP_LIST
Definition: sync0types.h:438
@ LATCH_ID_RECV_WRITER
Definition: sync0types.h:407
@ LATCH_ID_CLONE_SNAPSHOT
Definition: sync0types.h:465
@ LATCH_ID_TRX_PURGE
Definition: sync0types.h:453
@ LATCH_ID_TRX_POOL
Definition: sync0types.h:421
@ LATCH_ID_INDEX_TREE
Definition: sync0types.h:455
@ LATCH_ID_RTR_MATCH_MUTEX
Definition: sync0types.h:413
@ LATCH_ID_BUF_BLOCK_DEBUG
Definition: sync0types.h:443
@ LATCH_ID_MAX
Definition: sync0types.h:471
@ LATCH_ID_SRV_MISC_TMPFILE
Definition: sync0types.h:417
@ LATCH_ID_ALTER_STAGE
Definition: sync0types.h:350
@ LATCH_ID_TRX_SYS_SERIALISATION
Definition: sync0types.h:427
@ LATCH_ID_BUF_POOL_CHUNKS
Definition: sync0types.h:353
@ LATCH_ID_HASH_TABLE_RW_LOCK
Definition: sync0types.h:458
@ LATCH_ID_CACHE_LAST_READ
Definition: sync0types.h:363
@ LATCH_ID_BUF_POOL_ZIP_FREE
Definition: sync0types.h:357
@ LATCH_ID_LOG_FLUSHER
Definition: sync0types.h:388
@ LATCH_ID_CLONE_SYS
Definition: sync0types.h:463
@ LATCH_ID_OS_AIO_IBUF_MUTEX
Definition: sync0types.h:437
@ LATCH_ID_PAGE_ARCH_OPER
Definition: sync0types.h:397
@ LATCH_ID_FTS_BG_THREADS
Definition: sync0types.h:369
@ LATCH_ID_SRV_SYS_TASKS
Definition: sync0types.h:429
@ LATCH_ID_RECALC_POOL
Definition: sync0types.h:405
@ LATCH_ID_LOCK_SYS_WAIT
Definition: sync0types.h:382
@ LATCH_ID_DICT_TABLE_STATS_COMPUTE
Definition: sync0types.h:457
@ LATCH_ID_SYNC_DEBUG_MUTEX
Definition: sync0types.h:460
@ LATCH_ID_PARSER
Definition: sync0types.h:394
@ LATCH_ID_DBLWR
Definition: sync0types.h:360
@ LATCH_ID_LOG_CLOSER
Definition: sync0types.h:386
@ LATCH_ID_CHECKPOINT
Definition: sync0types.h:445
@ LATCH_ID_INDEX_ONLINE_LOG
Definition: sync0types.h:439
@ LATCH_ID_BUF_BLOCK_MUTEX
Definition: sync0types.h:352
@ LATCH_ID_FTS_DELETE
Definition: sync0types.h:370
@ LATCH_ID_DICT_OPERATION
Definition: sync0types.h:444
@ LATCH_ID_AUTOINC
Definition: sync0types.h:351
@ LATCH_ID_REDO_LOG_ARCHIVE_QUEUE_MUTEX
Definition: sync0types.h:469
@ LATCH_ID_LOG_GOVERNOR_MUTEX
Definition: sync0types.h:393
@ LATCH_ID_NONE
Definition: sync0types.h:348
@ LATCH_ID_LOG_FLUSH_NOTIFIER
Definition: sync0types.h:390
@ LATCH_ID_SYNC_THREAD
Definition: sync0types.h:419
@ LATCH_ID_IBUF
Definition: sync0types.h:376
@ LATCH_ID_LOCK_SYS_TABLE
Definition: sync0types.h:381
@ LATCH_ID_FTS_CACHE_INIT
Definition: sync0types.h:451
@ LATCH_ID_OS_AIO_READ_MUTEX
Definition: sync0types.h:435
@ LATCH_ID_BUF_BLOCK_LOCK
Definition: sync0types.h:442
@ LATCH_ID_FTS_PLL_TOKENIZE
Definition: sync0types.h:373
@ LATCH_ID_FIL_SPACE
Definition: sync0types.h:449
@ LATCH_ID_TEMP_POOL_MANAGER
Definition: sync0types.h:423
@ LATCH_ID_BUF_POOL_LRU_LIST
Definition: sync0types.h:355
@ LATCH_ID_DICT_SYS
Definition: sync0types.h:365
@ LATCH_ID_SYNC_ARRAY_MUTEX
Definition: sync0types.h:433
@ LATCH_ID_TRX_SYS_SHARD
Definition: sync0types.h:426
@ LATCH_ID_REDO_LOG_ARCHIVE_ADMIN_MUTEX
Definition: sync0types.h:468
@ LATCH_ID_PAGE_ZIP_STAT_PER_INDEX
Definition: sync0types.h:430
@ LATCH_ID_BUF_POOL_FLUSH_STATE
Definition: sync0types.h:359
@ LATCH_ID_PERSIST_METADATA_BUFFER
Definition: sync0types.h:399
@ LATCH_ID_PAGE_CLEANER
Definition: sync0types.h:403
@ LATCH_ID_SRV_MONITOR_FILE
Definition: sync0types.h:418
@ LATCH_ID_DDL_AUTOINC
Definition: sync0types.h:362
@ LATCH_ID_SRV_SYS
Definition: sync0types.h:428
@ LATCH_ID_PARALLEL_READ
Definition: sync0types.h:466
@ LATCH_ID_RSEGS
Definition: sync0types.h:446
@ LATCH_ID_RTR_PATH_MUTEX
Definition: sync0types.h:414
@ LATCH_ID_BUF_POOL_FREE_LIST
Definition: sync0types.h:356
@ LATCH_ID_ZIP_PAD_MUTEX
Definition: sync0types.h:434
@ LATCH_ID_EVENT_MUTEX
Definition: sync0types.h:432
latch_meta_t::CounterType * sync_latch_get_counter(latch_id_t id)
Fetch the counter for the latch.
Definition: sync0types.h:898
const char * sync_basename(const char *filename)
Print the filename "basename".
Definition: sync0sync.cc:219
latch_level_t
Latching order levels.
Definition: sync0types.h:201
@ SYNC_TREE_NODE_NEW
Definition: sync0types.h:301
@ SYNC_LOG_WRITER
Definition: sync0types.h:249
@ SYNC_DICT
Definition: sync0types.h:316
@ SYNC_FTS_BG_THREADS
Definition: sync0types.h:242
@ SYNC_BUF_LRU_LIST
Definition: sync0types.h:231
@ SYNC_BUF_BLOCK
Definition: sync0types.h:229
@ SYNC_LOG_FLUSHER
Definition: sync0types.h:247
@ SYNC_LOG_GOVERNOR_MUTEX
Definition: sync0types.h:256
@ SYNC_DICT_AUTOINC_MUTEX
Definition: sync0types.h:315
@ SYNC_IBUF_BITMAP
Definition: sync0types.h:279
@ SYNC_POOL
Definition: sync0types.h:267
@ SYNC_LOG_FILES
Definition: sync0types.h:248
@ SYNC_BUF_CHUNKS
Definition: sync0types.h:232
@ SYNC_STATS_AUTO_RECALC
Definition: sync0types.h:314
@ SYNC_TRX_SYS
Definition: sync0types.h:270
@ SYNC_UNDO_SPACE_RSEG
Definition: sync0types.h:296
@ SYNC_BUF_ZIP_HASH
Definition: sync0types.h:226
@ SYNC_TREE_NODE
Definition: sync0types.h:299
@ SYNC_FSP_PAGE
Definition: sync0types.h:287
@ SYNC_FTS_CACHE_INIT
Definition: sync0types.h:243
@ SYNC_TABLE_STATS_COMPUTE
Definition: sync0types.h:303
@ SYNC_BUF_PAGE_HASH
Definition: sync0types.h:230
@ SYNC_TRX
Definition: sync0types.h:266
@ SYNC_LOG_WRITE_NOTIFIER
Definition: sync0types.h:250
@ SYNC_POOL_MANAGER
Definition: sync0types.h:268
@ SYNC_BUF_ZIP_FREE
Definition: sync0types.h:228
@ SYNC_FTS_TOKENIZE
Definition: sync0types.h:240
@ SYNC_MUTEX
Definition: sync0types.h:204
@ SYNC_TRX_SYS_SERIALISATION
Definition: sync0types.h:263
@ SYNC_PURGE_QUEUE
Definition: sync0types.h:264
@ SYNC_BUF_FLUSH_LIST
Definition: sync0types.h:224
@ SYNC_UNDO_SPACES
Definition: sync0types.h:305
@ SYNC_LOG_CLOSER
Definition: sync0types.h:252
@ SYNC_RSEG_ARRAY_HEADER
Definition: sync0types.h:291
@ SYNC_PAGE_ZIP_STAT
Definition: sync0types.h:277
@ SYNC_RECV_WRITER
Definition: sync0types.h:329
@ SYNC_FTS_CACHE
Definition: sync0types.h:318
@ SYNC_LOG_ARCH
Definition: sync0types.h:259
@ RW_LOCK_SX
Definition: sync0types.h:206
@ SYNC_LOCK_SYS_GLOBAL
Definition: sync0types.h:272
@ SYNC_DICT_HEADER
Definition: sync0types.h:312
@ SYNC_LOCK_SYS_SHARDED
Definition: sync0types.h:271
@ SYNC_PAGE_CLEANER
Definition: sync0types.h:261
@ SYNC_RSEG_HEADER
Definition: sync0types.h:293
@ SYNC_LOG_LIMITS
Definition: sync0types.h:246
@ SYNC_LEVEL_VARYING
Level is varying.
Definition: sync0types.h:335
@ SYNC_TRX_UNDO_PAGE
Definition: sync0types.h:292
@ SYNC_FIL_SHARD
Definition: sync0types.h:220
@ SYNC_TRX_SYS_SHARD
Definition: sync0types.h:269
@ SYNC_RECV
Definition: sync0types.h:244
@ SYNC_IBUF_PESS_INSERT_MUTEX
Definition: sync0types.h:310
@ SYNC_PERSIST_AUTOINC
Definition: sync0types.h:308
@ SYNC_TABLE
Definition: sync0types.h:313
@ SYNC_PAGE_ARCH
Definition: sync0types.h:257
@ SYNC_LOG_CHECKPOINTER
Definition: sync0types.h:253
@ SYNC_BUF_FLUSH_STATE
Definition: sync0types.h:225
@ SYNC_FSP
Definition: sync0types.h:288
@ SYNC_TRX_UNDO
Definition: sync0types.h:297
@ SYNC_TRX_I_S_LAST_READ
Definition: sync0types.h:325
@ SYNC_NO_ORDER_CHECK
This can be used to suppress order checking.
Definition: sync0types.h:338
@ SYNC_EXTERN_STORAGE
Definition: sync0types.h:290
@ SYNC_BUF_FREE_LIST
Definition: sync0types.h:227
@ SYNC_PARSER
Definition: sync0types.h:317
@ SYNC_IBUF_MUTEX
Definition: sync0types.h:285
@ SYNC_IBUF_HEADER
Definition: sync0types.h:311
@ SYNC_LOG_SN_MUTEX
Definition: sync0types.h:255
@ SYNC_LOCK_FREE_HASH
Definition: sync0types.h:212
@ SYNC_TRX_I_S_RWLOCK
Definition: sync0types.h:327
@ RW_LOCK_S
Definition: sync0types.h:208
@ SYNC_TEMP_SPACE_RSEG
Definition: sync0types.h:295
@ SYNC_TREE_NODE_FROM_HASH
Definition: sync0types.h:300
@ SYNC_PURGE_LATCH
Definition: sync0types.h:298
@ SYNC_MONITOR_MUTEX
Definition: sync0types.h:214
@ SYNC_PERSIST_DIRTY_TABLES
Definition: sync0types.h:307
@ SYNC_LOCK_WAIT_SYS
Definition: sync0types.h:273
@ SYNC_LOG_FLUSH_NOTIFIER
Definition: sync0types.h:251
@ SYNC_ALTER_STAGE
Definition: sync0types.h:218
@ SYNC_INDEX_ONLINE_LOG
Definition: sync0types.h:275
@ SYNC_TEMP_POOL_MANAGER
Definition: sync0types.h:289
@ SYNC_ANY_LATCH
Definition: sync0types.h:216
@ SYNC_FTS_OPTIMIZE
Definition: sync0types.h:241
@ SYNC_PAGE_ARCH_OPER
Definition: sync0types.h:222
@ SYNC_RSEG_HEADER_NEW
Definition: sync0types.h:294
@ SYNC_UNDO_DDL
Definition: sync0types.h:319
@ SYNC_IBUF_INDEX_TREE
Definition: sync0types.h:283
@ SYNC_DICT_OPERATION
Definition: sync0types.h:321
@ SYNC_TRX_SYS_HEADER
Definition: sync0types.h:262
@ SYNC_RSEGS
Definition: sync0types.h:304
@ SYNC_IBUF_TREE_NODE_NEW
Definition: sync0types.h:282
@ RW_LOCK_X
Definition: sync0types.h:209
@ SYNC_IBUF_TREE_NODE
Definition: sync0types.h:281
@ SYNC_THREADS
Definition: sync0types.h:265
@ SYNC_LEVEL_MAX
Maximum level value.
Definition: sync0types.h:341
@ SYNC_WORK_QUEUE
Definition: sync0types.h:238
@ SYNC_DBLWR
Definition: sync0types.h:234
@ RW_LOCK_NOT_LOCKED
Definition: sync0types.h:210
@ RW_LOCK_X_WAIT
Definition: sync0types.h:207
@ SYNC_PAGE_ARCH_CLIENT
Definition: sync0types.h:258
@ SYNC_IBUF_BITMAP_MUTEX
Definition: sync0types.h:280
@ SYNC_INDEX_TREE
Definition: sync0types.h:302
@ SYNC_SEARCH_SYS
Definition: sync0types.h:236
@ SYNC_LOG_SN
Definition: sync0types.h:254
@ SYNC_AHI_ENABLED
Definition: sync0types.h:323
@ SYNC_UNKNOWN
Definition: sync0types.h:202
void sync_file_created_deregister(const void *ptr)
Deregister a latch, called when it is destroyed.
Definition: sync0debug.cc:1658
rw_lock_flag_t
Definition: sync0types.h:1216
@ RW_LOCK_FLAG_X
Definition: sync0types.h:1218
@ RW_LOCK_FLAG_SX
Definition: sync0types.h:1219
@ RW_LOCK_FLAG_S
Definition: sync0types.h:1217
mysql_pfs_key_t sync_latch_get_pfs_key(latch_id_t id)
Get the latch PFS key from the latch ID.
Definition: sync0types.h:926
bool innodb_calling_exit
Set when InnoDB has invoked exit().
Definition: srv0srv.cc:225
std::string sync_file_created_get(const void *ptr)
Get the string where the file was created.
Definition: sync0debug.cc:1665
ulint rw_lock_flags_t
Definition: sync0types.h:1213
Version control for database, common definitions, and include files.
#define UNIV_PFS_MUTEX
Definition: univ.i:131
#define UNIV_NOTHROW
Definition: univ.i:456
unsigned long int ulint
Definition: univ.i:406
Counter utility class.
#define ut_error
Abort execution.
Definition: ut0dbg.h:101
#define ut_ad(EXPR)
Debug assertion.
Definition: ut0dbg.h:105
#define ut_d(EXPR)
Debug statement.
Definition: ut0dbg.h:107
#define ut_a(EXPR)
Abort execution if EXPR does not evaluate to nonzero.
Definition: ut0dbg.h:93
Base of InnoDB utilities.
Dynamic memory allocation routines and custom allocators specifically crafted to support memory instr...
#define UT_NEW_THIS_FILE_PSI_KEY
Definition: ut0new.h:566
unsigned long id[MAX_DEAD]
Definition: xcom_base.cc:510