1PREFIX	__repmgr
2
3INCLUDE #include "db_int.h"
4INCLUDE #include "dbinc/db_swap.h"
5INCLUDE
6
7BEGIN_MSG handshake
8ARG	port		u_int16_t
9ARG	alignment	u_int16_t
10ARG	ack_policy	u_int32_t
11ARG	flags		u_int32_t
12END
13
14BEGIN_MSG v3handshake
15ARG	port		u_int16_t
16ARG	priority	u_int32_t
17ARG	flags		u_int32_t
18END
19
20BEGIN_MSG v2handshake
21ARG	port		u_int16_t
22ARG	priority	u_int32_t
23END
24
25BEGIN_MSG parm_refresh
26ARG	ack_policy	u_int32_t
27ARG	flags		u_int32_t
28END
29
30BEGIN_MSG v6permlsn
31ARG	generation	u_int32_t
32ARG	lsn		DB_LSN
33END
34
35BEGIN_MSG permlsn
36ARG	generation	u_int32_t
37ARG	lsn		DB_LSN
38ARG	last_ckp_lsn	DB_LSN
39END
40
41BEGIN_MSG heartbeat
42ARG	generation	u_int32_t
43ARG	lsn		DB_LSN
44END
45
46BEGIN_MSG readonly_response
47ARG	generation	u_int32_t
48ARG	lsn		DB_LSN
49END
50
51BEGIN_MSG version_proposal
52ARG	min		u_int32_t
53ARG	max		u_int32_t
54END
55
56BEGIN_MSG version_confirmation
57ARG	version		u_int32_t
58END
59
60BEGIN_MSG msg_hdr
61ARG	type		u_int8_t
62ARG	word1		u_int32_t
63ARG	word2		u_int32_t
64END
65
66/* Metadata that goes along with user message on a DB_CHANNEL. */
67BEGIN_MSG msg_metadata
68ARG	tag		u_int32_t
69ARG	limit		u_int32_t
70ARG	flags		u_int32_t
71END
72
73/*
74 * The membership database has a record for each site in the group, plus one
75 * extra meta-data record.  The key of the meta-data record has a zero-length
76 * host, and a port value of 0.
77 */
78BEGIN_MSG membership_key check_length
79ARG	host		DBT
80ARG	port		u_int16_t
81END
82
83BEGIN_MSG membership_data
84ARG	status          u_int32_t
85ARG	flags           u_int32_t
86END
87
88BEGIN_MSG v4membership_data
89ARG	flags           u_int32_t
90END
91
92/*
93 * The "format" identifies the content and layout of the records within the
94 * membership database (i.e., some of the items defined here in this *.msg
95 * file).  It should be incremented when the layouts change in future Berkeley
96 * DB releases.  The "version" counts group changes that the application makes
97 * by adding or removing sites; thus it varies dynamically thoughout the life of
98 * a group, during a single release of Berkeley DB.
99 */
100BEGIN_MSG member_metadata
101ARG	format		u_int32_t
102ARG	version		u_int32_t
103END
104
105/*
106 * When a new site wants to join a group, it "guesses" that the configured
107 * "helper" site is the master, and sends the request there.  When that guess
108 * is wrong, the helper site responds with the location of the current master,
109 * in effect "forwarding" the request.
110 */
111BEGIN_MSG gm_fwd check_length
112ARG	host		DBT
113ARG	port		u_int16_t
114ARG	gen		u_int32_t
115END
116
117/* Membership list version header: */
118BEGIN_MSG membr_vers
119ARG	version		u_int32_t
120ARG	gen		u_int32_t
121END
122
123BEGIN_MSG site_info check_length
124ARG	host		DBT
125ARG	port		u_int16_t
126ARG	status		u_int32_t
127ARG	flags		u_int32_t
128END
129
130BEGIN_MSG v4site_info check_length
131ARG	host		DBT
132ARG	port		u_int16_t
133ARG	flags		u_int32_t
134END
135
136/*
137 * If site A breaks or rejects a connection from site B, it first
138 * tries to send B this message containing site A's currently known
139 * membership DB version and site B's status in site A's membership DB.
140 * Site B can use them to decide what to do.  If site B knows of a later
141 * version, it should retry the connection to site A later, polling
142 * until site A catches up.  However, if site B's known version is
143 * less and site B's status is adding in site A's membership DB, it
144 * means that a badly-timed change of master may have caused the current
145 * master to lose B's membership DB update to present, so it should
146 * retry the connection to site A later, otherwise, site B is no longer
147 * in the group and it should shut down and notify the application.
148 */
149BEGIN_MSG connect_reject
150ARG	version		u_int32_t
151ARG	gen		u_int32_t
152ARG	status		u_int32_t
153END
154
155BEGIN_MSG v4connect_reject
156ARG	version		u_int32_t
157ARG	gen		u_int32_t
158END
159
160/*
161 * For preferred master LSN history comparison between the sites.
162 * The next_gen_lsn is [0,0] if the next generation doesn't yet exist.
163 */
164BEGIN_MSG lsnhist_match
165ARG	lsn		DB_LSN
166ARG	hist_sec	u_int32_t
167ARG	hist_nsec	u_int32_t
168ARG	next_gen_lsn	DB_LSN
169END
170