MySQL  8.0.19
Source Code Documentation
pipeline_interfaces.h
Go to the documentation of this file.
1 /* Copyright (c) 2014, 2018, 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 PIPELINE_INTERFACES_INCLUDED
24 #define PIPELINE_INTERFACES_INCLUDED
25 
26 #include <list>
27 
31 
32 #include "mysqld_error.h"
36 
37 // Define the data packet type
38 #define DATA_PACKET_TYPE 1
39 
40 /**
41  @class Packet
42 
43  A generic interface for different kinds of packets.
44 */
45 class Packet {
46  public:
47  /**
48  Create a new generic packet of a certain type.
49 
50  @param[in] type the packet type
51  */
53 
54  virtual ~Packet() {}
55 
56  /**
57  @return the packet type
58  */
59  int get_packet_type() { return packet_type; }
60 
61  private:
63 };
64 
65 /**
66  @class Data_packet
67 
68  A wrapper for raw network packets.
69 */
70 class Data_packet : public Packet {
71  public:
72  /**
73  Create a new data packet wrapper.
74 
75  @param[in] data the packet data
76  @param[in] len the packet length
77  @param[in] consistency_level the transaction consistency level
78  @param[in] online_members the ONLINE members when the transaction
79  message was delivered
80  */
81  Data_packet(const uchar *data, ulong len,
84  std::list<Gcs_member_identifier> *online_members = NULL)
86  payload(NULL),
87  len(len),
88  m_consistency_level(consistency_level),
89  m_online_members(online_members) {
91  memcpy(payload, data, len);
92  }
93 
96  delete m_online_members;
97  }
98 
102  std::list<Gcs_member_identifier> *m_online_members;
103 };
104 
105 // Define the data packet type
106 #define UNDEFINED_EVENT_MODIFIER 0
107 
108 // Define the size of the pipeline event buffer
109 #define DEFAULT_EVENT_BUFFER_SIZE 16384
110 
111 /**
112  @class Pipeline_event
113 
114  A wrapper for log events/packets. This class allows for the marking of events
115  and its transformation between the packet and log event formats as requested
116  in the interface.
117 
118  @note Events can be marked as with event modifiers.
119  This is a generic field allowing modifiers to vary with use context.
120  If not specified, this field has a default value of 0.
121 */
123  public:
124  /**
125  Create a new pipeline wrapper based on a packet.
126 
127  @note If a modifier is not provided the event will be marked as `UNDEFINED`
128 
129  @param[in] base_packet the wrapper packet
130  @param[in] fde_event the format description event for conversions
131  @param[in] modifier the event modifier
132  @param[in] consistency_level the transaction consistency level
133  @param[in] online_members the ONLINE members when the transaction
134  message was delivered
135  */
137  Format_description_log_event *fde_event,
138  int modifier = UNDEFINED_EVENT_MODIFIER,
139  enum_group_replication_consistency_level consistency_level =
141  std::list<Gcs_member_identifier> *online_members = NULL)
142  : packet(base_packet),
143  log_event(NULL),
144  event_context(modifier),
145  format_descriptor(fde_event),
146  m_consistency_level(consistency_level),
147  m_online_members(online_members),
149 
150  /**
151  Create a new pipeline wrapper based on a log event.
152 
153  @note If a modifier is not provided the event will be marked as `UNDEFINED`
154 
155  @param[in] base_event the wrapper log event
156  @param[in] fde_event the format description event for conversions
157  @param[in] modifier the event modifier
158  @param[in] consistency_level the transaction consistency level
159  @param[in] online_members the ONLINE members when the transaction
160  message was delivered
161  */
163  int modifier = UNDEFINED_EVENT_MODIFIER,
164  enum_group_replication_consistency_level consistency_level =
166  std::list<Gcs_member_identifier> *online_members = NULL)
167  : packet(NULL),
168  log_event(base_event),
169  event_context(modifier),
170  format_descriptor(fde_event),
171  m_consistency_level(consistency_level),
172  m_online_members(online_members),
174 
176  if (packet != NULL) {
177  delete packet;
178  }
179  if (log_event != NULL) {
180  delete log_event;
181  }
183  delete m_online_members;
184  }
185  }
186 
187  /**
188  Return current format description event.
189 
190  @param[out] out_fde the outputted format description event
191 
192  @return Operation status
193  @retval 0 OK
194  */
196  *out_fde = format_descriptor;
197  return 0;
198  }
199 
200  /**
201  Return a log event. If one does not exist, the contained packet will be
202  converted into one.
203 
204  @param[out] out_event the outputted log event
205 
206  @return Operation status
207  @retval 0 OK
208  @retval !=0 error on conversion
209  */
210  int get_LogEvent(Log_event **out_event) {
211  if (log_event == NULL)
213  return error; /* purecov: inspected */
214  *out_event = log_event;
215  return 0;
216  }
217 
218  /**
219  Sets the pipeline event's log event.
220 
221  @note This methods assume you have called reset_pipeline_event
222 
223  @param[in] in_event the given log event
224  */
225  void set_LogEvent(Log_event *in_event) { log_event = in_event; }
226 
227  /**
228  Sets the pipeline event's packet.
229 
230  @note This methods assume you have called reset_pipeline_event
231 
232  @param[in] in_packet the given packet
233  */
234  void set_Packet(Data_packet *in_packet) { packet = in_packet; }
235 
236  /**
237  Return a packet. If one does not exist, the contained log event will be
238  converted into one.
239 
240  @param[out] out_packet the outputted packet
241 
242  @return the operation status
243  @retval 0 OK
244  @retval !=0 error on conversion
245  */
246  int get_Packet(Data_packet **out_packet) {
247  if (packet == NULL)
249  return error; /* purecov: inspected */
250  *out_packet = packet;
251  return 0;
252  }
253 
254  /**
255  Returns the event type.
256  Be it a Log_event or Packet, it's marked with a type we can extract.
257 
258  @return the pipeline event type
259  */
261  if (packet != NULL)
263  else
264  return log_event->get_type_code();
265  }
266 
267  /**
268  Sets the event context flag.
269 
270  @param[in] modifier the event modifier
271  */
272  void mark_event(int modifier) { event_context = modifier; }
273 
274  /**
275  Returns the event context flag
276 
277  @return
278  */
280 
281  /**
282  Resets all variables in the event for reuse.
283  Possible existing events/packets are deleted.
284  The context flag is reset to UNDEFINED.
285  Error messages are deleted.
286 
287  Format description events, are NOT deleted.
288  This is due to the fact that they are given, and do not belong to the
289  pipeline event.
290 
291  Transaction consistency level is not reset, despite the event
292  is reset, consistency level belongs to the transaction.
293  */
295  if (packet != NULL) {
296  delete packet; /* purecov: inspected */
297  packet = NULL; /* purecov: inspected */
298  }
299  if (log_event != NULL) {
300  delete log_event;
301  log_event = NULL;
302  }
304  }
305 
306  /**
307  Get transaction consistency level.
308  */
310  return m_consistency_level;
311  }
312 
313  /**
314  Get the list of ONLINE Group members when a
315  Transaction_with_guarantee_message message was received, or NULL if
316  if any group member version is from a version lower than
317  #TRANSACTION_WITH_GUARANTEES_VERSION.
318  For Transaction_message messages it always return NULL
319 
320  @return list of all ONLINE members, if all members have version
321  equal or greater than #TRANSACTION_WITH_GUARANTEES_VERSION
322  for Transaction_with_guarantee_message messages
323  otherwise NULL
324 
325  @note the memory allocated for the list ownership belongs to the
326  caller
327  */
328  std::list<Gcs_member_identifier> *get_online_members() {
329  return m_online_members;
330  }
331 
332  /**
333  Release memory ownership of m_online_members.
334  */
337  }
338 
339  private:
340  /**
341  Converts the existing packet into a log event.
342 
343  @return the operation status
344  @retval 0 OK
345  @retval 1 Error on packet conversion
346  */
348  uint event_len = uint4korr(((uchar *)(packet->payload)) + EVENT_LEN_OFFSET);
349  Binlog_read_error binlog_read_error = binlog_event_deserialize(
350  packet->payload, event_len, format_descriptor, true, &log_event);
351 
352  if (unlikely(binlog_read_error.has_error())) {
353  LogPluginErr(ERROR_LEVEL, ER_GRP_RPL_UNABLE_TO_CONVERT_PACKET_TO_EVENT,
354  binlog_read_error.get_str()); /* purecov: inspected */
355  }
356 
357  delete packet;
358  packet = NULL;
359 
360  return binlog_read_error.has_error();
361  }
362 
363  /**
364  Converts the existing log event into a packet.
365 
366  @return the operation status
367  @retval 0 OK
368  @retval !=0 Error on log event conversion
369  */
371  int error = 0;
373 
374  if ((error = log_event->write(&ostream))) {
375  LogPluginErr(ERROR_LEVEL, ER_GRP_RPL_UNABLE_TO_CONVERT_EVENT_TO_PACKET,
376  "Out of memory"); /* purecov: inspected */
377  return error; /* purecov: inspected */
378  }
379 
380  packet = new Data_packet(reinterpret_cast<const uchar *>(ostream.c_ptr()),
381  ostream.length());
382 
383  delete log_event;
384  log_event = NULL;
385 
386  return error;
387  }
388 
389  private:
393  /* Format description event used on conversions */
396  std::list<Gcs_member_identifier> *m_online_members;
398 };
399 
400 /**
401  @class Continuation
402 
403  Class used to wait on the execution of some action.
404  The class can also be used to report whenever a transaction is discarded
405  as a result of execution.
406 */
408  public:
413  }
414 
418  }
419 
420  /**
421  Wait until release.
422 
423  @note The continuation will not wait if an error as occurred in the past
424  until reset_error_code() is invoked.
425 
426  @return the end status
427  @retval 0 OK
428  @retval !=0 Error returned on the execution
429  */
430  int wait() {
432  while (!ready && !error_code) {
433  mysql_cond_wait(&cond, &lock); /* purecov: inspected */
434  }
435  ready = false;
437 
438  return error_code;
439  }
440 
441  /**
442  Signal the continuation that execution can continue.
443 
444  @param[in] error the error code if any
445  @param[in] tran_discarded if the transaction to whom the event belongs
446  was discarded
447  */
448  void signal(int error = 0, bool tran_discarded = false) {
449  transaction_discarded = tran_discarded;
450  error_code = error;
451 
453  ready = true;
456  }
457 
458  /**
459  Reset the error code after a reported error.
460  */
461  void reset_error_code() { error_code = 0; }
462 
463  /**
464  Sets the value of the flag for discarded transactions.
465 
466  @param[in] discarded is the transaction discarded.
467  */
468  void set_transation_discarded(bool discarded) {
469  transaction_discarded = discarded;
470  }
471 
472  /**
473  Says if a transaction was discarded or not.
474 
475  @return the transaction discarded flag
476  @retval 0 not discarded
477  @retval !=0 discarded
478  */
480 
481  private:
484  bool ready;
487 };
488 
489 /**
490  @class Pipeline_action
491 
492  A wrapper for pipeline actions.
493  Pipeline actions, unlike normal events, do not transport data but execution
494  instructions to be executed.
495 
496  @note On pipelines, actions unlike events, when submitted are always executed
497  synchronously, meaning that when the call returns all handlers already
498  processed it.
499  Actions are good for executing start and stop actions for example, but
500  also for configuring handlers.
501 */
503  public:
504  Pipeline_action(int action_type) { type = action_type; }
505 
506  virtual ~Pipeline_action() {}
507 
508  /**
509  Returns this action type.
510  The type must be defined in all child classes.
511  Different developing contexts can mean different sets of actions.
512 
513  @return the action type
514  */
515  int get_action_type() { return type; }
516 
517  private:
518  int type;
519 };
520 
521 /**
522  @class Event_handler
523 
524  Interface for the application of events, them being packets or log events.
525  Instances of this class can be composed among them to form execution
526  pipelines.
527 
528  Handlers can also have roles that define their type of activity and can be
529  used to identify them in a pipeline.
530  Roles are defined by the user of this class according to his context.
531 */
533  public:
535 
536  virtual ~Event_handler() {}
537 
538  /**
539  Initialization as defined in the handler implementation.
540 
541  @note It's up to the developer to decide its own initialization strategy,
542  but the suggested approach is to initialize basic structures here and
543  then depend on Action packets to configure and start existing handler
544  routines.
545  */
546  virtual int initialize() = 0;
547 
548  /**
549  Terminate the execution as defined in the handler implementation.
550  */
551  virtual int terminate() = 0;
552 
553  /**
554  Handling of an event as defined in the handler implementation.
555 
556  As the handler can be included in a pipeline, somewhere in the
557  method, the handler.next(event,continuation) method shall be
558  invoked to allow the passing of the event to the next handler.
559 
560  Also, if an error occurs, the continuation object shall be used to
561  propagate such error. This class can also be used to know/report
562  when the transaction to whom the event belongs was discarded.
563 
564  @param[in] event the pipeline event to be handled
565  @param[in,out] continuation termination notification object.
566  */
567  virtual int handle_event(Pipeline_event *event,
568  Continuation *continuation) = 0;
569 
570  /**
571  Handling of an action as defined in the handler implementation.
572 
573  As the handler can be included in a pipeline, somewhere in the
574  method, the handler.next(action) method shall be invoked to allow
575  the passing of the action to the next handler.
576 
577  @note Actions should not be treated asynchronously and as so, Continuations
578  are not used here. Errors are returned directly or passed by in the action
579  if it includes support for such
580 
581  @param[in] action the pipeline event to be handled
582  */
583  virtual int handle_action(Pipeline_action *action) = 0;
584 
585  // pipeline appending methods
586 
587  /**
588  Plug an handler to be the next in line for execution.
589 
590  @param[in] next_handler the next handler in line
591  */
592  void plug_next_handler(Event_handler *next_handler) {
593  next_in_pipeline = next_handler;
594  }
595 
596  /**
597  Append an handler to be the last in line for execution.
598 
599  @param[in] last_handler the last handler in line
600  */
601  void append(Event_handler *last_handler) {
602  Event_handler *pipeline_iter = this;
603  while (pipeline_iter->next_in_pipeline) {
604  pipeline_iter = pipeline_iter->next_in_pipeline;
605  }
606  pipeline_iter->plug_next_handler(last_handler);
607  }
608 
609  /**
610  Append an handler to a given pipeline.
611 
612  @note if the pipeline is null, the given handler will take its place
613 
614  @param[in,out] pipeline the pipeline to append the handler
615  @param[in] event_handler the event handler to append
616  */
617  static void append_handler(Event_handler **pipeline,
619  if (!(*pipeline))
620  *pipeline = event_handler;
621  else
622  (*pipeline)->append(event_handler);
623  }
624 
625  // pipeline information methods
626 
627  /**
628  Returns an handler that plays the given role
629 
630  @note if the pipeline is null, or the handler is not found, the retrieved
631  handler will be null.
632 
633  @param[in] pipeline the handler pipeline
634  @param[in] role the role to retrieve
635  @param[out] event_handler the retrieved event handler
636  */
637  static void get_handler_by_role(Event_handler *pipeline, int role,
639  *event_handler = NULL;
640 
641  if (pipeline == NULL) return; /* purecov: inspected */
642 
643  Event_handler *pipeline_iter = pipeline;
644  while (pipeline_iter) {
645  if (pipeline_iter->get_role() == role) {
646  *event_handler = pipeline_iter;
647  return;
648  }
649  pipeline_iter = pipeline_iter->next_in_pipeline;
650  }
651  }
652 
653  /**
654  This method identifies the handler as being unique.
655 
656  An handler that is defined as unique is an handler that cannot be used
657  more than once in a pipeline. Such tasks as certification and event
658  application can only be done once. Unique handlers are also the only that,
659  by being one of a kind, can be extracted during the pipeline life allowing
660  dynamic changes to them.
661 
662  @return if the handler is the a unique handler
663  @retval true is a unique handler
664  @retval false is a repeatable handler
665  */
666  virtual bool is_unique() = 0;
667 
668  /**
669  This method returns the handler role.
670  Handlers can have different roles according to the tasks they
671  represent. Is based on this role that certain components can
672  extract and interact with pipeline handlers. This means that if a
673  role is given to a singleton handler, no one else can have that
674  role.
675 
676  @return the handler role
677  */
678  virtual int get_role() = 0;
679 
680  // pipeline destruction methods
681 
682  /**
683  Shutdown and delete all handlers in the pipeline.
684 
685  @return the operation status
686  @retval 0 OK
687  @retval !=0 Error
688  */
690  int error = 0;
691  while (next_in_pipeline != NULL) {
692  Event_handler *pipeline_iter = this;
693  Event_handler *temp_handler = NULL;
694  while (pipeline_iter->next_in_pipeline != NULL) {
695  temp_handler = pipeline_iter;
696  pipeline_iter = pipeline_iter->next_in_pipeline;
697  }
698  if (pipeline_iter->terminate())
699  error = 1; // report an error, but try to finish the job /* purecov:
700  // inspected */
701  delete temp_handler->next_in_pipeline;
702  temp_handler->next_in_pipeline = NULL;
703  }
704  this->terminate();
705  return error;
706  }
707 
708  protected:
709  /**
710  Pass the event to the next handler in line. If none exists, this method
711  will signal the continuation method and exit.
712 
713  @param[in] event the pipeline event to be handled
714  @param[in,out] continuation termination notification object.
715  */
716  int next(Pipeline_event *event, Continuation *continuation) {
717  if (next_in_pipeline)
718  next_in_pipeline->handle_event(event, continuation);
719  else
720  continuation->signal();
721  return 0;
722  }
723 
724  /**
725  Pass the action to the next handler in line.
726  If none exists, this method will return
727 
728  @param[in] action the pipeline action to be handled
729  */
730  int next(Pipeline_action *action) {
731  int error = 0;
732 
734 
735  return error;
736  }
737 
738  private:
739  // The next handler in the pipeline
741 };
742 
743 #endif
Pipeline_action::Pipeline_action
Pipeline_action(int action_type)
Definition: pipeline_interfaces.h:504
mysql_mutex_init
#define mysql_mutex_init(K, M, A)
Definition: mysql_mutex.h:34
Event_handler::next_in_pipeline
Event_handler * next_in_pipeline
Definition: pipeline_interfaces.h:740
Continuation::error_code
int error_code
Definition: pipeline_interfaces.h:485
unlikely
bool unlikely(bool expr)
Definition: my_compiler.h:65
Format_description_log_event
Definition: log_event.h:1588
Pipeline_event::get_FormatDescription
int get_FormatDescription(Format_description_log_event **out_fde)
Return current format description event.
Definition: pipeline_interfaces.h:195
Pipeline_event::reset_pipeline_event
void reset_pipeline_event()
Resets all variables in the event for reuse.
Definition: pipeline_interfaces.h:294
Event_handler::get_handler_by_role
static void get_handler_by_role(Event_handler *pipeline, int role, Event_handler **event_handler)
Returns an handler that plays the given role.
Definition: pipeline_interfaces.h:637
Continuation::~Continuation
~Continuation()
Definition: pipeline_interfaces.h:415
Packet::packet_type
int packet_type
Definition: pipeline_interfaces.h:62
mysql_mutex_lock
#define mysql_mutex_lock(M)
Definition: mysql_mutex.h:44
Pipeline_event
Definition: pipeline_interfaces.h:122
NULL
#define NULL
Definition: types.h:55
Binlog_read_error::get_str
const char * get_str() const
Return error message of the error type.
Definition: binlog_istream.cc:33
Log_event::get_type_code
Log_event_type get_type_code() const
Definition: log_event.h:904
Pipeline_event::set_LogEvent
void set_LogEvent(Log_event *in_event)
Sets the pipeline event's log event.
Definition: pipeline_interfaces.h:225
Pipeline_action::~Pipeline_action
virtual ~Pipeline_action()
Definition: pipeline_interfaces.h:506
Pipeline_event::m_online_members_memory_ownership
bool m_online_members_memory_ownership
Definition: pipeline_interfaces.h:397
Pipeline_event::set_Packet
void set_Packet(Data_packet *in_packet)
Sets the pipeline event's packet.
Definition: pipeline_interfaces.h:234
uint4korr
uint32 uint4korr(const char *pT)
Definition: my_byteorder.h:144
mysql_mutex_t
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:49
Event_handler::handle_event
virtual int handle_event(Pipeline_event *event, Continuation *continuation)=0
Handling of an event as defined in the handler implementation.
Pipeline_event::format_descriptor
Format_description_log_event * format_descriptor
Definition: pipeline_interfaces.h:394
binary_log::Log_event_type
Log_event_type
Enumeration type for the different types of log events.
Definition: binlog_event.h:265
Continuation::ready
bool ready
Definition: pipeline_interfaces.h:484
Continuation::signal
void signal(int error=0, bool tran_discarded=false)
Signal the continuation that execution can continue.
Definition: pipeline_interfaces.h:448
Event_handler::Event_handler
Event_handler()
Definition: pipeline_interfaces.h:534
DATA_PACKET_TYPE
#define DATA_PACKET_TYPE
Definition: pipeline_interfaces.h:38
mysql_cond_broadcast
int(* mysql_cond_broadcast)(mysql_cond_t *that, const char *src_file, unsigned int src_line)
Definition: mysql_cond_service.h:51
true
#define true
Definition: config_static.h:44
StringBuffer_ostream
A basic output stream based on StringBuffer class.
Definition: basic_ostream.h:155
Event_handler
Definition: pipeline_interfaces.h:532
Pipeline_event::m_consistency_level
enum_group_replication_consistency_level m_consistency_level
Definition: pipeline_interfaces.h:395
my_malloc
void * my_malloc(PSI_memory_key key, size_t size, int flags)
Below functions are used by the components.
Definition: my_memory.cc:57
Packet::Packet
Packet(int type)
Create a new generic packet of a certain type.
Definition: pipeline_interfaces.h:52
Packet::~Packet
virtual ~Packet()
Definition: pipeline_interfaces.h:54
Binlog_read_error::has_error
bool has_error()
Definition: binlog_istream.h:79
Log_event
Definition: log_event.h:647
Continuation::cond
mysql_cond_t cond
Definition: pipeline_interfaces.h:483
Data_packet::m_consistency_level
const enum_group_replication_consistency_level m_consistency_level
Definition: pipeline_interfaces.h:101
Event_handler::handle_action
virtual int handle_action(Pipeline_action *action)=0
Handling of an action as defined in the handler implementation.
Data_packet::payload
uchar * payload
Definition: pipeline_interfaces.h:99
Pipeline_event::get_consistency_level
enum_group_replication_consistency_level get_consistency_level()
Get transaction consistency level.
Definition: pipeline_interfaces.h:309
Data_packet::m_online_members
std::list< Gcs_member_identifier > * m_online_members
Definition: pipeline_interfaces.h:102
Continuation::transaction_discarded
bool transaction_discarded
Definition: pipeline_interfaces.h:486
ERROR_LEVEL
@ ERROR_LEVEL
Definition: my_loglevel.h:34
Pipeline_event::packet
Data_packet * packet
Definition: pipeline_interfaces.h:390
Data_packet::len
ulong len
Definition: pipeline_interfaces.h:100
Log_event::write
virtual bool write(Basic_ostream *ostream)
Definition: log_event.h:892
plugin_psi.h
Continuation::lock
mysql_mutex_t lock
Definition: pipeline_interfaces.h:482
Data_packet
Definition: pipeline_interfaces.h:70
Pipeline_event::get_LogEvent
int get_LogEvent(Log_event **out_event)
Return a log event.
Definition: pipeline_interfaces.h:210
mysql_cond_wait
#define mysql_cond_wait(C, M)
Definition: mysql_cond.h:43
Binlog_read_error
It defines the error types which could happen when reading binlog files or deserializing binlog event...
Definition: binlog_istream.h:36
Continuation::set_transation_discarded
void set_transation_discarded(bool discarded)
Sets the value of the flag for discarded transactions.
Definition: pipeline_interfaces.h:468
UNDEFINED_EVENT_MODIFIER
#define UNDEFINED_EVENT_MODIFIER
Definition: pipeline_interfaces.h:106
Pipeline_event::m_online_members
std::list< Gcs_member_identifier > * m_online_members
Definition: pipeline_interfaces.h:396
Pipeline_action::type
int type
Definition: pipeline_interfaces.h:518
Pipeline_event::get_Packet
int get_Packet(Data_packet **out_packet)
Return a packet.
Definition: pipeline_interfaces.h:246
mysql_cond_init
#define mysql_cond_init(K, C)
Definition: mysql_cond.h:35
uint
unsigned int uint
Definition: uca-dump.cc:29
Pipeline_event::Pipeline_event
Pipeline_event(Data_packet *base_packet, Format_description_log_event *fde_event, int modifier=UNDEFINED_EVENT_MODIFIER, enum_group_replication_consistency_level consistency_level=GROUP_REPLICATION_CONSISTENCY_EVENTUAL, std::list< Gcs_member_identifier > *online_members=NULL)
Create a new pipeline wrapper based on a packet.
Definition: pipeline_interfaces.h:136
Pipeline_event::get_event_type
Log_event_type get_event_type()
Returns the event type.
Definition: pipeline_interfaces.h:260
Pipeline_event::~Pipeline_event
~Pipeline_event()
Definition: pipeline_interfaces.h:175
Pipeline_event::convert_packet_to_log_event
int convert_packet_to_log_event()
Converts the existing packet into a log event.
Definition: pipeline_interfaces.h:347
Pipeline_event::event_context
int event_context
Definition: pipeline_interfaces.h:392
uchar
unsigned char uchar
Definition: my_inttypes.h:51
log_builtins.h
Event_handler::next
int next(Pipeline_action *action)
Pass the action to the next handler in line.
Definition: pipeline_interfaces.h:730
mysql_mutex_unlock
#define mysql_mutex_unlock(M)
Definition: mysql_mutex.h:53
Event_handler::terminate
virtual int terminate()=0
Terminate the execution as defined in the handler implementation.
Pipeline_event::Pipeline_event
Pipeline_event(Log_event *base_event, Format_description_log_event *fde_event, int modifier=UNDEFINED_EVENT_MODIFIER, enum_group_replication_consistency_level consistency_level=GROUP_REPLICATION_CONSISTENCY_EVENTUAL, std::list< Gcs_member_identifier > *online_members=NULL)
Create a new pipeline wrapper based on a log event.
Definition: pipeline_interfaces.h:162
PSI_NOT_INSTRUMENTED
#define PSI_NOT_INSTRUMENTED
Definition: validate_password_imp.cc:38
Continuation::is_transaction_discarded
bool is_transaction_discarded()
Says if a transaction was discarded or not.
Definition: pipeline_interfaces.h:479
Data_packet::Data_packet
Data_packet(const uchar *data, ulong len, enum_group_replication_consistency_level consistency_level=GROUP_REPLICATION_CONSISTENCY_EVENTUAL, std::list< Gcs_member_identifier > *online_members=NULL)
Create a new data packet wrapper.
Definition: pipeline_interfaces.h:81
Pipeline_action
Definition: pipeline_interfaces.h:502
MY_MUTEX_INIT_FAST
#define MY_MUTEX_INIT_FAST
Definition: thr_mutex.h:66
Event_handler::is_unique
virtual bool is_unique()=0
This method identifies the handler as being unique.
binlog_event_deserialize
Binlog_read_error::Error_type binlog_event_deserialize(const unsigned char *buffer, unsigned int event_len, const Format_description_event *fde, bool verify_checksum, Log_event **event)
Deserialize a binlog event from event_data.
Definition: binlog_reader.cc:109
String::c_ptr
char * c_ptr()
Definition: sql_string.h:248
Packet::get_packet_type
int get_packet_type()
Definition: pipeline_interfaces.h:59
Continuation::reset_error_code
void reset_error_code()
Reset the error code after a reported error.
Definition: pipeline_interfaces.h:461
Event_handler::append
void append(Event_handler *last_handler)
Append an handler to be the last in line for execution.
Definition: pipeline_interfaces.h:601
EVENT_TYPE_OFFSET
#define EVENT_TYPE_OFFSET
Definition: binlog_event.h:382
Event_handler::next
int next(Pipeline_event *event, Continuation *continuation)
Pass the event to the next handler in line.
Definition: pipeline_interfaces.h:716
String::length
size_t length() const
Definition: sql_string.h:238
Event_handler::get_role
virtual int get_role()=0
This method returns the handler role.
HttpMethod::type
int type
Definition: http_common.h:411
Event_handler::plug_next_handler
void plug_next_handler(Event_handler *next_handler)
Plug an handler to be the next in line for execution.
Definition: pipeline_interfaces.h:592
mysql_cond_destroy
#define mysql_cond_destroy(C)
Definition: mysql_cond.h:39
Packet
Definition: pipeline_interfaces.h:45
MYF
#define MYF(v)
Definition: my_inttypes.h:96
GROUP_REPLICATION_CONSISTENCY_EVENTUAL
@ GROUP_REPLICATION_CONSISTENCY_EVENTUAL
Definition: plugin_group_replication.h:36
my_free
void my_free(void *ptr)
Frees the memory pointed by the ptr.
Definition: my_memory.cc:81
plugin_group_replication.h
Pipeline_event::get_online_members
std::list< Gcs_member_identifier > * get_online_members()
Get the list of ONLINE Group members when a Transaction_with_guarantee_message message was received,...
Definition: pipeline_interfaces.h:328
key_GR_LOCK_pipeline_continuation
PSI_mutex_key key_GR_LOCK_pipeline_continuation
Definition: plugin_psi.h:100
key_GR_COND_pipeline_continuation
PSI_cond_key key_GR_COND_pipeline_continuation
Definition: plugin_psi.h:145
ulong
unsigned long ulong
Definition: my_inttypes.h:48
Continuation::wait
int wait()
Wait until release.
Definition: pipeline_interfaces.h:430
Event_handler::append_handler
static void append_handler(Event_handler **pipeline, Event_handler *event_handler)
Append an handler to a given pipeline.
Definition: pipeline_interfaces.h:617
gcs_member_identifier.h
Event_handler::terminate_pipeline
int terminate_pipeline()
Shutdown and delete all handlers in the pipeline.
Definition: pipeline_interfaces.h:689
Pipeline_action::get_action_type
int get_action_type()
Returns this action type.
Definition: pipeline_interfaces.h:515
Pipeline_event::release_online_members_memory_ownership
void release_online_members_memory_ownership()
Release memory ownership of m_online_members.
Definition: pipeline_interfaces.h:335
mysql_cond_t
An instrumented cond structure.
Definition: mysql_cond_bits.h:49
Data_packet::~Data_packet
~Data_packet()
Definition: pipeline_interfaces.h:94
Continuation::Continuation
Continuation()
Definition: pipeline_interfaces.h:409
EVENT_LEN_OFFSET
#define EVENT_LEN_OFFSET
Definition: binlog_event.h:384
Event_handler::initialize
virtual int initialize()=0
Initialization as defined in the handler implementation.
enum_group_replication_consistency_level
enum_group_replication_consistency_level
Definition: plugin_group_replication.h:34
mysql_mutex_destroy
#define mysql_mutex_destroy(M)
Definition: mysql_mutex.h:39
Pipeline_event::mark_event
void mark_event(int modifier)
Sets the event context flag.
Definition: pipeline_interfaces.h:272
privilege_status::error
@ error
Continuation
Definition: pipeline_interfaces.h:407
Pipeline_event::convert_log_event_to_packet
int convert_log_event_to_packet()
Converts the existing log event into a packet.
Definition: pipeline_interfaces.h:370
Pipeline_event::log_event
Log_event * log_event
Definition: pipeline_interfaces.h:391
Event_handler::~Event_handler
virtual ~Event_handler()
Definition: pipeline_interfaces.h:536
group_replication_priv.h
Pipeline_event::get_event_context
int get_event_context()
Returns the event context flag.
Definition: pipeline_interfaces.h:279
event_handler
static void event_handler(const int fd, const short which, void *arg)
Definition: memcached.c:5667
plugin_server_include.h
false
#define false
Definition: config_static.h:43