File tree 11 files changed +22
-6
lines changed
11 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -219,6 +219,9 @@ let t =
219
219
; field ~qualifier: DynamicRO ~lifecycle: [] ~ty: Int " live_hosts"
220
220
~default_value: (Some (VInt 0L ))
221
221
" Current number of live hosts, according to the cluster stack"
222
+ ; field ~qualifier: DynamicRO ~lifecycle: [] ~ty: Int " expected_hosts"
223
+ ~default_value: (Some (VInt 0L ))
224
+ " Total number of hosts expected by the cluster stack"
222
225
]
223
226
@ allowed_and_current_operations cluster_operation
224
227
@ [
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ open Datamodel_roles
10
10
to leave a gap for potential hotfixes needing to increment the schema version.*)
11
11
let schema_major_vsn = 5
12
12
13
- let schema_minor_vsn = 788
13
+ let schema_minor_vsn = 789
14
14
15
15
(* Historical schema versions just in case this is useful later *)
16
16
let rio_schema_major_vsn = 5
Original file line number Diff line number Diff line change @@ -77,6 +77,8 @@ let prototyped_of_field = function
77
77
Some " 24.3.0"
78
78
| "Cluster_host" , "live" ->
79
79
Some " 24.3.0"
80
+ | "Cluster" , "expected_hosts" ->
81
+ Some " 25.16.0-next"
80
82
| "Cluster" , "live_hosts" ->
81
83
Some " 24.3.0"
82
84
| "Cluster" , "quorum" ->
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ let hash x = Digest.string x |> Digest.to_hex
3
3
(* BEWARE: if this changes, check that schema has been bumped accordingly in
4
4
ocaml/idl/datamodel_common.ml, usually schema_minor_vsn *)
5
5
6
- let last_known_schema_hash = " 0cf3458af211661024fca9c1d0ab34ab "
6
+ let last_known_schema_hash = " 2f80cd8fbfd0eedab4dfe345565bcb64 "
7
7
8
8
let current_schema_hash : string =
9
9
let open Datamodel_types in
Original file line number Diff line number Diff line change @@ -626,12 +626,13 @@ let make_cluster_and_cluster_host ~__context ?(ref = Ref.make ())
626
626
?(token_timeout = Constants. default_token_timeout_s)
627
627
?(token_timeout_coefficient = Constants. default_token_timeout_coefficient_s)
628
628
?(cluster_config = [] ) ?(other_config = [] ) ?(host = Ref. null)
629
- ?(is_quorate = false ) ?(quorum = 0L ) ?(live_hosts = 0L ) () =
629
+ ?(is_quorate = false ) ?(quorum = 0L ) ?(live_hosts = 0L )
630
+ ?(expected_hosts = 0L ) () =
630
631
Db.Cluster. create ~__context ~ref ~uuid ~cluster_token ~pending_forget: []
631
632
~cluster_stack ~cluster_stack_version ~allowed_operations
632
633
~current_operations ~pool_auto_join ~token_timeout
633
634
~token_timeout_coefficient ~cluster_config ~other_config ~is_quorate ~quorum
634
- ~live_hosts ;
635
+ ~live_hosts ~expected_hosts ;
635
636
let cluster_host_ref =
636
637
make_cluster_host ~__context ~cluster: ref ~host ~p IF ()
637
638
in
Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ let test_clusterd_rpc ~__context call =
69
69
; num_times_booted= 1
70
70
; is_quorate= true
71
71
; total_votes= 1
72
+ ; expected_votes= 1
72
73
; quorum= 1
73
74
; quorum_members= Some [me]
74
75
; is_running= true
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ let create_cluster ~__context pool_auto_join =
24
24
~token_timeout_coefficient: Constants. default_token_timeout_coefficient_s
25
25
~allowed_operations: [] ~current_operations: [] ~pool_auto_join
26
26
~cluster_config: [] ~other_config: [] ~pending_forget: [] ~is_quorate: false
27
- ~quorum: 0L ~live_hosts: 0L ;
27
+ ~quorum: 0L ~live_hosts: 0L ~expected_hosts: 0L ;
28
28
cluster_ref
29
29
30
30
let check_cluster_option =
Original file line number Diff line number Diff line change @@ -5132,6 +5132,9 @@ let cluster_record rpc session_id cluster =
5132
5132
; make_field ~name: " live-hosts"
5133
5133
~get: (fun () -> Int64. to_string (x () ).API. cluster_live_hosts)
5134
5134
()
5135
+ ; make_field ~name: " expected-hosts"
5136
+ ~get: (fun () -> Int64. to_string (x () ).API. cluster_expected_hosts)
5137
+ ()
5135
5138
]
5136
5139
}
5137
5140
Original file line number Diff line number Diff line change @@ -159,6 +159,9 @@ type optional_path = string option [@@deriving rpcty]
159
159
type quorum_info = {
160
160
is_quorate : bool
161
161
; total_votes : int
162
+ (* number of nodes that the cluster stack thinks are currently in the cluster *)
163
+ ; expected_votes : int
164
+ (* number of nodes that the cluster stack is expecting to be in the cluster *)
162
165
; quorum : int (* * number of nodes required to form a quorum *)
163
166
; quorum_members : all_members option
164
167
}
@@ -179,6 +182,7 @@ type diagnostics = {
179
182
; is_quorate : bool
180
183
; is_running : bool
181
184
; total_votes : int
185
+ ; expected_votes : int
182
186
; quorum : int
183
187
; quorum_members : all_members option
184
188
; startup_finished : bool
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ let create ~__context ~pIF ~cluster_stack ~pool_auto_join ~token_timeout
96
96
~pending_forget: [] ~pool_auto_join ~token_timeout
97
97
~token_timeout_coefficient ~current_operations: []
98
98
~allowed_operations: [] ~cluster_config: [] ~other_config: []
99
- ~is_quorate: false ~quorum: 0L ~live_hosts: 0L ;
99
+ ~is_quorate: false ~quorum: 0L ~live_hosts: 0L ~expected_hosts: 0L ;
100
100
Db.Cluster_host. create ~__context ~ref: cluster_host_ref
101
101
~uuid: cluster_host_uuid ~cluster: cluster_ref ~host ~enabled: true
102
102
~p IF ~current_operations: [] ~allowed_operations: [] ~other_config: []
Original file line number Diff line number Diff line change @@ -516,6 +516,8 @@ module Watcher = struct
516
516
Db.Cluster. set_quorum ~__context ~self: cluster
517
517
~value: (Int64. of_int diag.quorum) ;
518
518
Db.Cluster. set_live_hosts ~__context ~self: cluster
519
+ ~value: (Int64. of_int diag.total_votes) ;
520
+ Db.Cluster. set_expected_hosts ~__context ~self: cluster
519
521
~value: (Int64. of_int diag.total_votes)
520
522
| Error (InternalError message ) | Error (Unix_error message ) ->
521
523
warn " %s Cannot query diagnostics due to %s, not performing update"
You can’t perform that action at this time.
0 commit comments