MySQL 9.2.0
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
management.h
Go to the documentation of this file.
1/* Copyright (c) 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 GR_MANAGEMENT_SERVICES_H
25#define GR_MANAGEMENT_SERVICES_H
26
29#include <chrono>
30#include <ctime>
31#include <string>
32
33// Service name of a service used to leave the group with rejoin option.
34#define GROUP_REPLICATION_MANAGEMENT_SERVICE_NAME \
35 "group_replication.group_replication_management"
36
37/**
38 @class GR_start_time_maintain
39
40 This class is used to maintain the timestamp of GR start.
41 During rejoin GR reset this timestamp to the current time.
42*/
44 private:
45 // Timestamp of GR Start.
46 static std::chrono::steady_clock::time_point gr_start_time;
47
48 public:
49 /**
50 Resets the gr_start_time to now.
51 During rejoin GR start time is reset to now.
52 */
53 static void reset_start_time();
54
55 /**
56 Calculates time difference between GR start and now and does the time
57 comparison with quarantine time.
58
59 @param[in] quarantime_time Quarantine time
60 @param[out] seconds_since_member_join Time difference between GR start and
61 now
62
63 @retval True Difference between GR start and now is bigger then quarantine
64 @retval False Difference between GR start and now is smaller then quarantine
65 */
67 int quarantime_time, unsigned int *seconds_since_member_join);
68};
69
70/*
71 Registers the group_replication_management service.
72 Service group_replication_management can be used to request the member to leave
73 the group with the rejoin option set.
74*/
76
77/*
78 Unregisters the group_replication_management service.
79*/
81#endif // GR_MANAGEMENT_SERVICES_H
This class is used to maintain the timestamp of GR start.
Definition: management.h:43
static bool check_if_quarantine_time_passed(int quarantime_time, unsigned int *seconds_since_member_join)
Calculates time difference between GR start and now and does the time comparison with quarantine time...
Definition: management.cc:38
static std::chrono::steady_clock::time_point gr_start_time
Definition: management.h:46
static void reset_start_time()
Resets the gr_start_time to now.
Definition: management.cc:34
bool unregister_group_replication_management_services()
Definition: management.cc:125
bool register_group_replication_management_services()
Definition: management.cc:107
Declaration of the registry plugin service.