MySQL 9.3.0
Source Code Documentation
group_replication_elect_prefers_most_updated.h
Go to the documentation of this file.
1/* Copyright (c) 2025, 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 GROUP_REPLICATION_PRIMARY_ELECT_PREFER_MOST_UPDATED_SERVICE_H_
25#define GROUP_REPLICATION_PRIMARY_ELECT_PREFER_MOST_UPDATED_SERVICE_H_
26
28#include <stddef.h>
29#include <string>
30
31BEGIN_SERVICE_DEFINITION(group_replication_primary_election)
32
33/**
34 This function SHALL be called whenever the caller wants to
35 update last time most uptodate method was used to order a list of members to
36 select new primary.
37 Members of the group will be ordered by number of transactions
38 applied, following by weight and lexical order.
39
40 @param[in] timestamp String representation of time last change
41 @param[in] transactions_delta Members delta on transactions applied
42
43 @return false success, true on failure.
44*/
45
46DECLARE_BOOL_METHOD(update_primary_election_status,
47 (char *timestamp, uint64_t transactions_delta));
48
49END_SERVICE_DEFINITION(group_replication_primary_election)
50
51#endif // GROUP_REPLICATION_PRIMARY_ELECT_PREFER_MOST_UPDATED_SERVICE_H_
constexpr value_type timestamp
Definition: classic_protocol_constants.h:278
#define END_SERVICE_DEFINITION(name)
A macro to end the last Service definition started with the BEGIN_SERVICE_DEFINITION macro.
Definition: service.h:91
#define BEGIN_SERVICE_DEFINITION(name)
Declares a new Service.
Definition: service.h:86
#define DECLARE_BOOL_METHOD(name, args)
Declares a method that returns bool as a part of the Service definition.
Definition: service.h:112