MySQL  8.0.22
Source Code Documentation
certifier.h
Go to the documentation of this file.
1 /* Copyright (c) 2014, 2020, Oracle and/or its affiliates.
2 
3  This program is free software; you can redistribute it and/or modify
4  it under the terms of the GNU General Public License, version 2.0,
5  as published by the Free Software Foundation.
6 
7  This program is also distributed with certain software (including
8  but not limited to OpenSSL) that is licensed under separate terms,
9  as designated in a particular file or component or in included license
10  documentation. The authors of MySQL hereby grant you an additional
11  permission to link the program and your derivative works with the
12  separately licensed software that they have included with MySQL.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License, version 2.0, for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22 
23 #ifndef CERTIFIER_INCLUDE
24 #define CERTIFIER_INCLUDE
25 
27 #include <list>
28 #include <map>
29 #include <string>
30 #include <unordered_map>
31 #include <vector>
32 
33 #include "my_dbug.h"
34 #include "my_inttypes.h"
42 
43 /**
44  This class extends Gtid_set to include a reference counter.
45 
46  It is for Certifier only, so it is single-threaded and no locks
47  are needed since Certifier already ensures sequential use.
48 
49  It is to be used to share by multiple entries in the
50  certification info and released when the last reference to it
51  needs to be freed.
52 */
53 class Gtid_set_ref : public Gtid_set {
54  public:
56  : Gtid_set(sid_map),
58  parallel_applier_sequence_number(parallel_applier_sequence_number) {}
59 
60  virtual ~Gtid_set_ref() {}
61 
62  /**
63  Increment the number of references by one.
64 
65  @return the number of references
66  */
67  size_t link() { return ++reference_counter; }
68 
69  /**
70  Decrement the number of references by one.
71 
72  @return the number of references
73  */
74  size_t unlink() {
76  return --reference_counter;
77  }
78 
81  }
82 
83  private:
86 };
87 
88 /**
89  This class is a core component of the database state machine
90  replication protocol. It implements conflict detection based
91  on a certification procedure.
92 
93  Snapshot Isolation is based on assigning logical timestamp to optimistic
94  transactions, i.e. the ones which successfully meet certification and
95  are good to commit on all members in the group. This timestamp is a
96  monotonically increasing counter, and is same across all members in the group.
97 
98  This timestamp, which in our algorithm is the snapshot version, is further
99  used to update the certification info.
100  The snapshot version maps the items in a transaction to the GTID_EXECUTED
101  that this transaction saw when it was executed, that is, on which version
102  the transaction was executed.
103 
104  If the incoming transaction snapshot version is a subset of a
105  previous certified transaction for the same write set, the current
106  transaction was executed on top of outdated data, so it will be
107  negatively certified. Otherwise, this transaction is marked
108  certified and goes into applier.
109 */
110 typedef std::unordered_map<std::string, Gtid_set_ref *> Certification_info;
111 
113  public:
114  /**
115  Certifier_broadcast_thread constructor
116  */
118  virtual ~Certifier_broadcast_thread();
119 
120  /**
121  Initialize broadcast thread.
122 
123  @return the operation status
124  @retval 0 OK
125  @retval !=0 Error
126  */
127  int initialize();
128 
129  /**
130  Terminate broadcast thread.
131 
132  @return the operation status
133  @retval 0 OK
134  @retval !=0 Error
135  */
136  int terminate();
137 
138  /**
139  Broadcast thread worker method.
140  */
141  void dispatcher();
142 
143  /**
144  Period (in seconds) between stable transactions set
145  broadcast.
146  */
147  static const int BROADCAST_GTID_EXECUTED_PERIOD = 60; // seconds
148 
149  private:
150  /**
151  Thread control.
152  */
153  bool aborted;
163 
164  /**
165  Broadcast local GTID_EXECUTED to group.
166 
167  @return the operation status
168  @retval 0 OK
169  @retval !=0 Error
170  */
171  int broadcast_gtid_executed();
172 };
173 
175  public:
176  ~Certifier_interface() override {}
177  virtual void handle_view_change() = 0;
178  virtual int handle_certifier_data(
179  const uchar *data, ulong len,
180  const Gcs_member_identifier &gcs_member_id) = 0;
181 
182  virtual void get_certification_info(
183  std::map<std::string, std::string> *cert_info) = 0;
184  virtual int set_certification_info(
185  std::map<std::string, std::string> *cert_info) = 0;
186  virtual bool set_group_stable_transactions_set(
187  Gtid_set *executed_gtid_set) = 0;
188  virtual void enable_conflict_detection() = 0;
189  virtual void disable_conflict_detection() = 0;
190  virtual bool is_conflict_detection_enable() = 0;
191 };
192 
194  public:
195  Certifier();
196  ~Certifier() override;
197 
198  /**
199  Key used to store errors in the certification info
200  on View_change_log_event.
201  */
202  static const std::string CERTIFICATION_INFO_ERROR_NAME;
203 
204  /**
205  Initialize certifier.
206 
207  @param gtid_assignment_block_size the group gtid assignment block size
208 
209  @return the operation status
210  @retval 0 OK
211  @retval !=0 Error
212  */
213  int initialize(ulonglong gtid_assignment_block_size);
214 
215  /**
216  Terminate certifier.
217 
218  @return the operation status
219  @retval 0 OK
220  @retval !=0 Error
221  */
222  int terminate();
223 
224  /**
225  Handle view changes on certifier.
226  */
227  void handle_view_change() override;
228 
229  /**
230  Queues the packet coming from the reader for future processing.
231 
232  @param[in] data the packet data
233  @param[in] len the packet length
234  @param[in] gcs_member_id the member_id which sent the message
235 
236  @return the operation status
237  @retval 0 OK
238  @retval !=0 Error on queue
239  */
240  int handle_certifier_data(
241  const uchar *data, ulong len,
242  const Gcs_member_identifier &gcs_member_id) override;
243 
244  /**
245  This member function SHALL certify the set of items against transactions
246  that have already passed the certification test.
247 
248  @param snapshot_version The incoming transaction snapshot version.
249  @param write_set The incoming transaction write set.
250  @param generate_group_id Flag that indicates if transaction group id
251  must be generated.
252  @param member_uuid The UUID of the member from which this
253  transaction originates.
254  @param gle The incoming transaction global identifier
255  event.
256  @param local_transaction True if this transaction did originate from
257  this member, false otherwise.
258 
259  @retval >0 transaction identifier (positively certified).
260  If generate_group_id is false and certification
261  positive a 1 is returned;
262  @retval 0 negatively certified;
263  @retval -1 error.
264  */
265  rpl_gno certify(Gtid_set *snapshot_version,
266  std::list<const char *> *write_set, bool generate_group_id,
267  const char *member_uuid, Gtid_log_event *gle,
268  bool local_transaction);
269 
270  /**
271  Returns the transactions in stable set in text format, that is, the set of
272  transactions already applied on all group members.
273 
274  @param[out] buffer Pointer to pointer to string. The method will set it to
275  point to the newly allocated buffer, or NULL on out of
276  memory.
277  Caller must free the allocated memory.
278  @param[out] length Length of the generated string.
279 
280  @return the operation status
281  @retval 0 OK
282  @retval !=0 Out of memory error
283  */
284  int get_group_stable_transactions_set_string(char **buffer,
285  size_t *length) override;
286 
287  /**
288  Retrieves the current certification info.
289 
290  @note if concurrent access is introduce to these variables,
291  locking is needed in this method
292 
293  @param[out] cert_info a pointer to retrieve the certification info
294  */
295  void get_certification_info(
296  std::map<std::string, std::string> *cert_info) override;
297 
298  /**
299  Sets the certification info according to the given value.
300 
301  @note if concurrent access is introduce to these variables,
302  locking is needed in this method
303 
304  @param[in] cert_info certification info retrieved from recovery procedure
305 
306  @retval > 0 Error during setting certification info.
307  @retval = 0 Everything went fine.
308  */
309  int set_certification_info(
310  std::map<std::string, std::string> *cert_info) override;
311 
312  /**
313  Get the number of postively certified transactions by the certifier
314  */
315  ulonglong get_positive_certified() override;
316 
317  /**
318  Get method to retrieve the number of negatively certified transactions.
319  */
320  ulonglong get_negative_certified() override;
321 
322  /**
323  Get method to retrieve the certification db size.
324  */
325  ulonglong get_certification_info_size() override;
326 
327  /**
328  Get method to retrieve the last conflict free transaction.
329 
330  @param[out] value The last conflict free transaction
331  */
332  void get_last_conflict_free_transaction(std::string *value) override;
333 
334  /**
335  Generate group GNO for a view change log event.
336 
337  @retval >0 view change GNO
338  @retval otherwise Error on GNO generation
339  */
340  rpl_gno generate_view_change_group_gno();
341 
342  /**
343  Public method to add the given gno value to the group_gtid_executed set
344  which is used to support skip gtid functionality.
345 
346  @param[in] gno The gno of the transaction which will be added to the
347  group_gtid executed GTID set. The sidno used for this
348  transaction will be the group_sidno. The gno here belongs specifically to
349  the group UUID.
350  @param[in] local If the gtid value is local or comes from a remote server
351 
352  @retval 1 error during addition.
353  @retval 0 success.
354  */
355  int add_group_gtid_to_group_gtid_executed(rpl_gno gno, bool local);
356 
357  /**
358  Public method to add the given GTID value in the group_gtid_executed set
359  which is used to support skip gtid functionality.
360 
361  @param[in] gle The gtid value that needs to the added in the
362  group_gtid_executed GTID set.
363  @param[in] local If the gtid value is local or comes from a remote server
364 
365  @retval 1 error during addition.
366  @retval 0 success.
367  */
368  int add_specified_gtid_to_group_gtid_executed(Gtid_log_event *gle,
369  bool local);
370 
371  /**
372  This member function shall add transactions to the stable set
373 
374  @param executed_gtid_set The GTID set of the transactions to be added
375  to the stable set.
376 
377  @note when set, the stable set will cause the garbage collection
378  process to be invoked
379 
380  @retval False if adds successfully,
381  @retval True otherwise.
382  */
383  bool set_group_stable_transactions_set(Gtid_set *executed_gtid_set) override;
384 
385  /**
386  Method to get a string that represents the last local certified GTID
387 
388  @param[out] local_gtid_certified_string The last local GTID transaction
389  string
390 
391  @retval 0 if there is no GTID / the string is empty
392  @retval !=0 the size of the string
393  */
394  size_t get_local_certified_gtid(std::string &local_gtid_certified_string);
395 
396  /**
397  Enables conflict detection.
398  */
399  void enable_conflict_detection() override;
400 
401  /**
402  Disables conflict detection.
403  */
404  void disable_conflict_detection() override;
405 
406  /**
407  Check if conflict detection is enable.
408 
409  @retval True conflict detection is enable
410  @retval False otherwise
411  */
412  bool is_conflict_detection_enable() override;
413 
414  private:
415  /**
416  Key used to store group_gtid_executed on certification
417  info on View_change_log_event.
418  */
419  static const std::string GTID_EXTRACTED_NAME;
420 
421  /**
422  Is certifier initialized.
423  */
425 
426  /**
427  Variable to store the sidno used for transactions which will be logged
428  with the group_uuid.
429  */
431 
432  /**
433  Method to initialize the group_gtid_executed gtid set with the server gtid
434  executed set and applier retrieved gtid set values.
435 
436  @param get_server_gtid_retrieved add applier retrieved gtid set to
437  group_gtid_executed gtid set
438 
439  @retval 1 error during initialization
440  @retval 0 success
441 
442  */
443  int initialize_server_gtid_set(bool get_server_gtid_retrieved = false);
444 
445  /**
446  This function computes the available GTID intervals from group
447  UUID and stores them on group_available_gtid_intervals.
448  */
449  void compute_group_available_gtid_intervals();
450 
451  /**
452  This function reserves a block of GTIDs from the
453  group_available_gtid_intervals list.
454 
455  @retval Gtid_set::Interval which is the interval os GTIDs attributed
456  */
457  Gtid_set::Interval reserve_gtid_block(longlong block_size);
458 
459  /**
460  This function updates parallel applier indexes.
461  It must be called for each remote transaction.
462 
463  @param[in] update_parallel_applier_last_committed_global
464  If true parallel_applier_last_committed_global
465  is updated to the current sequence number
466  (before update sequence number).
467 
468  Note: parallel_applier_last_committed_global should be updated
469  on the following situations:
470  1) Transaction without write set is certified, since it
471  represents the lowest last_committed for all future
472  transactions;
473  2) After certification info garbage collection, since we
474  do not know what write sets were purged, which may cause
475  transactions last committed to be incorrectly computed.
476  */
477  void increment_parallel_applier_sequence_number(
478  bool update_parallel_applier_last_committed_global);
479 
480  /**
481  Internal method to add the given gtid gno in the group_gtid_executed set.
482  This will be used in the skip gtid implementation.
483 
484  @note this will update the last know local transaction GTID.
485 
486  @param[in] sidno rpl_sidno part of the executing gtid of the ongoing
487  transaction.
488 
489  @param[in] gno rpl_gno part of the executing gtid of the ongoing
490  transaction.
491  @param[in] local_transaction if the GTID belongs to a local transaction
492  */
493  void add_to_group_gtid_executed_internal(rpl_sidno sidno, rpl_gno gno,
494  bool local_transaction);
495 
496  /**
497  This method is used to get the next valid GNO for the
498  transaction that is being executed. It checks the already used
499  up GNOs and based on that chooses the next possible value.
500  This method will consult group_available_gtid_intervals to
501  assign GTIDs in blocks according to gtid_assignment_block_size.
502 
503  @param member_uuid The UUID of the member from which this
504  transaction originates. It will be NULL
505  on View_change_log_event.
506 
507  @retval >0 The GNO to be used.
508  @retval -1 Error: GNOs exhausted for group UUID.
509  */
510  rpl_gno get_group_next_available_gtid(const char *member_uuid);
511 
512  /**
513  Generate the candidate GNO for the current transaction.
514  The candidate will be on the interval [start, end] or a error
515  be returned.
516  This method will consult group_gtid_executed to avoid generate
517  the same value twice.
518 
519  @param start The first possible value for the GNO
520  @param end The last possible value for the GNO
521 
522  @retval >0 The GNO to be used.
523  @retval -1 Error: GNOs exhausted for group UUID.
524  @retval -2 Error: generated GNO is bigger than end.
525  */
526  rpl_gno get_group_next_available_gtid_candidate(rpl_gno start,
527  rpl_gno end) const;
528 
529  bool inline is_initialized() { return initialized; }
530 
531  void clear_certification_info();
532 
533  /**
534  Method to clear the members.
535  */
536  void clear_members();
537 
538  /**
539  Last conflict free transaction identification.
540  */
542 
543  /**
544  Certification database.
545  */
548 
553 
554 #if !defined(DBUG_OFF)
557 #endif
558 
560 
561  /**
562  Stable set and garbage collector variables.
563  */
568 
569  std::vector<std::string> members;
570 
571  /*
572  Flag to indicate that certifier is handling already applied
573  transactions during distributed recovery procedure.
574 
575  On donor we may have local transactions certified after
576  View_change_log_event (VCLE) logged into binary log before VCLE.
577  That is, these local transactions will be appear on recovery
578  and also on GCS messages. One can see on example scenario below:
579 
580  GCS order | donor binary log order | joiner apply order
581  -----------+------------------------+--------------------
582  T1 | T1 | T1
583  T2 | T2 | T2
584  V1 | T3 | T3 (recovery)
585  T3 | V1 | V1
586  | | T3 (GCS)
587  -----------+------------------------+--------------------
588 
589  T3 is delivered to donor by both recovery and GCS, so joiner needs
590  to ensure that T3 has the same global identifier on both cases, so
591  that it is correctly skipped on the second time it is applied.
592 
593  We ensure that T3 (and other transactions on that situation) have
594  the same global identifiers on joiner by:
595  1) When the VCLE is applied, we set on joiner certification info
596  the same exact certification that was on donor, including the
597  set of certified transactions before the joiner joined:
598  group_gtid_extracted.
599  2) We compare group_gtid_extracted and group_gtid_executed:
600  If group_gtid_extracted is a non equal subset of
601  group_gtid_executed, it means that we are on the above
602  scenario, that is, when applying the last transaction from
603  the distributed recovery process we have more transactions
604  than the ones certified before the view on which joiner joined.
605  So until group_gtid_extracted is a non equal subset of
606  group_gtid_executed certifier will generate transactions ids
607  following group_gtid_extracted so that we have the same exact
608  ids that donor has.
609  3) When joiner group_gtid_extracted and group_gtid_executed are
610  equal, joiner switches to its regular ids generation mode,
611  generating ids from group_gtid_executed.
612  */
614 
615  /*
616  Sid map to store the GTIDs that are executed in the group.
617  */
619 
620  /*
621  A Gtid_set containing the already executed for the group.
622  This is used to support skip_gtid.
623  */
625 
626  /**
627  A Gtid_set which contains the gtid extracted from the certification info
628  map of the donor. It is the set of transactions that is executed at the
629  time of View_change_log_event at donor.
630  */
632 
633  /**
634  The group GTID assignment block size.
635  */
637 
638  /**
639  List of free GTID intervals in group
640  */
641  std::list<Gtid_set::Interval> group_available_gtid_intervals;
642 
643  /**
644  Extends the above to allow GTIDs to be assigned in blocks per member.
645  */
646  std::map<std::string, Gtid_set::Interval> member_gtids;
648 
649  /**
650  Last local known GTID
651  */
653 
654  /**
655  Conflict detection is performed when:
656  1) group is on multi-master mode;
657  2) group is on single-primary mode and primary is applying
658  relay logs with transactions from a previous primary.
659  */
661 
663 
664  /**
665  Broadcast thread.
666  */
668 
669  /**
670  Adds an item from transaction writeset to the certification DB.
671  @param[in] item item in the writeset to be added to the
672  Certification DB.
673  @param[in] snapshot_version Snapshot version of the incoming transaction
674  which modified the above mentioned item.
675  @param[out] item_previous_sequence_number
676  The previous parallel applier sequence number
677  for this item.
678 
679  @retval False successfully added to the map.
680  True otherwise.
681  */
682  bool add_item(const char *item, Gtid_set_ref *snapshot_version,
683  int64 *item_previous_sequence_number);
684 
685  /**
686  Find the snapshot_version corresponding to an item. Return if
687  it exists, other wise return NULL;
688 
689  @param[in] item item for the snapshot version.
690  @retval Gtid_set pointer if exists in the map.
691  Otherwise 0;
692  */
693  Gtid_set *get_certified_write_set_snapshot_version(const char *item);
694 
695  /**
696  Computes intersection between all sets received, so that we
697  have the already applied transactions on all servers.
698 
699  @return the operation status
700  @retval 0 OK
701  @retval !=0 Error
702  */
703  int stable_set_handle();
704 
705  /**
706  Removes the intersection of the received transactions stable
707  sets from certification database.
708  */
709  void garbage_collect();
710 
711  /**
712  Clear incoming queue.
713  */
714  void clear_incoming();
715 
716  /*
717  Update method to store the count of the positively and negatively
718  certified transaction on a particular group member.
719  */
720  void update_certified_transaction_count(bool result, bool local_transaction);
721 };
722 
723 /*
724  @class Gtid_Executed_Message
725 
726  Class to convey the serialized contents of the previously executed GTIDs
727  */
729  public:
731  // This type should not be used anywhere.
732  PIT_UNKNOWN = 0,
733 
734  // Length of the payload item: variable
735  PIT_GTID_EXECUTED = 1,
736 
737  // No valid type codes can appear after this one.
738  PIT_MAX = 2
739  };
740 
741  /**
742  Gtid_Executed_Message constructor
743  */
745  ~Gtid_Executed_Message() override;
746 
747  /**
748  Appends Gtid executed information in a raw format
749 
750  * @param[in] gtid_data encoded GTID data
751  * @param[in] len GTID data length
752  */
753  void append_gtid_executed(uchar *gtid_data, size_t len);
754 
755  protected:
756  /*
757  Implementation of the template methods of Gcs_plugin_message
758  */
759  void encode_payload(std::vector<unsigned char> *buffer) const override;
760  void decode_payload(const unsigned char *buffer,
761  const unsigned char *) override;
762 
763  private:
764  std::vector<uchar> data;
765 };
766 
767 #endif /* CERTIFIER_INCLUDE */
Definition: result.h:29
unsigned long long int ulonglong
Definition: my_inttypes.h:55
mysql_cond_t broadcast_dispatcher_cond
Definition: certifier.h:159
virtual ~Gtid_set_ref()
Definition: certifier.h:60
mysql_mutex_t LOCK_certification_info
Definition: certifier.h:559
bool same_member_message_discarded
Definition: certifier.h:556
int rpl_sidno
Type of SIDNO (source ID number, first component of GTID)
Definition: rpl_gtid.h:93
unsigned char uchar
Definition: my_inttypes.h:51
Sid_map * stable_sid_map
Definition: certifier.h:565
size_t broadcast_counter
Definition: certifier.h:161
Gtid last_local_gtid
Last local known GTID.
Definition: certifier.h:652
thread_state broadcast_thd_state
Definition: certifier.h:160
ulonglong positive_cert
Definition: certifier.h:549
size_t unlink()
Decrement the number of references by one.
Definition: certifier.h:74
Synchronized_queue< Data_packet * > * incoming
Definition: certifier.h:567
Sid_map * group_gtid_sid_map
Definition: certifier.h:618
char buffer[STRING_BUFFER]
Definition: test_sql_9_sessions.cc:57
An instrumented cond structure.
Definition: mysql_cond_bits.h:49
Some integer typedefs for easier portability.
This class extends Gtid_set to include a reference counter.
Definition: certifier.h:53
mysql_mutex_t broadcast_run_lock
Definition: certifier.h:156
std::map< std::string, Gtid_set::Interval > member_gtids
Extends the above to allow GTIDs to be assigned in blocks per member.
Definition: certifier.h:646
size_t reference_counter
Definition: certifier.h:84
Definition: certifier.h:112
This is a subclass if Gtid_event and Log_event.
Definition: log_event.h:3798
This is the base GCS plugin message.
Definition: gcs_plugin_messages.h:63
std::vector< std::string > members
Definition: certifier.h:569
int64 parallel_applier_sequence_number
Definition: certifier.h:552
Sid_map * certification_info_sid_map
Definition: certifier.h:547
TODO: Move this structure to libbinlogevents/include/control_events.h when we start using C++11...
Definition: rpl_gtid.h:1027
Represents a bidirectional map between SID and SIDNO.
Definition: rpl_gtid.h:685
Definition: local.h:60
uint64 gtid_assignment_block_size
The group GTID assignment block size.
Definition: certifier.h:636
int broadcast_gtid_executed_period
Definition: certifier.h:162
bool initialize(THD *thd)
Initialize the dictionary while starting the server for the first time.
Definition: bootstrapper.cc:877
mysql_mutex_t broadcast_dispatcher_lock
Definition: certifier.h:158
bool certifying_already_applied_transactions
Definition: certifier.h:613
std::list< Gtid_set::Interval > group_available_gtid_intervals
List of free GTID intervals in group.
Definition: certifier.h:641
bool aborted
Thread control.
Definition: certifier.h:153
static const std::string GTID_EXTRACTED_NAME
Key used to store group_gtid_executed on certification info on View_change_log_event.
Definition: certifier.h:419
Sid_map * sid_map
Sid_map associated with this Gtid_set.
Definition: rpl_gtid.h:2278
static const std::string CERTIFICATION_INFO_ERROR_NAME
Key used to store errors in the certification info on View_change_log_event.
Definition: certifier.h:202
#define DBUG_ASSERT(A)
Definition: my_dbug.h:199
Definition: certifier.h:728
mysql_cond_t broadcast_run_cond
Definition: certifier.h:157
Gtid_set * group_gtid_executed
Definition: certifier.h:624
ulonglong gtids_assigned_in_blocks_counter
Definition: certifier.h:647
static void start(mysql_harness::PluginFuncEnv *env)
Definition: http_auth_backend_plugin.cc:161
Cursor end()
A past-the-end Cursor.
Definition: rules_table_service.cc:188
int64_t int64
Definition: my_inttypes.h:67
Definition: my_thread_bits.h:51
It represents the identity of a group member within a certain group.
Definition: gcs_member_identifier.h:39
bool is_initialized()
Definition: certifier.h:529
mysql_mutex_t LOCK_members
Definition: certifier.h:662
long long int longlong
Definition: my_inttypes.h:54
Gtid_set * group_gtid_extracted
A Gtid_set which contains the gtid extracted from the certification info map of the donor...
Definition: certifier.h:631
Definition: certifier.h:174
bool conflict_detection_enable
Conflict detection is performed when: 1) group is on multi-master mode; 2) group is on single-primary...
Definition: certifier.h:660
enum_payload_item_type
Definition: certifier.h:730
Checkable_rwlock * stable_gtid_set_lock
Stable set and garbage collector variables.
Definition: certifier.h:564
THD * broadcast_thd
Definition: certifier.h:154
Definition: plugin_utils.h:42
Represents a set of GTIDs.
Definition: rpl_gtid.h:1414
Certifier_broadcast_thread * broadcast_thread
Broadcast thread.
Definition: certifier.h:667
Definition: certifier.h:193
~Certifier_interface() override
Definition: certifier.h:176
size_t link()
Increment the number of references by one.
Definition: certifier.h:67
int64 parallel_applier_last_committed_global
Definition: certifier.h:551
my_thread_handle broadcast_pthd
Definition: certifier.h:155
Gtid_set * stable_gtid_set
Definition: certifier.h:566
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:49
Gtid last_conflict_free_transaction
Last conflict free transaction identification.
Definition: certifier.h:541
std::vector< uchar > data
Definition: certifier.h:764
rpl_sidno group_gtid_sid_map_group_sidno
Variable to store the sidno used for transactions which will be logged with the group_uuid.
Definition: certifier.h:430
Certification_info certification_info
Certification database.
Definition: certifier.h:546
Represents one element in the linked list of intervals associated with a SIDNO.
Definition: rpl_gtid.h:1852
Definition: plugin_utils.h:176
int64 get_parallel_applier_sequence_number() const
Definition: certifier.h:79
const string value("\alue\)
bool certifier_garbage_collection_block
Definition: certifier.h:555
This has the functionality of mysql_rwlock_t, with two differences:
Definition: rpl_gtid.h:303
Definition: certifier_stats_interface.h:28
long long int rpl_gno
Type of GNO, the second (numeric) component of GTID.
Definition: rpl_gtid.h:99
bool initialized
Is certifier initialized.
Definition: certifier.h:424
ulonglong negative_cert
Definition: certifier.h:550
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:75
uint64_t uint64
Definition: my_inttypes.h:68
bool initialized
Definition: sql_auth_cache.cc:158
int64 parallel_applier_sequence_number
Definition: certifier.h:85
std::unordered_map< std::string, Gtid_set_ref * > Certification_info
This class is a core component of the database state machine replication protocol.
Definition: certifier.h:110
bool terminate(THD *thd)
Drop all DD tables in case there is an error while upgrading server.
Definition: upgrade.cc:682
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_class.h:803
Gtid_set_ref(Sid_map *sid_map, int64 parallel_applier_sequence_number)
Definition: certifier.h:55