MySQL  8.0.21
Source Code Documentation
certifier.h
Go to the documentation of this file.
1 /* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
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  virtual ~Certifier_interface() {}
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  virtual ~Certifier();
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  virtual void handle_view_change();
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  virtual int handle_certifier_data(const uchar *data, ulong len,
241  const Gcs_member_identifier &gcs_member_id);
242 
243  /**
244  This member function SHALL certify the set of items against transactions
245  that have already passed the certification test.
246 
247  @param snapshot_version The incoming transaction snapshot version.
248  @param write_set The incoming transaction write set.
249  @param generate_group_id Flag that indicates if transaction group id
250  must be generated.
251  @param member_uuid The UUID of the member from which this
252  transaction originates.
253  @param gle The incoming transaction global identifier
254  event.
255  @param local_transaction True if this transaction did originate from
256  this member, false otherwise.
257 
258  @retval >0 transaction identifier (positively certified).
259  If generate_group_id is false and certification
260  positive a 1 is returned;
261  @retval 0 negatively certified;
262  @retval -1 error.
263  */
264  rpl_gno certify(Gtid_set *snapshot_version,
265  std::list<const char *> *write_set, bool generate_group_id,
266  const char *member_uuid, Gtid_log_event *gle,
267  bool local_transaction);
268 
269  /**
270  Returns the transactions in stable set in text format, that is, the set of
271  transactions already applied on all group members.
272 
273  @param[out] buffer Pointer to pointer to string. The method will set it to
274  point to the newly allocated buffer, or NULL on out of
275  memory.
276  Caller must free the allocated memory.
277  @param[out] length Length of the generated string.
278 
279  @return the operation status
280  @retval 0 OK
281  @retval !=0 Out of memory error
282  */
283  int get_group_stable_transactions_set_string(char **buffer, size_t *length);
284 
285  /**
286  Retrieves the current certification info.
287 
288  @note if concurrent access is introduce to these variables,
289  locking is needed in this method
290 
291  @param[out] cert_info a pointer to retrieve the certification info
292  */
293  virtual void get_certification_info(
294  std::map<std::string, std::string> *cert_info);
295 
296  /**
297  Sets the certification info according to the given value.
298 
299  @note if concurrent access is introduce to these variables,
300  locking is needed in this method
301 
302  @param[in] cert_info certification info retrieved from recovery procedure
303 
304  @retval > 0 Error during setting certification info.
305  @retval = 0 Everything went fine.
306  */
307  virtual int set_certification_info(
308  std::map<std::string, std::string> *cert_info);
309 
310  /**
311  Get the number of postively certified transactions by the certifier
312  */
313  ulonglong get_positive_certified();
314 
315  /**
316  Get method to retrieve the number of negatively certified transactions.
317  */
318  ulonglong get_negative_certified();
319 
320  /**
321  Get method to retrieve the certification db size.
322  */
323  ulonglong get_certification_info_size();
324 
325  /**
326  Get method to retrieve the last conflict free transaction.
327 
328  @param[out] value The last conflict free transaction
329  */
330  void get_last_conflict_free_transaction(std::string *value);
331 
332  /**
333  Get method to retrieve the size of the members.
334  */
335  size_t get_members_size();
336 
337  /**
338  Generate group GNO for a view change log event.
339 
340  @retval >0 view change GNO
341  @retval otherwise Error on GNO generation
342  */
343  rpl_gno generate_view_change_group_gno();
344 
345  /**
346  Public method to add the given gno value to the group_gtid_executed set
347  which is used to support skip gtid functionality.
348 
349  @param[in] gno The gno of the transaction which will be added to the
350  group_gtid executed GTID set. The sidno used for this
351  transaction will be the group_sidno. The gno here belongs specifically to
352  the group UUID.
353  @param[in] local If the gtid value is local or comes from a remote server
354 
355  @retval 1 error during addition.
356  @retval 0 success.
357  */
358  int add_group_gtid_to_group_gtid_executed(rpl_gno gno, bool local);
359 
360  /**
361  Public method to add the given GTID value in the group_gtid_executed set
362  which is used to support skip gtid functionality.
363 
364  @param[in] gle The gtid value that needs to the added in the
365  group_gtid_executed GTID set.
366  @param[in] local If the gtid value is local or comes from a remote server
367 
368  @retval 1 error during addition.
369  @retval 0 success.
370  */
371  int add_specified_gtid_to_group_gtid_executed(Gtid_log_event *gle,
372  bool local);
373 
374  /**
375  This member function shall add transactions to the stable set
376 
377  @param executed_gtid_set The GTID set of the transactions to be added
378  to the stable set.
379 
380  @note when set, the stable set will cause the garbage collection
381  process to be invoked
382 
383  @retval False if adds successfully,
384  @retval True otherwise.
385  */
386  bool set_group_stable_transactions_set(Gtid_set *executed_gtid_set);
387 
388  /**
389  Method to get a string that represents the last local certified GTID
390 
391  @param[out] local_gtid_certified_string The last local GTID transaction
392  string
393 
394  @retval 0 if there is no GTID / the string is empty
395  @retval !=0 the size of the string
396  */
397  size_t get_local_certified_gtid(std::string &local_gtid_certified_string);
398 
399  /**
400  Enables conflict detection.
401  */
402  void enable_conflict_detection();
403 
404  /**
405  Disables conflict detection.
406  */
407  void disable_conflict_detection();
408 
409  /**
410  Check if conflict detection is enable.
411 
412  @retval True conflict detection is enable
413  @retval False otherwise
414  */
415  bool is_conflict_detection_enable();
416 
417  private:
418  /**
419  Key used to store group_gtid_executed on certification
420  info on View_change_log_event.
421  */
422  static const std::string GTID_EXTRACTED_NAME;
423 
424  /**
425  Is certifier initialized.
426  */
428 
429  /**
430  Variable to store the sidno used for transactions which will be logged
431  with the group_uuid.
432  */
434 
435  /**
436  Method to initialize the group_gtid_executed gtid set with the server gtid
437  executed set and applier retrieved gtid set values.
438 
439  @param get_server_gtid_retrieved add applier retrieved gtid set to
440  group_gtid_executed gtid set
441 
442  @retval 1 error during initialization
443  @retval 0 success
444 
445  */
446  int initialize_server_gtid_set(bool get_server_gtid_retrieved = false);
447 
448  /**
449  This function computes the available GTID intervals from group
450  UUID and stores them on group_available_gtid_intervals.
451  */
452  void compute_group_available_gtid_intervals();
453 
454  /**
455  This function reserves a block of GTIDs from the
456  group_available_gtid_intervals list.
457 
458  @retval Gtid_set::Interval which is the interval os GTIDs attributed
459  */
460  Gtid_set::Interval reserve_gtid_block(longlong block_size);
461 
462  /**
463  This function updates parallel applier indexes.
464  It must be called for each remote transaction.
465 
466  @param[in] update_parallel_applier_last_committed_global
467  If true parallel_applier_last_committed_global
468  is updated to the current sequence number
469  (before update sequence number).
470 
471  Note: parallel_applier_last_committed_global should be updated
472  on the following situations:
473  1) Transaction without write set is certified, since it
474  represents the lowest last_committed for all future
475  transactions;
476  2) After certification info garbage collection, since we
477  do not know what write sets were purged, which may cause
478  transactions last committed to be incorrectly computed.
479  */
480  void increment_parallel_applier_sequence_number(
481  bool update_parallel_applier_last_committed_global);
482 
483  /**
484  Internal method to add the given gtid gno in the group_gtid_executed set.
485  This will be used in the skip gtid implementation.
486 
487  @note this will update the last know local transaction GTID.
488 
489  @param[in] sidno rpl_sidno part of the executing gtid of the ongoing
490  transaction.
491 
492  @param[in] gno rpl_gno part of the executing gtid of the ongoing
493  transaction.
494  @param[in] local_transaction if the GTID belongs to a local transaction
495  */
496  void add_to_group_gtid_executed_internal(rpl_sidno sidno, rpl_gno gno,
497  bool local_transaction);
498 
499  /**
500  This method is used to get the next valid GNO for the
501  transaction that is being executed. It checks the already used
502  up GNOs and based on that chooses the next possible value.
503  This method will consult group_available_gtid_intervals to
504  assign GTIDs in blocks according to gtid_assignment_block_size.
505 
506  @param member_uuid The UUID of the member from which this
507  transaction originates. It will be NULL
508  on View_change_log_event.
509 
510  @retval >0 The GNO to be used.
511  @retval -1 Error: GNOs exhausted for group UUID.
512  */
513  rpl_gno get_group_next_available_gtid(const char *member_uuid);
514 
515  /**
516  Generate the candidate GNO for the current transaction.
517  The candidate will be on the interval [start, end] or a error
518  be returned.
519  This method will consult group_gtid_executed to avoid generate
520  the same value twice.
521 
522  @param start The first possible value for the GNO
523  @param end The last possible value for the GNO
524 
525  @retval >0 The GNO to be used.
526  @retval -1 Error: GNOs exhausted for group UUID.
527  @retval -2 Error: generated GNO is bigger than end.
528  */
529  rpl_gno get_group_next_available_gtid_candidate(rpl_gno start,
530  rpl_gno end) const;
531 
532  bool inline is_initialized() { return initialized; }
533 
534  void clear_certification_info();
535 
536  /**
537  Method to clear the members.
538  */
539  void clear_members();
540 
541  /**
542  Last conflict free transaction identification.
543  */
545 
546  /**
547  Certification database.
548  */
551 
556 
557 #if !defined(DBUG_OFF)
560 #endif
561 
563 
564  /**
565  Stable set and garbage collector variables.
566  */
571 
572  std::vector<std::string> members;
573 
574  /*
575  Flag to indicate that certifier is handling already applied
576  transactions during distributed recovery procedure.
577 
578  On donor we may have local transactions certified after
579  View_change_log_event (VCLE) logged into binary log before VCLE.
580  That is, these local transactions will be appear on recovery
581  and also on GCS messages. One can see on example scenario below:
582 
583  GCS order | donor binary log order | joiner apply order
584  -----------+------------------------+--------------------
585  T1 | T1 | T1
586  T2 | T2 | T2
587  V1 | T3 | T3 (recovery)
588  T3 | V1 | V1
589  | | T3 (GCS)
590  -----------+------------------------+--------------------
591 
592  T3 is delivered to donor by both recovery and GCS, so joiner needs
593  to ensure that T3 has the same global identifier on both cases, so
594  that it is correctly skipped on the second time it is applied.
595 
596  We ensure that T3 (and other transactions on that situation) have
597  the same global identifiers on joiner by:
598  1) When the VCLE is applied, we set on joiner certification info
599  the same exact certification that was on donor, including the
600  set of certified transactions before the joiner joined:
601  group_gtid_extracted.
602  2) We compare group_gtid_extracted and group_gtid_executed:
603  If group_gtid_extracted is a non equal subset of
604  group_gtid_executed, it means that we are on the above
605  scenario, that is, when applying the last transaction from
606  the distributed recovery process we have more transactions
607  than the ones certified before the view on which joiner joined.
608  So until group_gtid_extracted is a non equal subset of
609  group_gtid_executed certifier will generate transactions ids
610  following group_gtid_extracted so that we have the same exact
611  ids that donor has.
612  3) When joiner group_gtid_extracted and group_gtid_executed are
613  equal, joiner switches to its regular ids generation mode,
614  generating ids from group_gtid_executed.
615  */
617 
618  /*
619  Sid map to store the GTIDs that are executed in the group.
620  */
622 
623  /*
624  A Gtid_set containing the already executed for the group.
625  This is used to support skip_gtid.
626  */
628 
629  /**
630  A Gtid_set which contains the gtid extracted from the certification info
631  map of the donor. It is the set of transactions that is executed at the
632  time of View_change_log_event at donor.
633  */
635 
636  /**
637  The group GTID assignment block size.
638  */
640 
641  /**
642  List of free GTID intervals in group
643  */
644  std::list<Gtid_set::Interval> group_available_gtid_intervals;
645 
646  /**
647  Extends the above to allow GTIDs to be assigned in blocks per member.
648  */
649  std::map<std::string, Gtid_set::Interval> member_gtids;
651 
652  /**
653  Last local known GTID
654  */
656 
657  /**
658  Conflict detection is performed when:
659  1) group is on multi-master mode;
660  2) group is on single-primary mode and primary is applying
661  relay logs with transactions from a previous primary.
662  */
664 
666 
667  /**
668  Broadcast thread.
669  */
671 
672  /**
673  Adds an item from transaction writeset to the certification DB.
674  @param[in] item item in the writeset to be added to the
675  Certification DB.
676  @param[in] snapshot_version Snapshot version of the incoming transaction
677  which modified the above mentioned item.
678  @param[out] item_previous_sequence_number
679  The previous parallel applier sequence number
680  for this item.
681 
682  @retval False successfully added to the map.
683  True otherwise.
684  */
685  bool add_item(const char *item, Gtid_set_ref *snapshot_version,
686  int64 *item_previous_sequence_number);
687 
688  /**
689  Find the snapshot_version corresponding to an item. Return if
690  it exists, other wise return NULL;
691 
692  @param[in] item item for the snapshot version.
693  @retval Gtid_set pointer if exists in the map.
694  Otherwise 0;
695  */
696  Gtid_set *get_certified_write_set_snapshot_version(const char *item);
697 
698  /**
699  Computes intersection between all sets received, so that we
700  have the already applied transactions on all servers.
701 
702  @return the operation status
703  @retval 0 OK
704  @retval !=0 Error
705  */
706  int stable_set_handle();
707 
708  /**
709  Removes the intersection of the received transactions stable
710  sets from certification database.
711  */
712  void garbage_collect();
713 
714  /**
715  Clear incoming queue.
716  */
717  void clear_incoming();
718 
719  /*
720  Update method to store the count of the positively and negatively
721  certified transaction on a particular group member.
722  */
723  void update_certified_transaction_count(bool result, bool local_transaction);
724 };
725 
726 /*
727  @class Gtid_Executed_Message
728 
729  Class to convey the serialized contents of the previously executed GTIDs
730  */
732  public:
734  // This type should not be used anywhere.
735  PIT_UNKNOWN = 0,
736 
737  // Length of the payload item: variable
738  PIT_GTID_EXECUTED = 1,
739 
740  // No valid type codes can appear after this one.
741  PIT_MAX = 2
742  };
743 
744  /**
745  Gtid_Executed_Message constructor
746  */
748  virtual ~Gtid_Executed_Message();
749 
750  /**
751  Appends Gtid executed information in a raw format
752 
753  * @param[in] gtid_data encoded GTID data
754  * @param[in] len GTID data length
755  */
756  void append_gtid_executed(uchar *gtid_data, size_t len);
757 
758  protected:
759  /*
760  Implementation of the template methods of Gcs_plugin_message
761  */
762  void encode_payload(std::vector<unsigned char> *buffer) const;
763  void decode_payload(const unsigned char *buffer, const unsigned char *);
764 
765  private:
766  std::vector<uchar> data;
767 };
768 
769 #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:562
bool same_member_message_discarded
Definition: certifier.h:559
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:568
size_t broadcast_counter
Definition: certifier.h:161
Gtid last_local_gtid
Last local known GTID.
Definition: certifier.h:655
thread_state broadcast_thd_state
Definition: certifier.h:160
ulonglong positive_cert
Definition: certifier.h:552
size_t unlink()
Decrement the number of references by one.
Definition: certifier.h:74
Synchronized_queue< Data_packet * > * incoming
Definition: certifier.h:570
Sid_map * group_gtid_sid_map
Definition: certifier.h:621
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:649
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:3804
This is the base GCS plugin message.
Definition: gcs_plugin_messages.h:63
std::vector< std::string > members
Definition: certifier.h:572
int64 parallel_applier_sequence_number
Definition: certifier.h:555
Sid_map * certification_info_sid_map
Definition: certifier.h:550
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
uint64 gtid_assignment_block_size
The group GTID assignment block size.
Definition: certifier.h:639
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:869
mysql_mutex_t broadcast_dispatcher_lock
Definition: certifier.h:158
bool certifying_already_applied_transactions
Definition: certifier.h:616
std::list< Gtid_set::Interval > group_available_gtid_intervals
List of free GTID intervals in group.
Definition: certifier.h:644
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:422
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:731
mysql_cond_t broadcast_run_cond
Definition: certifier.h:157
Gtid_set * group_gtid_executed
Definition: certifier.h:627
ulonglong gtids_assigned_in_blocks_counter
Definition: certifier.h:650
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:532
mysql_mutex_t LOCK_members
Definition: certifier.h:665
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:634
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:663
enum_payload_item_type
Definition: certifier.h:733
Checkable_rwlock * stable_gtid_set_lock
Stable set and garbage collector variables.
Definition: certifier.h:567
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:670
Definition: certifier.h:193
size_t link()
Increment the number of references by one.
Definition: certifier.h:67
virtual ~Certifier_interface()
Definition: certifier.h:176
int64 parallel_applier_last_committed_global
Definition: certifier.h:554
my_thread_handle broadcast_pthd
Definition: certifier.h:155
Gtid_set * stable_gtid_set
Definition: certifier.h:569
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:49
Gtid last_conflict_free_transaction
Last conflict free transaction identification.
Definition: certifier.h:544
std::vector< uchar > data
Definition: certifier.h:766
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:433
Certification_info certification_info
Certification database.
Definition: certifier.h:549
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:558
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:427
ulonglong negative_cert
Definition: certifier.h:553
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:799
Gtid_set_ref(Sid_map *sid_map, int64 parallel_applier_sequence_number)
Definition: certifier.h:55