diff --git a/deploy/helm/hbase-operator/crds/crds.yaml b/deploy/helm/hbase-operator/crds/crds.yaml index 1e34b8f2..6a76344a 100644 --- a/deploy/helm/hbase-operator/crds/crds.yaml +++ b/deploy/helm/hbase-operator/crds/crds.yaml @@ -725,13 +725,17 @@ spec: type: boolean type: object regionMover: + default: + ack: null + maxThreads: null + runBeforeShutdown: null description: Before terminating a region server pod, the RegionMover tool can be invoked to transfer local regions to other servers. This may cause a lot of network traffic in the Kubernetes cluster if the entire HBase stacklet is being restarted. The operator will compute a timeout period for the region move that will not exceed the graceful shutdown timeout. - nullable: true properties: ack: description: If enabled (default), the region mover will confirm that regions are available on the source as well as the target pods before and after the move. + nullable: true type: boolean - extraOpts: + additionalMoverOptions: default: [] description: Additional options to pass to the region mover. items: @@ -741,14 +745,12 @@ spec: description: Maximum number of threads to use for moving regions. format: uint16 minimum: 0.0 + nullable: true type: integer runBeforeShutdown: description: Move local regions to other servers before terminating a region server's pod. + nullable: true type: boolean - required: - - ack - - maxThreads - - runBeforeShutdown type: object resources: default: @@ -974,13 +976,17 @@ spec: type: boolean type: object regionMover: + default: + ack: null + maxThreads: null + runBeforeShutdown: null description: Before terminating a region server pod, the RegionMover tool can be invoked to transfer local regions to other servers. This may cause a lot of network traffic in the Kubernetes cluster if the entire HBase stacklet is being restarted. The operator will compute a timeout period for the region move that will not exceed the graceful shutdown timeout. - nullable: true properties: ack: description: If enabled (default), the region mover will confirm that regions are available on the source as well as the target pods before and after the move. + nullable: true type: boolean - extraOpts: + additionalMoverOptions: default: [] description: Additional options to pass to the region mover. items: @@ -990,14 +996,12 @@ spec: description: Maximum number of threads to use for moving regions. format: uint16 minimum: 0.0 + nullable: true type: integer runBeforeShutdown: description: Move local regions to other servers before terminating a region server's pod. + nullable: true type: boolean - required: - - ack - - maxThreads - - runBeforeShutdown type: object resources: default: diff --git a/docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc b/docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc index d9c2b9c2..f58191f2 100644 --- a/docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc +++ b/docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc @@ -41,7 +41,7 @@ spec: runBeforeShutdown: true # <1> maxThreads: 5 # <2> ack: false # <3> - extraOpts: ["--designatedFile", "/path/to/designatedFile"] # <4> + additionalMoverOptions: ["--designatedFile", "/path/to/designatedFile"] # <4> ---- <1>: Run the region mover tool before shutting down the region server. Default is `false`. <2>: Maximum number of threads to use for moving regions. Default is 1. diff --git a/rust/crd/src/lib.rs b/rust/crd/src/lib.rs index 44b9c07b..b1614cd3 100644 --- a/rust/crd/src/lib.rs +++ b/rust/crd/src/lib.rs @@ -534,17 +534,17 @@ pub struct RegionMover { /// source as well as the target pods before and after the move. ack: Option, - /// Additional options to pass to the region mover. - #[serde(default)] - extra_opts: Option, + #[fragment_attrs(serde(flatten))] + cli_opts: Option, } #[derive(Clone, Debug, Eq, Deserialize, JsonSchema, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] #[schemars(deny_unknown_fields)] pub struct RegionMoverExtraCliOpts { - #[serde(flatten)] - pub cli_opts: Vec, + /// Additional options to pass to the region mover. + #[serde(default)] + pub additional_mover_options: Vec, } impl Atomic for RegionMoverExtraCliOpts {} @@ -555,7 +555,7 @@ impl Default for RegionMover { run_before_shutdown: Some(false), max_threads: Some(1), ack: Some(true), - extra_opts: None, + cli_opts: None, } } } @@ -595,6 +595,7 @@ pub struct RegionServerConfig { /// This may cause a lot of network traffic in the Kubernetes cluster if the entire HBase stacklet is being /// restarted. /// The operator will compute a timeout period for the region move that will not exceed the graceful shutdown timeout. + #[fragment_attrs(serde(default))] pub region_mover: RegionMover, } @@ -1170,9 +1171,9 @@ impl AnyServiceConfig { command.extend( config .region_mover - .extra_opts + .cli_opts .iter() - .flat_map(|o| o.cli_opts.clone()) + .flat_map(|o| o.additional_mover_options.clone()) .map(|s| escape(std::borrow::Cow::Borrowed(&s)).to_string()), ); command.join(" ")