MySQL 8.0.46
Source Code Documentation
pipeline_interfaces.h
Go to the documentation of this file.
1/* Copyright (c) 2014, 2026, 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);
403
404 if (event_len > packet->len) {
405 LogPluginErr(ERROR_LEVEL, ER_GRP_RPL_UNABLE_TO_CONVERT_PACKET_TO_EVENT,
406 "invalid event length.");
407 return 1;
408 }
409
411 packet->payload, event_len, format_descriptor, true, &log_event);
412
413 if (unlikely(binlog_read_error.has_error())) {
414 LogPluginErr(ERROR_LEVEL, ER_GRP_RPL_UNABLE_TO_CONVERT_PACKET_TO_EVENT,
415 binlog_read_error.get_str()); /* purecov: inspected */
416 }
417
418 delete packet;
419 packet = nullptr;
420
421 return binlog_read_error.has_error();
422 }
423
424 /**
425 Converts the existing log event into a packet.
426
427 @return the operation status
428 @retval 0 OK
429 @retval !=0 Error on log event conversion
430 */
432 int error = 0;
434
435 if ((error = log_event->write(&ostream))) {
436 LogPluginErr(ERROR_LEVEL, ER_GRP_RPL_UNABLE_TO_CONVERT_EVENT_TO_PACKET,
437 "Out of memory"); /* purecov: inspected */
438 return error; /* purecov: inspected */
439 }
440
441 packet = new Data_packet(reinterpret_cast<const uchar *>(ostream.c_ptr()),
442 ostream.length(), key_transaction_data);
443
444 delete log_event;
445 log_event = nullptr;
446
447 return error;
448 }
449
450 private:
454 /* Format description event used on conversions */
460};
461
462/**
463 @class Continuation
464
465 Class used to wait on the execution of some action.
466 The class can also be used to report whenever a transaction is discarded
467 as a result of execution.
468*/
470 public:
475 }
476
480 }
481
482 /**
483 Wait until release.
484
485 @note The continuation will not wait if an error as occurred in the past
486 until reset_error_code() is invoked.
487
488 @return the end status
489 @retval 0 OK
490 @retval !=0 Error returned on the execution
491 */
492 int wait() {
494 while (!ready && !error_code) {
495 mysql_cond_wait(&cond, &lock); /* purecov: inspected */
496 }
497 ready = false;
499
500 return error_code;
501 }
502
503 /**
504 Signal the continuation that execution can continue.
505
506 @param[in] error the error code if any
507 @param[in] tran_discarded if the transaction to whom the event belongs
508 was discarded
509 */
510 void signal(int error = 0, bool tran_discarded = false) {
511 transaction_discarded = tran_discarded;
513
515 ready = true;
518 }
519
520 /**
521 Reset the error code after a reported error.
522 */
524
525 /**
526 Sets the value of the flag for discarded transactions.
527
528 @param[in] discarded is the transaction discarded.
529 */
530 void set_transation_discarded(bool discarded) {
531 transaction_discarded = discarded;
532 }
533
534 /**
535 Says if a transaction was discarded or not.
536
537 @return the transaction discarded flag
538 @retval 0 not discarded
539 @retval !=0 discarded
540 */
542
543 private:
546 bool ready;
549};
550
551/**
552 @class Pipeline_action
553
554 A wrapper for pipeline actions.
555 Pipeline actions, unlike normal events, do not transport data but execution
556 instructions to be executed.
557
558 @note On pipelines, actions unlike events, when submitted are always executed
559 synchronously, meaning that when the call returns all handlers already
560 processed it.
561 Actions are good for executing start and stop actions for example, but
562 also for configuring handlers.
563*/
565 public:
566 Pipeline_action(int action_type) { type = action_type; }
567
568 virtual ~Pipeline_action() = default;
569
570 /**
571 Returns this action type.
572 The type must be defined in all child classes.
573 Different developing contexts can mean different sets of actions.
574
575 @return the action type
576 */
577 int get_action_type() { return type; }
578
579 private:
580 int type;
581};
582
583/**
584 @class Event_handler
585
586 Interface for the application of events, them being packets or log events.
587 Instances of this class can be composed among them to form execution
588 pipelines.
589
590 Handlers can also have roles that define their type of activity and can be
591 used to identify them in a pipeline.
592 Roles are defined by the user of this class according to his context.
593*/
595 public:
597
598 virtual ~Event_handler() = default;
599
600 /**
601 Initialization as defined in the handler implementation.
602
603 @note It's up to the developer to decide its own initialization strategy,
604 but the suggested approach is to initialize basic structures here and
605 then depend on Action packets to configure and start existing handler
606 routines.
607 */
608 virtual int initialize() = 0;
609
610 /**
611 Terminate the execution as defined in the handler implementation.
612 */
613 virtual int terminate() = 0;
614
615 /**
616 Handling of an event as defined in the handler implementation.
617
618 As the handler can be included in a pipeline, somewhere in the
619 method, the handler.next(event,continuation) method shall be
620 invoked to allow the passing of the event to the next handler.
621
622 Also, if an error occurs, the continuation object shall be used to
623 propagate such error. This class can also be used to know/report
624 when the transaction to whom the event belongs was discarded.
625
626 @param[in] event the pipeline event to be handled
627 @param[in,out] continuation termination notification object.
628 */
630 Continuation *continuation) = 0;
631
632 /**
633 Handling of an action as defined in the handler implementation.
634
635 As the handler can be included in a pipeline, somewhere in the
636 method, the handler.next(action) method shall be invoked to allow
637 the passing of the action to the next handler.
638
639 @note Actions should not be treated asynchronously and as so, Continuations
640 are not used here. Errors are returned directly or passed by in the action
641 if it includes support for such
642
643 @param[in] action the pipeline event to be handled
644 */
646
647 // pipeline appending methods
648
649 /**
650 Plug an handler to be the next in line for execution.
651
652 @param[in] next_handler the next handler in line
653 */
654 void plug_next_handler(Event_handler *next_handler) {
655 next_in_pipeline = next_handler;
656 }
657
658 /**
659 Append an handler to be the last in line for execution.
660
661 @param[in] last_handler the last handler in line
662 */
663 void append(Event_handler *last_handler) {
664 Event_handler *pipeline_iter = this;
665 while (pipeline_iter->next_in_pipeline) {
666 pipeline_iter = pipeline_iter->next_in_pipeline;
667 }
668 pipeline_iter->plug_next_handler(last_handler);
669 }
670
671 /**
672 Append an handler to a given pipeline.
673
674 @note if the pipeline is null, the given handler will take its place
675
676 @param[in,out] pipeline the pipeline to append the handler
677 @param[in] event_handler the event handler to append
678 */
679 static void append_handler(Event_handler **pipeline,
680 Event_handler *event_handler) {
681 if (!(*pipeline))
682 *pipeline = event_handler;
683 else
684 (*pipeline)->append(event_handler);
685 }
686
687 // pipeline information methods
688
689 /**
690 Returns an handler that plays the given role
691
692 @note if the pipeline is null, or the handler is not found, the retrieved
693 handler will be null.
694
695 @param[in] pipeline the handler pipeline
696 @param[in] role the role to retrieve
697 @param[out] event_handler the retrieved event handler
698 */
699 static void get_handler_by_role(Event_handler *pipeline, int role,
700 Event_handler **event_handler) {
701 *event_handler = nullptr;
702
703 if (pipeline == nullptr) return; /* purecov: inspected */
704
705 Event_handler *pipeline_iter = pipeline;
706 while (pipeline_iter) {
707 if (pipeline_iter->get_role() == role) {
708 *event_handler = pipeline_iter;
709 return;
710 }
711 pipeline_iter = pipeline_iter->next_in_pipeline;
712 }
713 }
714
715 /**
716 This method identifies the handler as being unique.
717
718 An handler that is defined as unique is an handler that cannot be used
719 more than once in a pipeline. Such tasks as certification and event
720 application can only be done once. Unique handlers are also the only that,
721 by being one of a kind, can be extracted during the pipeline life allowing
722 dynamic changes to them.
723
724 @return if the handler is the a unique handler
725 @retval true is a unique handler
726 @retval false is a repeatable handler
727 */
728 virtual bool is_unique() = 0;
729
730 /**
731 This method returns the handler role.
732 Handlers can have different roles according to the tasks they
733 represent. Is based on this role that certain components can
734 extract and interact with pipeline handlers. This means that if a
735 role is given to a singleton handler, no one else can have that
736 role.
737
738 @return the handler role
739 */
740 virtual int get_role() = 0;
741
742 // pipeline destruction methods
743
744 /**
745 Shutdown and delete all handlers in the pipeline.
746
747 @return the operation status
748 @retval 0 OK
749 @retval !=0 Error
750 */
752 int error = 0;
753 while (next_in_pipeline != nullptr) {
754 Event_handler *pipeline_iter = this;
755 Event_handler *temp_handler = nullptr;
756 while (pipeline_iter->next_in_pipeline != nullptr) {
757 temp_handler = pipeline_iter;
758 pipeline_iter = pipeline_iter->next_in_pipeline;
759 }
760 if (pipeline_iter->terminate())
761 error = 1; // report an error, but try to finish the job /* purecov:
762 // inspected */
763 delete temp_handler->next_in_pipeline;
764 temp_handler->next_in_pipeline = nullptr;
765 }
766 this->terminate();
767 return error;
768 }
769
770 protected:
771 /**
772 Pass the event to the next handler in line. If none exists, this method
773 will signal the continuation method and exit.
774
775 @param[in] event the pipeline event to be handled
776 @param[in,out] continuation termination notification object.
777 */
778 int next(Pipeline_event *event, Continuation *continuation) {
780 next_in_pipeline->handle_event(event, continuation);
781 else
782 continuation->signal();
783 return 0;
784 }
785
786 /**
787 Pass the action to the next handler in line.
788 If none exists, this method will return
789
790 @param[in] action the pipeline action to be handled
791 */
793 int error = 0;
794
796
797 return error;
798 }
799
800 private:
801 // The next handler in the pipeline
803};
804
805#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:469
void reset_error_code()
Reset the error code after a reported error.
Definition: pipeline_interfaces.h:523
void signal(int error=0, bool tran_discarded=false)
Signal the continuation that execution can continue.
Definition: pipeline_interfaces.h:510
mysql_cond_t cond
Definition: pipeline_interfaces.h:545
mysql_mutex_t lock
Definition: pipeline_interfaces.h:544
bool transaction_discarded
Definition: pipeline_interfaces.h:548
~Continuation()
Definition: pipeline_interfaces.h:477
Continuation()
Definition: pipeline_interfaces.h:471
void set_transation_discarded(bool discarded)
Sets the value of the flag for discarded transactions.
Definition: pipeline_interfaces.h:530
int wait()
Wait until release.
Definition: pipeline_interfaces.h:492
int error_code
Definition: pipeline_interfaces.h:547
bool ready
Definition: pipeline_interfaces.h:546
bool is_transaction_discarded()
Says if a transaction was discarded or not.
Definition: pipeline_interfaces.h:541
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:594
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:751
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:699
int next(Pipeline_event *event, Continuation *continuation)
Pass the event to the next handler in line.
Definition: pipeline_interfaces.h:778
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:802
void append(Event_handler *last_handler)
Append an handler to be the last in line for execution.
Definition: pipeline_interfaces.h:663
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:596
void plug_next_handler(Event_handler *next_handler)
Plug an handler to be the next in line for execution.
Definition: pipeline_interfaces.h:654
int next(Pipeline_action *action)
Pass the action to the next handler in line.
Definition: pipeline_interfaces.h:792
static void append_handler(Event_handler **pipeline, Event_handler *event_handler)
Append an handler to a given pipeline.
Definition: pipeline_interfaces.h:679
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:564
virtual ~Pipeline_action()=default
int type
Definition: pipeline_interfaces.h:580
Pipeline_action(int action_type)
Definition: pipeline_interfaces.h:566
int get_action_type()
Returns this action type.
Definition: pipeline_interfaces.h:577
A wrapper for log events/packets.
Definition: pipeline_interfaces.h:128
bool m_online_members_memory_ownership
Definition: pipeline_interfaces.h:458
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:453
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:431
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:455
int get_event_context()
Returns the event context flag.
Definition: pipeline_interfaces.h:289
Data_packet * packet
Definition: pipeline_interfaces.h:451
enum_group_replication_consistency_level m_consistency_level
Definition: pipeline_interfaces.h:456
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:452
Members_list * m_online_members
Definition: pipeline_interfaces.h:457
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:459
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:2883
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