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