@@ -101,7 +101,14 @@ def wrapper(self: Any, *args: Any, **kwargs: Any) -> HandleCommandResult:
101101
102102
103103class Module (orchestrator .OrchestratorClientMixin , MgrModule ):
104- MODULE_OPTIONS : List [Option ] = []
104+ MODULE_OPTIONS : List [Option ] = [
105+ Option (
106+ 'secondary_zone_period_retry_limit' ,
107+ type = 'int' ,
108+ default = 5 ,
109+ desc = 'RGW module period update retry limit for secondary site'
110+ ),
111+ ]
105112
106113 # These are "native" Ceph options that this module cares about.
107114 NATIVE_OPTIONS : List [Option ] = []
@@ -115,6 +122,9 @@ def __init__(self, *args: Any, **kwargs: Any):
115122 # ensure config options members are initialized; see config_notify()
116123 self .config_notify ()
117124
125+ if TYPE_CHECKING :
126+ self .secondary_zone_period_retry_limit = 5
127+
118128 with self .lock :
119129 self .inited = True
120130 self .env = EnvArgs (RGWAMOrchMgr (self ))
@@ -312,7 +322,7 @@ def _cmd_rgw_zone_create(self,
312322
313323 try :
314324 created_zones = self .rgw_zone_create (zone_name , realm_token , port , placement ,
315- start_radosgw , zone_endpoints , inbuf )
325+ start_radosgw , zone_endpoints , self . secondary_zone_period_retry_limit , inbuf )
316326 return HandleCommandResult (retval = 0 , stdout = f"Zones { ', ' .join (created_zones )} created successfully" )
317327 except RGWAMException as e :
318328 return HandleCommandResult (retval = e .retcode , stderr = f'Failed to create zone: { str (e )} ' )
@@ -324,6 +334,7 @@ def rgw_zone_create(self,
324334 placement : Optional [Union [str , Dict [str , Any ]]] = None ,
325335 start_radosgw : Optional [bool ] = True ,
326336 zone_endpoints : Optional [str ] = None ,
337+ secondary_zone_period_retry_limit : Optional [int ] = None ,
327338 inbuf : Optional [str ] = None ) -> List [str ]:
328339
329340 if inbuf :
@@ -350,7 +361,7 @@ def rgw_zone_create(self,
350361 try :
351362 created_zones = []
352363 for rgw_spec in rgw_specs :
353- RGWAM (self .env ).zone_create (rgw_spec , start_radosgw )
364+ RGWAM (self .env ).zone_create (rgw_spec , start_radosgw , secondary_zone_period_retry_limit )
354365 if rgw_spec .rgw_zone is not None :
355366 created_zones .append (rgw_spec .rgw_zone )
356367 return created_zones
0 commit comments