Skip to content

Commit 8fd6804

Browse files
authored
Merge pull request #1948 (ignorable opts in reload_cluster)
Handle node-specific options correctly in reload_cluster
2 parents 9209557 + 6554ab9 commit 8fd6804

27 files changed

+3634
-932
lines changed

big_tests/tests/reload_helper.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
-import(distributed_helper, [rpc/4, rpc/5]).
2828

2929
-define(CTL_RELOAD_OUTPUT_PREFIX,
30-
"# Reloaded: " ++ atom_to_list(ct:get_config({hosts, mim, node}))).
30+
"done").
3131

3232
backup_ejabberd_config_file(Node, Config) ->
3333
{ok, _} = rpc(Node, file, copy, [node_cfg(Node, current, Config),
Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
# Flat options format
2+
3+
`'FLAT'` means that the value was separated into more options. For example,
4+
module options are separated into a list of `module_opt`-s.
5+
6+
Each flat option key starts with an option type:
7+
8+
- `l` - local options
9+
- `h` - local host options
10+
- `g` - global options
11+
12+
# Flat options example
13+
14+
```erlang
15+
{[l,listen],'FLAT'}.
16+
{[l,listener,{5280,{0,0,0,0},tcp},ejabberd_cowboy],'FLAT'}.
17+
{[l,listener_opt,{5280,{0,0,0,0},tcp},ejabberd_cowboy,num_acceptors],10}.
18+
{[l,listener_opt,{5280,{0,0,0,0},tcp},ejabberd_cowboy,transport_options],
19+
[{max_connections,1024}]}.
20+
{[l,listener_opt,{5280,{0,0,0,0},tcp},ejabberd_cowboy,modules],
21+
[{"_","/http-bind",mod_bosh},
22+
{"_","/ws-xmpp",mod_websockets,
23+
[{ejabberd_service,[{access,all},
24+
{shaper_rule,fast},
25+
{ip,{127,0,0,1}},
26+
{password,"secret"}]}]}]}.
27+
{[l,listener,{5285,{0,0,0,0},tcp},ejabberd_cowboy],'FLAT'}.
28+
{[l,listener_opt,{5285,{0,0,0,0},tcp},ejabberd_cowboy,num_acceptors],10}.
29+
{[l,listener_opt,{5285,{0,0,0,0},tcp},ejabberd_cowboy,transport_options],
30+
[{max_connections,1024}]}.
31+
{[l,listener_opt,{5285,{0,0,0,0},tcp},ejabberd_cowboy,ssl],
32+
[{certfile,"priv/ssl/fake_cert.pem"},
33+
{keyfile,"priv/ssl/fake_key.pem"},
34+
{password,[]}]}.
35+
{[l,listener_opt,{5285,{0,0,0,0},tcp},ejabberd_cowboy,modules],
36+
[{"_","/http-bind",mod_bosh},{"_","/ws-xmpp",mod_websockets,[]}]}.
37+
{[l,listener,{8088,{127,0,0,1},tcp},ejabberd_cowboy],'FLAT'}.
38+
{[l,listener_opt,{8088,{127,0,0,1},tcp},ejabberd_cowboy,num_acceptors],10}.
39+
{[l,listener_opt,{8088,{127,0,0,1},tcp},ejabberd_cowboy,transport_options],
40+
[{max_connections,1024}]}.
41+
{[l,listener_opt,{8088,{127,0,0,1},tcp},ejabberd_cowboy,modules],
42+
[{"localhost","/api",mongoose_api_admin,[]}]}.
43+
{[l,listener,{8089,{0,0,0,0},tcp},ejabberd_cowboy],'FLAT'}.
44+
{[l,listener_opt,{8089,{0,0,0,0},tcp},ejabberd_cowboy,num_acceptors],10}.
45+
{[l,listener_opt,{8089,{0,0,0,0},tcp},ejabberd_cowboy,transport_options],
46+
[{max_connections,1024}]}.
47+
{[l,listener_opt,{8089,{0,0,0,0},tcp},ejabberd_cowboy,protocol_options],
48+
[{compress,true}]}.
49+
{[l,listener_opt,{8089,{0,0,0,0},tcp},ejabberd_cowboy,ssl],
50+
[{certfile,"priv/ssl/fake_cert.pem"},
51+
{keyfile,"priv/ssl/fake_key.pem"},
52+
{password,[]}]}.
53+
{[l,listener_opt,{8089,{0,0,0,0},tcp},ejabberd_cowboy,modules],
54+
[{"_","/api/sse",lasse_handler,[mongoose_client_api_sse]},
55+
{"_","/api/messages/[:with]",mongoose_client_api_messages,[]},
56+
{"_","/api/contacts/[:jid]",mongoose_client_api_contacts,[]},
57+
{"_","/api/rooms/[:id]",mongoose_client_api_rooms,[]},
58+
{"_","/api/rooms/:id/users/[:user]",mongoose_client_api_rooms_users,[]},
59+
{"_","/api/rooms/[:id]/messages",mongoose_client_api_rooms_messages,[]}]}.
60+
{[l,listener,{5288,{127,0,0,1},tcp},ejabberd_cowboy],'FLAT'}.
61+
{[l,listener_opt,{5288,{127,0,0,1},tcp},ejabberd_cowboy,num_acceptors],10}.
62+
{[l,listener_opt,{5288,{127,0,0,1},tcp},ejabberd_cowboy,transport_options],
63+
[{max_connections,1024}]}.
64+
{[l,listener_opt,{5288,{127,0,0,1},tcp},ejabberd_cowboy,modules],
65+
[{"localhost","/api",mongoose_api,
66+
[{handlers,[mongoose_api_metrics,mongoose_api_users]}]}]}.
67+
{[l,listener,{5222,{0,0,0,0},tcp},ejabberd_c2s],'FLAT'}.
68+
{[l,listener_opt,{5222,{0,0,0,0},tcp},ejabberd_c2s,certfile],
69+
"priv/ssl/fake_server.pem"}.
70+
{[l,listener_simple_opt,{5222,{0,0,0,0},tcp},ejabberd_c2s,starttls],simple}.
71+
{[l,listener_opt,{5222,{0,0,0,0},tcp},ejabberd_c2s,zlib],10000}.
72+
{[l,listener_opt,{5222,{0,0,0,0},tcp},ejabberd_c2s,access],c2s}.
73+
{[l,listener_opt,{5222,{0,0,0,0},tcp},ejabberd_c2s,shaper],c2s_shaper}.
74+
{[l,listener_opt,{5222,{0,0,0,0},tcp},ejabberd_c2s,max_stanza_size],65536}.
75+
{[l,listener_opt,{5222,{0,0,0,0},tcp},ejabberd_c2s,protocol_options],
76+
["no_sslv3"]}.
77+
{[l,listener_opt,{5222,{0,0,0,0},tcp},ejabberd_c2s,dhfile],
78+
"priv/ssl/fake_dh_server.pem"}.
79+
{[l,listener,{5223,{0,0,0,0},tcp},ejabberd_c2s],'FLAT'}.
80+
{[l,listener_opt,{5223,{0,0,0,0},tcp},ejabberd_c2s,zlib],4096}.
81+
{[l,listener_opt,{5223,{0,0,0,0},tcp},ejabberd_c2s,access],c2s}.
82+
{[l,listener_opt,{5223,{0,0,0,0},tcp},ejabberd_c2s,shaper],c2s_shaper}.
83+
{[l,listener_opt,{5223,{0,0,0,0},tcp},ejabberd_c2s,max_stanza_size],65536}.
84+
{[l,listener,{5269,{0,0,0,0},tcp},ejabberd_s2s_in],'FLAT'}.
85+
{[l,listener_opt,{5269,{0,0,0,0},tcp},ejabberd_s2s_in,shaper],s2s_shaper}.
86+
{[l,listener_opt,{5269,{0,0,0,0},tcp},ejabberd_s2s_in,max_stanza_size],131072}.
87+
{[l,listener_opt,{5269,{0,0,0,0},tcp},ejabberd_s2s_in,protocol_options],
88+
["no_sslv3"]}.
89+
{[l,listener_opt,{5269,{0,0,0,0},tcp},ejabberd_s2s_in,dhfile],
90+
"priv/ssl/fake_dh_server.pem"}.
91+
{[l,listener,{8888,{127,0,0,1},tcp},ejabberd_service],'FLAT'}.
92+
{[l,listener_opt,{8888,{127,0,0,1},tcp},ejabberd_service,access],all}.
93+
{[l,listener_opt,{8888,{127,0,0,1},tcp},ejabberd_service,shaper_rule],fast}.
94+
{[l,listener_opt,{8888,{127,0,0,1},tcp},ejabberd_service,password],"secret"}.
95+
{[l,listener,{8189,{127,0,0,1},tcp},ejabberd_service],'FLAT'}.
96+
{[l,listener_opt,{8189,{127,0,0,1},tcp},ejabberd_service,access],all}.
97+
{[l,listener_opt,{8189,{127,0,0,1},tcp},ejabberd_service,hidden_components],
98+
true}.
99+
{[l,listener_opt,{8189,{127,0,0,1},tcp},ejabberd_service,shaper_rule],fast}.
100+
{[l,listener_opt,{8189,{127,0,0,1},tcp},ejabberd_service,password],"secret"}.
101+
{[l,all_metrics_are_global],false}.
102+
{[l,s2s_certfile],"priv/ssl/fake_server.pem"}.
103+
{[l,node_start],{1530,15976,143119}}.
104+
{[l,odbc_pools],[]}.
105+
{[l,registration_timeout],infinity}.
106+
{[l,outgoing_s2s_port],5299}.
107+
{[l,services],
108+
[{service_admin_extra,[{submods,[node,accounts,sessions,vcard,roster,last,
109+
private,stanza,stats]}]}]}.
110+
{[l,max_fsm_queue],1000}.
111+
{[l,s2s_use_starttls],optional}.
112+
{[h,<<"anonymous.localhost">>,auth_method],anonymous}.
113+
{[h,<<"anonymous.localhost">>,s2s_default_policy],allow}.
114+
{[h,<<"localhost.bis">>,modules],'FLAT'}.
115+
{[h,<<"localhost.bis">>,module,mod_carboncopy],'FLAT'}.
116+
{[h,<<"localhost.bis">>,module,mod_stream_management],'FLAT'}.
117+
{[h,<<"localhost.bis">>,module,mod_muc_commands],'FLAT'}.
118+
{[h,<<"localhost.bis">>,module,mod_amp],'FLAT'}.
119+
{[h,<<"localhost.bis">>,module,mod_offline],'FLAT'}.
120+
{[h,<<"localhost.bis">>,module_opt,mod_offline,access_max_user_messages],
121+
max_user_offline_messages}.
122+
{[h,<<"localhost.bis">>,module,mod_last],'FLAT'}.
123+
{[h,<<"localhost.bis">>,module,mod_roster],'FLAT'}.
124+
{[h,<<"localhost.bis">>,module,mod_bosh],'FLAT'}.
125+
{[h,<<"localhost.bis">>,module,mod_blocking],'FLAT'}.
126+
{[h,<<"localhost.bis">>,module,mod_vcard],'FLAT'}.
127+
{[h,<<"localhost.bis">>,module_opt,mod_vcard,host],"vjud.@HOST@"}.
128+
{[h,<<"localhost.bis">>,module,mod_muc_light_commands],'FLAT'}.
129+
{[h,<<"localhost.bis">>,module,mod_commands],'FLAT'}.
130+
{[h,<<"localhost.bis">>,module,mod_disco],'FLAT'}.
131+
{[h,<<"localhost.bis">>,module_opt,mod_disco,users_can_see_hidden_services],
132+
false}.
133+
{[h,<<"localhost.bis">>,module,mod_privacy],'FLAT'}.
134+
{[h,<<"localhost.bis">>,module,mod_private],'FLAT'}.
135+
{[h,<<"localhost.bis">>,module,mod_sic],'FLAT'}.
136+
{[h,<<"localhost.bis">>,module,mod_adhoc],'FLAT'}.
137+
{[h,<<"localhost.bis">>,module,mod_register],'FLAT'}.
138+
{[h,<<"localhost.bis">>,module_opt,mod_register,welcome_message],{[]}}.
139+
{[h,<<"localhost.bis">>,module_opt,mod_register,ip_access],'FLAT'}.
140+
{[h,<<"localhost.bis">>,module_subopt,mod_register,ip_access,allow],
141+
"127.0.0.0/8"}.
142+
{[h,<<"localhost.bis">>,module_subopt,mod_register,ip_access,deny],
143+
"0.0.0.0/0"}.
144+
{[h,<<"localhost.bis">>,module_opt,mod_register,access],register}.
145+
{[h,<<"localhost">>,modules],'FLAT'}.
146+
{[h,<<"localhost">>,module,mod_carboncopy],'FLAT'}.
147+
{[h,<<"localhost">>,module,mod_stream_management],'FLAT'}.
148+
{[h,<<"localhost">>,module,mod_muc_commands],'FLAT'}.
149+
{[h,<<"localhost">>,module,mod_amp],'FLAT'}.
150+
{[h,<<"localhost">>,module,mod_offline],'FLAT'}.
151+
{[h,<<"localhost">>,module_opt,mod_offline,access_max_user_messages],
152+
max_user_offline_messages}.
153+
{[h,<<"localhost">>,module,mod_last],'FLAT'}.
154+
{[h,<<"localhost">>,module,mod_roster],'FLAT'}.
155+
{[h,<<"localhost">>,module,mod_bosh],'FLAT'}.
156+
{[h,<<"localhost">>,module,mod_blocking],'FLAT'}.
157+
{[h,<<"localhost">>,module,mod_vcard],'FLAT'}.
158+
{[h,<<"localhost">>,module_opt,mod_vcard,host],"vjud.@HOST@"}.
159+
{[h,<<"localhost">>,module,mod_muc_light_commands],'FLAT'}.
160+
{[h,<<"localhost">>,module,mod_commands],'FLAT'}.
161+
{[h,<<"localhost">>,module,mod_disco],'FLAT'}.
162+
{[h,<<"localhost">>,module_opt,mod_disco,users_can_see_hidden_services],false}.
163+
{[h,<<"localhost">>,module,mod_privacy],'FLAT'}.
164+
{[h,<<"localhost">>,module,mod_private],'FLAT'}.
165+
{[h,<<"localhost">>,module,mod_sic],'FLAT'}.
166+
{[h,<<"localhost">>,module,mod_adhoc],'FLAT'}.
167+
{[h,<<"localhost">>,module,mod_register],'FLAT'}.
168+
{[h,<<"localhost">>,module_opt,mod_register,welcome_message],{[]}}.
169+
{[h,<<"localhost">>,module_opt,mod_register,ip_access],'FLAT'}.
170+
{[h,<<"localhost">>,module_subopt,mod_register,ip_access,allow],"127.0.0.0/8"}.
171+
{[h,<<"localhost">>,module_subopt,mod_register,ip_access,deny],"0.0.0.0/0"}.
172+
{[h,<<"localhost">>,module_opt,mod_register,access],register}.
173+
{[h,<<"localhost">>,auth_method],internal}.
174+
{[h,<<"anonymous.localhost">>,auth_opts],[]}.
175+
{[h,<<"fed1">>,s2s_addr],{127,0,0,1}}.
176+
{[h,<<"localhost.bis">>,auth_opts],[]}.
177+
{[h,<<"localhost">>,auth_opts],[]}.
178+
{[h,<<"anonymous.localhost">>,modules],'FLAT'}.
179+
{[h,<<"anonymous.localhost">>,module,mod_carboncopy],'FLAT'}.
180+
{[h,<<"anonymous.localhost">>,module,mod_stream_management],'FLAT'}.
181+
{[h,<<"anonymous.localhost">>,module,mod_muc_commands],'FLAT'}.
182+
{[h,<<"anonymous.localhost">>,module,mod_amp],'FLAT'}.
183+
{[h,<<"anonymous.localhost">>,module,mod_offline],'FLAT'}.
184+
{[h,<<"anonymous.localhost">>,module_opt,mod_offline,access_max_user_messages],
185+
max_user_offline_messages}.
186+
{[h,<<"anonymous.localhost">>,module,mod_last],'FLAT'}.
187+
{[h,<<"anonymous.localhost">>,module,mod_roster],'FLAT'}.
188+
{[h,<<"anonymous.localhost">>,module,mod_bosh],'FLAT'}.
189+
{[h,<<"anonymous.localhost">>,module,mod_blocking],'FLAT'}.
190+
{[h,<<"anonymous.localhost">>,module,mod_vcard],'FLAT'}.
191+
{[h,<<"anonymous.localhost">>,module_opt,mod_vcard,host],"vjud.@HOST@"}.
192+
{[h,<<"anonymous.localhost">>,module,mod_muc_light_commands],'FLAT'}.
193+
{[h,<<"anonymous.localhost">>,module,mod_commands],'FLAT'}.
194+
{[h,<<"anonymous.localhost">>,module,mod_disco],'FLAT'}.
195+
{[h,<<"anonymous.localhost">>,module_opt,mod_disco,
196+
users_can_see_hidden_services],
197+
false}.
198+
{[h,<<"anonymous.localhost">>,module,mod_privacy],'FLAT'}.
199+
{[h,<<"anonymous.localhost">>,module,mod_private],'FLAT'}.
200+
{[h,<<"anonymous.localhost">>,module,mod_sic],'FLAT'}.
201+
{[h,<<"anonymous.localhost">>,module,mod_adhoc],'FLAT'}.
202+
{[h,<<"anonymous.localhost">>,module,mod_register],'FLAT'}.
203+
{[h,<<"anonymous.localhost">>,module_opt,mod_register,welcome_message],{[]}}.
204+
{[h,<<"anonymous.localhost">>,module_opt,mod_register,ip_access],'FLAT'}.
205+
{[h,<<"anonymous.localhost">>,module_subopt,mod_register,ip_access,allow],
206+
"127.0.0.0/8"}.
207+
{[h,<<"anonymous.localhost">>,module_subopt,mod_register,ip_access,deny],
208+
"0.0.0.0/0"}.
209+
{[h,<<"anonymous.localhost">>,module_opt,mod_register,access],register}.
210+
{[h,<<"anonymous.localhost">>,allow_multiple_connections],true}.
211+
{[h,<<"localhost.bis">>,auth_method],internal}.
212+
{[h,<<"localhost.bis">>,s2s_default_policy],allow}.
213+
{[h,<<"localhost">>,s2s_default_policy],allow}.
214+
{[h,<<"anonymous.localhost">>,anonymous_protocol],both}.
215+
```

0 commit comments

Comments
 (0)