Skip to content

Commit

Permalink
CA-380551: bump minimum HA SR size to 4GiB
Browse files Browse the repository at this point in the history
Commit 00cb7f2 changed the default (recommended) size of the redo log to 4GiB,
while keeping the minimum at 256MiB for backwards compatibility with existing VDIs.

However:
* HA must be disabled/re-enabled across updates anyway so backwards compatibility is not needed
* the redo-log on its own is known not to work (bug), keeping backwards compatibility here is not useful
* it makes it more difficult for XenCenter to tell the user when they chose an SR that is too small

If the SR is greater than minimum but below recommended then from the CLI you could still enable HA and create a redo log of the appropriate size,
but not from XenCenter (where the size cannot be chosen).

We could expose a new RO pool field with the minimum size and update clients to use that, but that is unnecessary complication for a very rare use case.

Revert the 'recommended_size' introduction, and instead bump the minimum size.
The existing 'SR.assert_can_host_statefile' can then report an error when the size is wrong and XenCenter can appropriately grey out the choice for the user with the correct message.
(And this method works also for other reasons why we might reject an SR).

Fixes: 00cb7f2 ("redo-log: bump default size to 4GiB")

Signed-off-by: Edwin Török <[email protected]>
  • Loading branch information
edwintorok committed Jul 25, 2023
1 parent 9fce1a2 commit 39a012b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ocaml/database/redo_log.ml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ let mib megabytes =
Int64.of_int megabytes ** 1024L ** 1024L

(* Make sure we have plenty of room for the database *)
let minimum_vdi_size, recommended_vdi_size = (mib 256, mib 4096)
let minimum_vdi_size = mib 4096

let redo_log_sm_config = [("type", "raw")]

Expand Down
3 changes: 0 additions & 3 deletions ocaml/database/redo_log.mli
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ val get_static_device : string -> string option
val minimum_vdi_size : int64
(** Minimum size for redo log VDI *)

val recommended_vdi_size : int64
(** Recommended size for redo log VDI *)

val redo_log_sm_config : (string * string) list
(** SM config for redo log VDI *)

Expand Down
2 changes: 1 addition & 1 deletion ocaml/xapi/xapi_pool.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2858,7 +2858,7 @@ let create_redo_log_vdi ~__context ~sr =
Client.VDI.create ~rpc ~session_id ~name_label:"Metadata redo-log"
~name_description:
"Used when HA is disabled, while extra security is still desired"
~sR:sr ~virtual_size:Redo_log.recommended_vdi_size ~_type:`redo_log
~sR:sr ~virtual_size:Redo_log.minimum_vdi_size ~_type:`redo_log
~sharable:true ~read_only:false ~other_config:[] ~xenstore_data:[]
~sm_config:Redo_log.redo_log_sm_config ~tags:[]
)
Expand Down
2 changes: 1 addition & 1 deletion ocaml/xapi/xapi_sr.ml
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ let find_or_create_metadata_vdi ~__context ~sr =
Helpers.call_api_functions ~__context (fun rpc session_id ->
Client.VDI.create ~rpc ~session_id ~name_label:"Metadata for DR"
~name_description:"Used for disaster recovery" ~sR:sr
~virtual_size:Redo_log.recommended_vdi_size ~_type:`metadata
~virtual_size:Redo_log.minimum_vdi_size ~_type:`metadata
~sharable:false ~read_only:false ~other_config:[]
~xenstore_data:[] ~sm_config:Redo_log.redo_log_sm_config ~tags:[]
)
Expand Down
4 changes: 2 additions & 2 deletions ocaml/xapi/xha_metadata_vdi.ml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ let create ~__context ~sr =
Helpers.call_api_functions ~__context (fun rpc session_id ->
Client.VDI.create ~rpc ~session_id ~name_label:"Metadata for HA"
~name_description:"Used for master failover" ~sR:sr
~virtual_size:Redo_log.recommended_vdi_size ~_type:`redo_log
~sharable:true ~read_only:false ~other_config:[] ~xenstore_data:[]
~virtual_size:Redo_log.minimum_vdi_size ~_type:`redo_log ~sharable:true
~read_only:false ~other_config:[] ~xenstore_data:[]
~sm_config:Redo_log.redo_log_sm_config ~tags:[]
)

Expand Down

0 comments on commit 39a012b

Please sign in to comment.