Skip to content
This repository was archived by the owner on Feb 8, 2024. It is now read-only.

Commit 520f601

Browse files
author
Mandar Sawant
committed
CORTX-30537: add a way to disable formulaic pool versions
Hare automatically generates formulaic pool versions (i.e. different combinations of layouts) based on the tolerances for failure domains and corresponding layout parameters. In some configuration cases, these multiple poolversions may not be required and in-order to use other fault tolerant and recovery methods (e.g. automatic data recovery on process restart). Thus, there needs to be a way to disable generating formulaic pool versions. Solution: - Add a flag in cdf to disable formulaic pool versions. - Update cfgen to read corresponding flag and skip generating formulaic pool versions. - Add corresponding flag to hare mini-provisioner, set it to False by default. Signed-off-by: Mandar Sawant <[email protected]>
1 parent f8eaf12 commit 520f601

File tree

6 files changed

+11
-2
lines changed

6 files changed

+11
-2
lines changed

cfgen/cfgen

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2014,8 +2014,11 @@ class ConfPool(ToDhall):
20142014
m0conf[parent].mdpool = pool_id
20152015
else:
20162016
assert t is PoolT.sns
2017-
for v in gen_allowances(tolerance):
2018-
ConfPverF.build(m0conf, pool_id, base=pver, allowance=v)
2017+
generate_formulaic_pvers: bool = cluster_desc.get(
2018+
'generate_formulaic_pvers', False)
2019+
if generate_formulaic_pvers:
2020+
for v in gen_allowances(tolerance):
2021+
ConfPverF.build(m0conf, pool_id, base=pver, allowance=v)
20192022

20202023
return pool_id
20212024

cfgen/dhall/types/ClusterDesc.dhall

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ let Pool = ./PoolDesc.dhall
2626

2727
in
2828
{ create_aux : Optional Bool
29+
, generate_formulaic_pvers : Optional Bool
2930
, nodes : List Node
3031
, pools : List Pool
3132
, profiles : Optional (List ./PoolsRef.dhall)

cfgen/examples/singlenode.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ nodes:
4444
# port: 41500
4545
# m0_client_s3: 42500
4646
create_aux: false # optional; supported values: "false" (default), "true"
47+
generate_formulaic_pvers: false # optional; supported values: "false" (default), "true"
4748
pools:
4849
- name: the pool
4950
type: sns # optional; supported values: "sns" (default), "dix", "md"

provisioning/miniprov/hare_mp/cdf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ def _get_cdf_dhall(self) -> str:
378378

379379
params_text = str(
380380
ClusterDesc(create_aux=Maybe(create_aux, 'Bool'),
381+
generate_formulaic_pvers=Maybe(False, 'Bool'),
381382
node_info=DList(nodes, 'List NodeInfo'),
382383
pool_info=DList(pools, 'List PoolInfo'),
383384
profile_info=DList(profiles, 'List ProfileInfo'),

provisioning/miniprov/hare_mp/dhall/gencdf.dhall

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ let ProfileInfo =
7777

7878
let ClusterInfo =
7979
{ create_aux : Optional Bool
80+
, generate_formulaic_pvers: Optional Bool
8081
, node_info: List NodeInfo
8182
, pool_info: List PoolInfo
8283
, profile_info: List ProfileInfo
@@ -116,6 +117,7 @@ let genCdf
116117
: ClusterInfo -> T.ClusterDesc
117118
= \(cluster_info : ClusterInfo)
118119
-> { create_aux = cluster_info.create_aux
120+
, generate_formulaic_pvers = cluster_info.generate_formulaic_pvers
119121
, nodes = Prelude.List.map NodeInfo T.NodeDesc toNodeDesc cluster_info.node_info
120122
, pools = Prelude.List.map PoolInfo T.PoolDesc toPoolDesc cluster_info.pool_info
121123
, profiles = Some cluster_info.profile_info

provisioning/miniprov/hare_mp/types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ class FdmiFilterDesc(DhallTuple):
190190
@dataclass(repr=False)
191191
class ClusterDesc(DhallTuple):
192192
create_aux: Maybe[bool]
193+
generate_formulaic_pvers: Maybe[bool]
193194
node_info: DList[NodeDesc]
194195
pool_info: DList[PoolDesc]
195196
profile_info: DList[ProfileDesc]

0 commit comments

Comments
 (0)