From 4ad793f586b317b283e4ea3c8860f15654eac58a Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Wed, 2 Oct 2024 14:37:39 +0300 Subject: [PATCH 01/51] feat(regionserver): add graceful shutdown configuration Extract region configuration into it's own structure. Refactor the lib and controller modules to work with the new structure in a slightly generic way. --- deploy/helm/hbase-operator/crds/crds.yaml | 20 + rust/crd/src/affinity.rs | 8 +- rust/crd/src/lib.rs | 679 ++++++++++++++---- rust/operator-binary/src/hbase_controller.rs | 121 +--- rust/operator-binary/src/kerberos.rs | 30 +- .../src/operations/graceful_shutdown.rs | 8 +- 6 files changed, 619 insertions(+), 247 deletions(-) diff --git a/deploy/helm/hbase-operator/crds/crds.yaml b/deploy/helm/hbase-operator/crds/crds.yaml index 9269adaa..3d8db9d3 100644 --- a/deploy/helm/hbase-operator/crds/crds.yaml +++ b/deploy/helm/hbase-operator/crds/crds.yaml @@ -630,6 +630,16 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true type: object + gracefulShutdownRegionMoverOpts: + nullable: true + properties: + args: + items: + type: string + type: array + required: + - args + type: object gracefulShutdownTimeout: description: Time period Pods have to gracefully shut down, e.g. `30m`, `1h` or `2d`. Consult the operator documentation for details. nullable: true @@ -853,6 +863,16 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true type: object + gracefulShutdownRegionMoverOpts: + nullable: true + properties: + args: + items: + type: string + type: array + required: + - args + type: object gracefulShutdownTimeout: description: Time period Pods have to gracefully shut down, e.g. `30m`, `1h` or `2d`. Consult the operator documentation for details. nullable: true diff --git a/rust/crd/src/affinity.rs b/rust/crd/src/affinity.rs index f4b9c7bf..12d86a9e 100644 --- a/rust/crd/src/affinity.rs +++ b/rust/crd/src/affinity.rs @@ -123,13 +123,15 @@ mod tests { replicas: 1 "#; let hbase: HbaseCluster = serde_yaml::from_str(input).expect("illegal test input"); - let merged_config = hbase + let affinity = hbase .merged_config( &role, "default", &hbase.spec.cluster_config.hdfs_config_map_name, ) - .unwrap(); + .unwrap() + .affinity() + .clone(); let mut expected_affinities = vec![WeightedPodAffinityTerm { pod_affinity_term: PodAffinityTerm { @@ -184,7 +186,7 @@ mod tests { }; assert_eq!( - merged_config.affinity, + affinity, StackableAffinity { pod_affinity: Some(PodAffinity { preferred_during_scheduling_ignored_during_execution: Some(expected_affinities), diff --git a/rust/crd/src/lib.rs b/rust/crd/src/lib.rs index 43572e26..0a66640b 100644 --- a/rust/crd/src/lib.rs +++ b/rust/crd/src/lib.rs @@ -1,8 +1,8 @@ -use std::{collections::BTreeMap, str::FromStr}; - +use product_config::types::PropertyNameKind; use security::AuthenticationConfig; use serde::{Deserialize, Serialize}; use snafu::{OptionExt, ResultExt, Snafu}; +use stackable_operator::k8s_openapi::api::core::v1::PodTemplateSpec; use stackable_operator::{ commons::{ affinity::StackableAffinity, @@ -15,17 +15,19 @@ use stackable_operator::{ }, config::{ fragment::{self, Fragment, ValidationError}, - merge::Merge, + merge::{Atomic, Merge}, }, - k8s_openapi::{api::core::v1::EnvVar, apimachinery::pkg::api::resource::Quantity}, + k8s_openapi::{api::core::v1::EnvVar, apimachinery::pkg::api::resource::Quantity, DeepMerge}, kube::{runtime::reflector::ObjectRef, CustomResource, ResourceExt}, product_config_utils::Configuration, product_logging::{self, spec::Logging}, - role_utils::{GenericRoleConfig, Role, RoleGroup, RoleGroupRef}, + role_utils::{GenericRoleConfig, Role, RoleGroupRef}, schemars::{self, JsonSchema}, status::condition::{ClusterCondition, HasStatusCondition}, time::Duration, }; +use std::collections::BTreeMap; +use std::collections::HashMap; use strum::{Display, EnumIter, EnumString}; use crate::affinity::get_affinity; @@ -89,6 +91,9 @@ const DEFAULT_REST_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT: Duration = Duration::from_m #[derive(Snafu, Debug)] pub enum Error { + #[snafu(display("expected role [{expected}] but got role [{got}]"))] + ExpectedRole { expected: String, got: String }, + #[snafu(display("the role [{role}] is invalid and does not exist in HBase"))] InvalidRole { source: strum::ParseError, @@ -103,6 +108,12 @@ pub enum Error { #[snafu(display("fragment validation failure"))] FragmentValidationFailure { source: ValidationError }, + + #[snafu(display("object defines no master role"))] + NoMasterRole, + + #[snafu(display("object defines no regionserver role"))] + NoRegionServerRole, } /// An HBase cluster stacklet. This resource is managed by the Stackable operator for Apache HBase. @@ -145,7 +156,7 @@ pub struct HbaseClusterSpec { /// Region servers hold the data and handle requests from clients for their region. #[serde(default, skip_serializing_if = "Option::is_none")] - pub region_servers: Option>, + pub region_servers: Option>, /// Rest servers provide a REST API to interact with. #[serde(default, skip_serializing_if = "Option::is_none")] @@ -263,63 +274,6 @@ pub enum HbaseRole { } impl HbaseRole { - pub fn default_config( - &self, - cluster_name: &str, - hdfs_discovery_cm_name: &str, - ) -> HbaseConfigFragment { - let resources = match &self { - HbaseRole::Master => ResourcesFragment { - cpu: CpuLimitsFragment { - min: Some(Quantity("250m".to_owned())), - max: Some(Quantity("1".to_owned())), - }, - memory: MemoryLimitsFragment { - limit: Some(Quantity("1Gi".to_owned())), - runtime_limits: NoRuntimeLimitsFragment {}, - }, - storage: HbaseStorageConfigFragment {}, - }, - HbaseRole::RegionServer => ResourcesFragment { - cpu: CpuLimitsFragment { - min: Some(Quantity("250m".to_owned())), - max: Some(Quantity("1".to_owned())), - }, - memory: MemoryLimitsFragment { - limit: Some(Quantity("1Gi".to_owned())), - runtime_limits: NoRuntimeLimitsFragment {}, - }, - storage: HbaseStorageConfigFragment {}, - }, - HbaseRole::RestServer => ResourcesFragment { - cpu: CpuLimitsFragment { - min: Some(Quantity("100m".to_owned())), - max: Some(Quantity("400m".to_owned())), - }, - memory: MemoryLimitsFragment { - limit: Some(Quantity("512Mi".to_owned())), - runtime_limits: NoRuntimeLimitsFragment {}, - }, - storage: HbaseStorageConfigFragment {}, - }, - }; - - let graceful_shutdown_timeout = match &self { - HbaseRole::Master => DEFAULT_MASTER_GRACEFUL_SHUTDOWN_TIMEOUT, - HbaseRole::RegionServer => DEFAULT_REGION_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT, - HbaseRole::RestServer => DEFAULT_REST_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT, - }; - - HbaseConfigFragment { - hbase_rootdir: None, - hbase_opts: None, - resources, - logging: product_logging::spec::default_logging(), - affinity: get_affinity(cluster_name, self, hdfs_discovery_cm_name), - graceful_shutdown_timeout: Some(graceful_shutdown_timeout), - } - } - /// Returns the name of the role as it is needed by the `bin/hbase {cli_role_name} start` command. pub fn cli_role_name(&self) -> String { match self { @@ -329,19 +283,82 @@ impl HbaseRole { HbaseRole::RestServer => "rest".to_string(), } } +} - /// We could have different service names depended on the role (e.g. "hbase-master", "hbase-regionserver" and - /// "hbase-restserver"). However this produces error messages such as - /// [RpcServer.priority.RWQ.Fifo.write.handler=0,queue=0,port=16020] security.ShellBasedUnixGroupsMapping: unable to return groups for user hbase-master PartialGroupNameException The user name 'hbase-master' is not found. id: 'hbase-master': no such user - /// or - /// Caused by: org.apache.hadoop.hbase.ipc.RemoteWithExtrasException(org.apache.hadoop.hbase.security.AccessDeniedException): org.apache.hadoop.hbase.security.AccessDeniedException: Insufficient permissions (user=hbase-master/hbase-master-default-1.hbase-master-default.kuttl-test-poetic-sunbeam.svc.cluster.local@CLUSTER.LOCAL, scope=hbase:meta, family=table:state, params=[table=hbase:meta,family=table:state],action=WRITE) - /// - /// Also the documentation states: - /// > A Kerberos principal has three parts, with the form username/fully.qualified.domain.name@YOUR-REALM.COM. We recommend using hbase as the username portion. - /// - /// As a result we use "hbase" everywhere (which e.g. differs from the current hdfs implementation) - pub fn kerberos_service_name(&self) -> &'static str { - "hbase" +fn default_regionserver_config( + cluster_name: &str, + hdfs_discovery_cm_name: &str, +) -> RegionServerConfigFragment { + let resources = ResourcesFragment { + cpu: CpuLimitsFragment { + min: Some(Quantity("250m".to_owned())), + max: Some(Quantity("1".to_owned())), + }, + memory: MemoryLimitsFragment { + limit: Some(Quantity("1Gi".to_owned())), + runtime_limits: NoRuntimeLimitsFragment {}, + }, + storage: HbaseStorageConfigFragment {}, + }; + + RegionServerConfigFragment { + hbase_rootdir: None, + hbase_opts: None, + resources, + logging: product_logging::spec::default_logging(), + affinity: get_affinity( + cluster_name, + &HbaseRole::RegionServer, + hdfs_discovery_cm_name, + ), + graceful_shutdown_timeout: Some(DEFAULT_REGION_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT), + graceful_shutdown_region_mover_opts: Some(CliArgList { args: vec![] }), + } +} + +fn default_rest_config(cluster_name: &str, hdfs_discovery_cm_name: &str) -> HbaseConfigFragment { + let resources = ResourcesFragment { + cpu: CpuLimitsFragment { + min: Some(Quantity("100m".to_owned())), + max: Some(Quantity("400m".to_owned())), + }, + memory: MemoryLimitsFragment { + limit: Some(Quantity("512Mi".to_owned())), + runtime_limits: NoRuntimeLimitsFragment {}, + }, + storage: HbaseStorageConfigFragment {}, + }; + + HbaseConfigFragment { + hbase_rootdir: None, + hbase_opts: None, + resources, + logging: product_logging::spec::default_logging(), + affinity: get_affinity(cluster_name, &HbaseRole::RestServer, hdfs_discovery_cm_name), + graceful_shutdown_timeout: Some(DEFAULT_REST_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT), + } +} + +fn default_master_config(cluster_name: &str, hdfs_discovery_cm_name: &str) -> HbaseConfigFragment { + let resources = ResourcesFragment { + cpu: CpuLimitsFragment { + min: Some(Quantity("250m".to_owned())), + max: Some(Quantity("1".to_owned())), + }, + memory: MemoryLimitsFragment { + limit: Some(Quantity("1Gi".to_owned())), + runtime_limits: NoRuntimeLimitsFragment {}, + }, + storage: HbaseStorageConfigFragment {}, + }; + + HbaseConfigFragment { + hbase_rootdir: None, + hbase_opts: None, + resources, + logging: product_logging::spec::default_logging(), + affinity: get_affinity(cluster_name, &HbaseRole::Master, hdfs_discovery_cm_name), + graceful_shutdown_timeout: Some(DEFAULT_MASTER_GRACEFUL_SHUTDOWN_TIMEOUT), } } @@ -492,6 +509,131 @@ impl Configuration for HbaseConfigFragment { } } +#[derive(Clone, Debug, Default, JsonSchema, PartialEq, Serialize, Deserialize)] +pub struct CliArgList { + // todo how to serialize this properly? + args: Vec, +} + +impl Atomic for CliArgList {} + +impl Merge for CliArgList { + fn merge(&mut self, other: &Self) { + self.args.extend(other.args.clone()); + } +} + +#[derive(Clone, Debug, Default, Fragment, JsonSchema, PartialEq)] +#[fragment_attrs( + derive( + Clone, + Debug, + Default, + Deserialize, + Merge, + JsonSchema, + PartialEq, + Serialize + ), + serde(rename_all = "camelCase") +)] +pub struct RegionServerConfig { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub hbase_rootdir: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub hbase_opts: Option, + #[fragment_attrs(serde(default))] + pub resources: Resources, + #[fragment_attrs(serde(default))] + pub logging: Logging, + #[fragment_attrs(serde(default))] + pub affinity: StackableAffinity, + + /// Time period Pods have to gracefully shut down, e.g. `30m`, `1h` or `2d`. Consult the operator documentation for details. + #[fragment_attrs(serde(default))] + pub graceful_shutdown_timeout: Option, + pub graceful_shutdown_region_mover_opts: CliArgList, +} + +impl Configuration for RegionServerConfigFragment { + type Configurable = HbaseCluster; + + fn compute_env( + &self, + _resource: &Self::Configurable, + _role_name: &str, + ) -> Result>, stackable_operator::product_config_utils::Error> + { + // Maps env var name to env var object. This allows env_overrides to work + // as expected (i.e. users can override the env var value). + let mut vars: BTreeMap> = BTreeMap::new(); + + vars.insert( + "HBASE_CONF_DIR".to_string(), + Some(CONFIG_DIR_NAME.to_string()), + ); + // required by phoenix (for cases where Kerberos is enabled): see https://issues.apache.org/jira/browse/PHOENIX-2369 + vars.insert( + "HADOOP_CONF_DIR".to_string(), + Some(CONFIG_DIR_NAME.to_string()), + ); + Ok(vars) + } + + fn compute_cli( + &self, + _resource: &Self::Configurable, + _role_name: &str, + ) -> Result>, stackable_operator::product_config_utils::Error> + { + Ok(BTreeMap::new()) + } + + fn compute_files( + &self, + _resource: &Self::Configurable, + _role_name: &str, + file: &str, + ) -> Result>, stackable_operator::product_config_utils::Error> + { + let mut result = BTreeMap::new(); + + match file { + HBASE_ENV_SH => { + // The contents of this file cannot be built entirely here because we don't have + // access to the clusterConfig or product version. + // These are needed to set up Kerberos and JMX exporter settings. + // To avoid fragmentation of the code needed to build this file, we moved the + // implementation to the hbase_controller::build_hbase_env_sh() function. + } + HBASE_SITE_XML => { + result.insert( + HBASE_CLUSTER_DISTRIBUTED.to_string(), + Some("true".to_string()), + ); + result.insert( + HBASE_UNSAFE_REGIONSERVER_HOSTNAME_DISABLE_MASTER_REVERSEDNS.to_string(), + Some("true".to_string()), + ); + result.insert( + HBASE_ROOTDIR.to_string(), + Some( + self.hbase_rootdir + .as_deref() + .unwrap_or(HBASE_ROOT_DIR_DEFAULT) + .to_string(), + ), + ); + } + _ => {} + } + + result.retain(|_, maybe_value| maybe_value.is_some()); + + Ok(result) + } +} + #[derive(Clone, Debug, Default, Deserialize, Eq, JsonSchema, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct HbaseClusterStatus { @@ -509,6 +651,281 @@ impl HasStatusCondition for HbaseCluster { } impl HbaseCluster { + /// Retrieve and merge resource configs for role and role groups + pub fn merged_config( + &self, + role: &HbaseRole, + role_group: &str, + hdfs_discovery_cm_name: &str, + ) -> Result, Error> { + match role { + HbaseRole::Master => { + let config = self.merged_master_config(role_group, hdfs_discovery_cm_name)?; + Ok(Box::new(config)) + } + HbaseRole::RegionServer => { + let config = self.merged_regionserver_config(role_group, hdfs_discovery_cm_name)?; + Ok(Box::new(config)) + } + HbaseRole::RestServer => { + let config = self.merged_rest_config(role_group, hdfs_discovery_cm_name)?; + Ok(Box::new(config)) + } + } + } + + fn merged_regionserver_config( + &self, + role_group: &str, + hdfs_discovery_cm_name: &str, + ) -> Result { + let role = HbaseRole::RegionServer; + + // Initialize the result with all default values as baseline + let conf_defaults = default_regionserver_config(&self.name_any(), hdfs_discovery_cm_name); + + let role = self + .spec + .region_servers + .clone() + .context(MissingHbaseRoleSnafu { + role: role.to_string(), + })?; + + // Retrieve role resource config + let mut conf_role = role.config.config.to_owned(); + + // Retrieve rolegroup specific resource config + let mut conf_rolegroup = role + .role_groups + .get(role_group) + .map(|rg| rg.config.config.clone()) + .unwrap_or_default(); + + // Merge more specific configs into default config + // Hierarchy is: + // 1. RoleGroup + // 2. Role + // 3. Default + conf_role.merge(&conf_defaults); + conf_rolegroup.merge(&conf_role); + + tracing::debug!("Merged config: {:?}", conf_rolegroup); + fragment::validate(conf_rolegroup).context(FragmentValidationFailureSnafu) + } + + fn merged_rest_config( + &self, + role_group: &str, + hdfs_discovery_cm_name: &str, + ) -> Result { + let role = HbaseRole::RestServer; + + // Initialize the result with all default values as baseline + let conf_defaults = default_rest_config(&self.name_any(), hdfs_discovery_cm_name); + + let role = self + .spec + .rest_servers + .clone() + .context(MissingHbaseRoleSnafu { + role: role.to_string(), + })?; + + // Retrieve role resource config + let mut conf_role = role.config.config.to_owned(); + + // Retrieve rolegroup specific resource config + let mut conf_rolegroup = role + .role_groups + .get(role_group) + .map(|rg| rg.config.config.clone()) + .unwrap_or_default(); + + // Merge more specific configs into default config + // Hierarchy is: + // 1. RoleGroup + // 2. Role + // 3. Default + conf_role.merge(&conf_defaults); + conf_rolegroup.merge(&conf_role); + + tracing::debug!("Merged config: {:?}", conf_rolegroup); + fragment::validate(conf_rolegroup).context(FragmentValidationFailureSnafu) + } + + fn merged_master_config( + &self, + role_group: &str, + hdfs_discovery_cm_name: &str, + ) -> Result { + let role = HbaseRole::Master; + + // Initialize the result with all default values as baseline + let conf_defaults = default_master_config(&self.name_any(), hdfs_discovery_cm_name); + + let role = self.spec.masters.clone().context(MissingHbaseRoleSnafu { + role: role.to_string(), + })?; + + // Retrieve role resource config + let mut conf_role = role.config.config.to_owned(); + + // Retrieve rolegroup specific resource config + let mut conf_rolegroup = role + .role_groups + .get(role_group) + .map(|rg| rg.config.config.clone()) + .unwrap_or_default(); + + // Merge more specific configs into default config + // Hierarchy is: + // 1. RoleGroup + // 2. Role + // 3. Default + conf_role.merge(&conf_defaults); + conf_rolegroup.merge(&conf_role); + + tracing::debug!("Merged config: {:?}", conf_rolegroup); + fragment::validate(conf_rolegroup).context(FragmentValidationFailureSnafu) + } + + // The result type is only defined once, there is no value in extracting it into a type definition. + #[allow(clippy::type_complexity)] + pub fn build_role_properties( + &self, + ) -> Result< + HashMap< + String, + ( + Vec, + Role>, + ), + >, + Error, + > { + let config_types = vec![ + PropertyNameKind::Env, + PropertyNameKind::File(HBASE_ENV_SH.to_string()), + PropertyNameKind::File(HBASE_SITE_XML.to_string()), + PropertyNameKind::File(SSL_SERVER_XML.to_string()), + PropertyNameKind::File(SSL_CLIENT_XML.to_string()), + PropertyNameKind::File(JVM_SECURITY_PROPERTIES_FILE.to_string()), + ]; + + let mut roles = HashMap::from([( + HbaseRole::Master.to_string(), + ( + config_types.to_owned(), + self.spec + .masters + .clone() + .context(NoMasterRoleSnafu)? + .erase(), + ), + )]); + roles.insert( + HbaseRole::RegionServer.to_string(), + ( + config_types.to_owned(), + self.spec + .region_servers + .clone() + .context(NoRegionServerRoleSnafu)? + .erase(), + ), + ); + + if let Some(rest_servers) = self.spec.rest_servers.as_ref() { + roles.insert( + HbaseRole::RestServer.to_string(), + (config_types, rest_servers.to_owned().erase()), + ); + } + + Ok(roles) + } + + pub fn merge_pod_overrides( + &self, + pod_template: &mut PodTemplateSpec, + role: &HbaseRole, + role_group_ref: &RoleGroupRef, + ) { + let (role_pod_overrides, role_group_pod_overrides) = match role { + HbaseRole::Master => ( + self.spec + .masters + .as_ref() + .map(|r| r.config.pod_overrides.clone()), + self.spec + .masters + .as_ref() + .and_then(|r| r.role_groups.get(&role_group_ref.role_group)) + .map(|r| r.config.pod_overrides.clone()), + ), + HbaseRole::RegionServer => ( + self.spec + .region_servers + .as_ref() + .map(|r| r.config.pod_overrides.clone()), + self.spec + .region_servers + .as_ref() + .and_then(|r| r.role_groups.get(&role_group_ref.role_group)) + .map(|r| r.config.pod_overrides.clone()), + ), + HbaseRole::RestServer => ( + self.spec + .rest_servers + .as_ref() + .map(|r| r.config.pod_overrides.clone()), + self.spec + .rest_servers + .as_ref() + .and_then(|r| r.role_groups.get(&role_group_ref.role_group)) + .map(|r| r.config.pod_overrides.clone()), + ), + }; + + if let Some(rpo) = role_pod_overrides { + pod_template.merge_from(rpo); + } + if let Some(rgpo) = role_group_pod_overrides { + pod_template.merge_from(rgpo); + } + } + + pub fn replicas( + &self, + hbase_role: &HbaseRole, + role_group_ref: &RoleGroupRef, + ) -> Option { + match hbase_role { + HbaseRole::Master => self + .spec + .masters + .as_ref() + .and_then(|r| r.role_groups.get(&role_group_ref.role_group)) + .and_then(|rg| rg.replicas) + .map(i32::from), + HbaseRole::RegionServer => self + .spec + .region_servers + .as_ref() + .and_then(|r| r.role_groups.get(&role_group_ref.role_group)) + .and_then(|rg| rg.replicas) + .map(i32::from), + HbaseRole::RestServer => self + .spec + .rest_servers + .as_ref() + .and_then(|r| r.role_groups.get(&role_group_ref.role_group)) + .and_then(|rg| rg.replicas) + .map(i32::from), + } + } + /// The name of the role-level load-balanced Kubernetes `Service` pub fn server_role_service_name(&self) -> Option { self.metadata.name.clone() @@ -527,35 +944,6 @@ impl HbaseCluster { } } - pub fn get_role(&self, role: &HbaseRole) -> Option<&Role> { - match role { - HbaseRole::Master => self.spec.masters.as_ref(), - HbaseRole::RegionServer => self.spec.region_servers.as_ref(), - HbaseRole::RestServer => self.spec.rest_servers.as_ref(), - } - } - - /// Get the RoleGroup struct for the given ref - pub fn get_role_group( - &self, - rolegroup_ref: &RoleGroupRef, - ) -> Result<&RoleGroup, Error> { - let role_variant = - HbaseRole::from_str(&rolegroup_ref.role).with_context(|_| InvalidRoleSnafu { - role: rolegroup_ref.role.to_owned(), - })?; - let role = self - .get_role(&role_variant) - .with_context(|| MissingHbaseRoleSnafu { - role: role_variant.to_string(), - })?; - role.role_groups - .get(&rolegroup_ref.role_group) - .with_context(|| MissingHbaseRoleGroupSnafu { - role_group: rolegroup_ref.role_group.to_owned(), - }) - } - pub fn role_config(&self, role: &HbaseRole) -> Option<&GenericRoleConfig> { match role { HbaseRole::Master => self.spec.masters.as_ref().map(|m| &m.role_config), @@ -635,42 +1023,6 @@ impl HbaseCluster { } .to_string() } - - /// Retrieve and merge resource configs for role and role groups - pub fn merged_config( - &self, - role: &HbaseRole, - role_group: &str, - hdfs_discovery_cm_name: &str, - ) -> Result { - // Initialize the result with all default values as baseline - let conf_defaults = role.default_config(&self.name_any(), hdfs_discovery_cm_name); - - let role = self.get_role(role).context(MissingHbaseRoleSnafu { - role: role.to_string(), - })?; - - // Retrieve role resource config - let mut conf_role = role.config.config.to_owned(); - - // Retrieve rolegroup specific resource config - let mut conf_rolegroup = role - .role_groups - .get(role_group) - .map(|rg| rg.config.config.clone()) - .unwrap_or_default(); - - // Merge more specific configs into default config - // Hierarchy is: - // 1. RoleGroup - // 2. Role - // 3. Default - conf_role.merge(&conf_defaults); - conf_rolegroup.merge(&conf_role); - - tracing::debug!("Merged config: {:?}", conf_rolegroup); - fragment::validate(conf_rolegroup).context(FragmentValidationFailureSnafu) - } } pub fn merged_env(rolegroup_config: Option<&BTreeMap>) -> Vec { @@ -695,6 +1047,51 @@ pub fn merged_env(rolegroup_config: Option<&BTreeMap>) -> Vec &Resources; + fn logging(&self) -> &Logging; + fn affinity(&self) -> &StackableAffinity; + fn graceful_shutdown_timeout(&self) -> &Option; + fn hbase_opts(&self) -> &Option; +} + +impl UnifiedRoleConfiguration for HbaseConfig { + fn resources(&self) -> &Resources { + &self.resources + } + fn logging(&self) -> &Logging { + &self.logging + } + fn affinity(&self) -> &StackableAffinity { + &self.affinity + } + fn graceful_shutdown_timeout(&self) -> &Option { + &self.graceful_shutdown_timeout + } + fn hbase_opts(&self) -> &Option { + &self.hbase_opts + } +} + +impl UnifiedRoleConfiguration for RegionServerConfig { + fn resources(&self) -> &Resources { + &self.resources + } + fn logging(&self) -> &Logging { + &self.logging + } + fn affinity(&self) -> &StackableAffinity { + &self.affinity + } + fn graceful_shutdown_timeout(&self) -> &Option { + &self.graceful_shutdown_timeout + } + fn hbase_opts(&self) -> &Option { + &self.hbase_opts + } +} + #[cfg(test)] mod tests { use std::collections::{BTreeMap, HashMap}; @@ -759,7 +1156,7 @@ spec: HbaseRole::Master.to_string(), ( vec![PropertyNameKind::Env], - hbase.get_role(&HbaseRole::Master).cloned().unwrap(), + hbase.spec.masters.clone().unwrap(), ), )]); diff --git a/rust/operator-binary/src/hbase_controller.rs b/rust/operator-binary/src/hbase_controller.rs index a4fe62d7..b2a9dcec 100644 --- a/rust/operator-binary/src/hbase_controller.rs +++ b/rust/operator-binary/src/hbase_controller.rs @@ -1,11 +1,4 @@ //! Ensures that `Pod`s are configured and running for each [`HbaseCluster`] -use std::{ - collections::{BTreeMap, HashMap}, - fmt::Write, - str::FromStr, - sync::Arc, -}; - use indoc::formatdoc; use product_config::{ types::PropertyNameKind, @@ -36,7 +29,6 @@ use stackable_operator::{ }, }, apimachinery::pkg::{apis::meta::v1::LabelSelector, util::intstr::IntOrString}, - DeepMerge, }, kube::{runtime::controller::Action, Resource}, kvp::{Label, LabelError, Labels, ObjectLabels}, @@ -51,7 +43,7 @@ use stackable_operator::{ CustomContainerLogConfig, }, }, - role_utils::{GenericRoleConfig, Role, RoleGroupRef}, + role_utils::{GenericRoleConfig, RoleGroupRef}, status::condition::{ compute_conditions, operations::ClusterOperationsConditionBuilder, statefulset::StatefulSetConditionBuilder, @@ -59,12 +51,19 @@ use stackable_operator::{ time::Duration, utils::COMMON_BASH_TRAP_FUNCTIONS, }; +use std::ops::Deref; +use std::{ + collections::{BTreeMap, HashMap}, + fmt::Write, + str::FromStr, + sync::Arc, +}; use strum::{EnumDiscriminants, IntoStaticStr, ParseError}; use stackable_hbase_crd::{ - merged_env, Container, HbaseCluster, HbaseClusterStatus, HbaseConfig, HbaseConfigFragment, - HbaseRole, APP_NAME, CONFIG_DIR_NAME, HBASE_ENV_SH, HBASE_HEAPSIZE, HBASE_MANAGES_ZK, - HBASE_MASTER_OPTS, HBASE_REGIONSERVER_OPTS, HBASE_REST_OPTS, HBASE_REST_PORT_NAME_HTTP, + merged_env, Container, HbaseCluster, HbaseClusterStatus, HbaseRole, UnifiedRoleConfiguration, + APP_NAME, CONFIG_DIR_NAME, HBASE_ENV_SH, HBASE_HEAPSIZE, HBASE_MANAGES_ZK, HBASE_MASTER_OPTS, + HBASE_REGIONSERVER_OPTS, HBASE_REST_OPTS, HBASE_REST_PORT_NAME_HTTP, HBASE_REST_PORT_NAME_HTTPS, HBASE_SITE_XML, JVM_HEAP_FACTOR, JVM_SECURITY_PROPERTIES_FILE, METRICS_PORT, SSL_CLIENT_XML, SSL_SERVER_XML, }; @@ -109,18 +108,15 @@ pub struct Ctx { #[strum_discriminants(derive(IntoStaticStr))] #[allow(clippy::enum_variant_names)] pub enum Error { + #[snafu(display("invalid role properties"))] + RoleProperties { source: stackable_hbase_crd::Error }, + #[snafu(display("object defines no version"))] ObjectHasNoVersion, #[snafu(display("object defines no namespace"))] ObjectHasNoNamespace, - #[snafu(display("object defines no master role"))] - NoMasterRole, - - #[snafu(display("object defines no regionserver role"))] - NoRegionServerRole, - #[snafu(display("failed to calculate global service name"))] GlobalServiceNameNotFound, @@ -320,7 +316,7 @@ pub async fn reconcile_hbase(hbase: Arc, ctx: Arc) -> Result< .await .context(ResolveVectorAggregatorAddressSnafu)?; - let roles = build_roles(&hbase)?; + let roles = hbase.build_role_properties().context(RolePropertiesSnafu)?; let validated_config = validate_all_roles_and_groups_config( &resolved_product_image.app_version_label, @@ -410,7 +406,7 @@ pub async fn reconcile_hbase(hbase: Arc, ctx: Arc) -> Result< &rolegroup, rolegroup_config, &zookeeper_connection_information, - &merged_config, + merged_config.deref(), &resolved_product_image, hbase_opa_config.as_ref(), vector_aggregator_address.as_deref(), @@ -420,7 +416,7 @@ pub async fn reconcile_hbase(hbase: Arc, ctx: Arc) -> Result< &hbase_role, &rolegroup, rolegroup_config, - &merged_config, + merged_config.deref(), &resolved_product_image, )?; cluster_resources @@ -538,7 +534,7 @@ fn build_rolegroup_config_map( rolegroup: &RoleGroupRef, rolegroup_config: &HashMap>, zookeeper_connection_information: &ZookeeperConnectionInformation, - hbase_config: &HbaseConfig, + hbase_config: &(dyn UnifiedRoleConfiguration + Send), resolved_product_image: &ResolvedProductImage, hbase_opa_config: Option<&HbaseOpaConfig>, vector_aggregator_address: Option<&str>, @@ -665,7 +661,7 @@ fn build_rolegroup_config_map( extend_role_group_config_map( rolegroup, vector_aggregator_address, - &hbase_config.logging, + hbase_config.logging(), &mut builder, &resolved_product_image.product_version, ) @@ -746,15 +742,11 @@ fn build_rolegroup_statefulset( hbase_role: &HbaseRole, rolegroup_ref: &RoleGroupRef, rolegroup_config: &HashMap>, - config: &HbaseConfig, + config: &(dyn UnifiedRoleConfiguration + Send), resolved_product_image: &ResolvedProductImage, ) -> Result { let hbase_version = &resolved_product_image.app_version_label; - // In hbase-op the restserver role is optional :/ - let role = hbase.get_role(hbase_role); - let role_group = role.and_then(|r| r.role_groups.get(&rolegroup_ref.role_group)); - let ports = hbase .ports(hbase_role, &resolved_product_image.product_version) .into_iter() @@ -863,7 +855,7 @@ fn build_rolegroup_statefulset( .add_volume_mount("log-config", HBASE_LOG_CONFIG_TMP_DIR) .add_volume_mount("log", STACKABLE_LOG_DIR) .add_container_ports(ports) - .resources(config.resources.clone().into()) + .resources(config.resources().clone().into()) .startup_probe(startup_probe) .liveness_probe(liveness_probe) .readiness_probe(readiness_probe); @@ -883,7 +875,7 @@ fn build_rolegroup_statefulset( pod_builder .metadata(pb_metadata) .image_pull_secrets_from_product_image(resolved_product_image) - .affinity(&config.affinity) + .affinity(config.affinity()) .add_volume(stackable_operator::k8s_openapi::api::core::v1::Volume { name: "hbase-config".to_string(), config_map: Some(ConfigMapVolumeSource { @@ -920,7 +912,7 @@ fn build_rolegroup_statefulset( Some(ContainerLogConfigChoice::Custom(CustomContainerLogConfig { custom: ConfigMapLogConfig { config_map }, })), - }) = config.logging.containers.get(&Container::Hbase) + }) = config.logging().containers.get(&Container::Hbase) { pod_builder.add_volume(Volume { name: "log-config".to_string(), @@ -949,12 +941,12 @@ fn build_rolegroup_statefulset( pod_builder.add_container(hbase_container.build()); // Vector sidecar shall be the last container in the list - if config.logging.enable_vector_agent { + if config.logging().enable_vector_agent { pod_builder.add_container(product_logging::framework::vector_container( resolved_product_image, "hbase-config", "log", - config.logging.containers.get(&Container::Vector), + config.logging().containers.get(&Container::Vector), ResourceRequirementsBuilder::new() .with_cpu_request("250m") .with_cpu_limit("500m") @@ -965,13 +957,7 @@ fn build_rolegroup_statefulset( } let mut pod_template = pod_builder.build_template(); - - if let Some(role) = role { - pod_template.merge_from(role.config.pod_overrides.clone()); - } - if let Some(role_group) = role_group { - pod_template.merge_from(role_group.config.pod_overrides.clone()); - } + hbase.merge_pod_overrides(&mut pod_template, hbase_role, rolegroup_ref); let metadata = ObjectMetaBuilder::new() .name_and_namespace(hbase) @@ -997,7 +983,7 @@ fn build_rolegroup_statefulset( let statefulset_spec = StatefulSetSpec { pod_management_policy: Some("Parallel".to_string()), - replicas: role_group.and_then(|rg| rg.replicas).map(i32::from), + replicas: hbase.replicas(hbase_role, rolegroup_ref), selector: LabelSelector { match_labels: Some(statefulset_match_labels.into()), ..LabelSelector::default() @@ -1014,53 +1000,6 @@ fn build_rolegroup_statefulset( }) } -// The result type is only defined once, there is no value in extracting it into a type definition. -#[allow(clippy::type_complexity)] -fn build_roles( - hbase: &HbaseCluster, -) -> Result, Role)>> { - let config_types = vec![ - PropertyNameKind::Env, - PropertyNameKind::File(HBASE_ENV_SH.to_string()), - PropertyNameKind::File(HBASE_SITE_XML.to_string()), - PropertyNameKind::File(SSL_SERVER_XML.to_string()), - PropertyNameKind::File(SSL_CLIENT_XML.to_string()), - PropertyNameKind::File(JVM_SECURITY_PROPERTIES_FILE.to_string()), - ]; - - let mut roles = HashMap::from([ - ( - HbaseRole::Master.to_string(), - ( - config_types.to_owned(), - hbase - .get_role(&HbaseRole::Master) - .cloned() - .context(NoMasterRoleSnafu)?, - ), - ), - ( - HbaseRole::RegionServer.to_string(), - ( - config_types.to_owned(), - hbase - .get_role(&HbaseRole::RegionServer) - .cloned() - .context(NoRegionServerRoleSnafu)?, - ), - ), - ]); - - if let Some(rest_servers) = hbase.get_role(&HbaseRole::RestServer) { - roles.insert( - HbaseRole::RestServer.to_string(), - (config_types, rest_servers.to_owned()), - ); - } - - Ok(roles) -} - fn write_hbase_env_sh<'a, T>(properties: T) -> String where T: Iterator, @@ -1094,7 +1033,7 @@ pub fn build_recommended_labels<'a>( /// The content of the HBase `hbase-env.sh` file. fn build_hbase_env_sh( - hbase_config: &HbaseConfig, + hbase_config: &(dyn UnifiedRoleConfiguration + Send), role: &HbaseRole, hbase_version: &str, ) -> Result, Error> { @@ -1109,7 +1048,7 @@ fn build_hbase_env_sh( ] .iter() .chain(jmx_system_properties(role, hbase_version).as_slice()) // Add the JMX options - .chain(hbase_config.hbase_opts.as_slice()) // Add the user defined options + .chain(hbase_config.hbase_opts().as_slice()) // Add the user defined options .cloned() .collect::>() .join(" "); @@ -1128,7 +1067,7 @@ fn build_hbase_env_sh( let memory_limit = MemoryQuantity::try_from( hbase_config - .resources + .resources() .memory .limit .as_ref() diff --git a/rust/operator-binary/src/kerberos.rs b/rust/operator-binary/src/kerberos.rs index adbb4604..8cf45ebb 100644 --- a/rust/operator-binary/src/kerberos.rs +++ b/rust/operator-binary/src/kerberos.rs @@ -60,21 +60,21 @@ pub fn kerberos_config_properties(hbase: &HbaseCluster) -> Result BTreeMap Result<(), Error> { @@ -222,7 +222,7 @@ pub fn add_kerberos_pod_config( let kerberos_secret_operator_volume = SecretOperatorVolumeSourceBuilder::new(kerberos_secret_class) .with_service_scope(hbase.name_any()) - .with_kerberos_service_name(role.kerberos_service_name()) + .with_kerberos_service_name(kerberos_service_name()) .with_kerberos_service_name("HTTP") .build() .context(AddKerberosSecretVolumeSnafu)?; @@ -281,3 +281,17 @@ fn principal_host_part(hbase: &HbaseCluster) -> Result { "{hbase_name}.{hbase_namespace}.svc.cluster.local@${{env.KERBEROS_REALM}}" )) } + +/// We could have different service names depended on the role (e.g. "hbase-master", "hbase-regionserver" and +/// "hbase-restserver"). However this produces error messages such as +/// [RpcServer.priority.RWQ.Fifo.write.handler=0,queue=0,port=16020] security.ShellBasedUnixGroupsMapping: unable to return groups for user hbase-master PartialGroupNameException The user name 'hbase-master' is not found. id: 'hbase-master': no such user +/// or +/// Caused by: org.apache.hadoop.hbase.ipc.RemoteWithExtrasException(org.apache.hadoop.hbase.security.AccessDeniedException): org.apache.hadoop.hbase.security.AccessDeniedException: Insufficient permissions (user=hbase-master/hbase-master-default-1.hbase-master-default.kuttl-test-poetic-sunbeam.svc.cluster.local@CLUSTER.LOCAL, scope=hbase:meta, family=table:state, params=[table=hbase:meta,family=table:state],action=WRITE) +/// +/// Also the documentation states: +/// > A Kerberos principal has three parts, with the form username/fully.qualified.domain.name@YOUR-REALM.COM. We recommend using hbase as the username portion. +/// +/// As a result we use "hbase" everywhere (which e.g. differs from the current hdfs implementation) +fn kerberos_service_name() -> &'static str { + "hbase" +} diff --git a/rust/operator-binary/src/operations/graceful_shutdown.rs b/rust/operator-binary/src/operations/graceful_shutdown.rs index 509c3260..e9055cfe 100644 --- a/rust/operator-binary/src/operations/graceful_shutdown.rs +++ b/rust/operator-binary/src/operations/graceful_shutdown.rs @@ -1,5 +1,5 @@ use snafu::{ResultExt, Snafu}; -use stackable_hbase_crd::HbaseConfig; +use stackable_hbase_crd::UnifiedRoleConfiguration; use stackable_operator::builder::pod::PodBuilder; #[derive(Debug, Snafu)] @@ -11,14 +11,14 @@ pub enum Error { } pub fn add_graceful_shutdown_config( - merged_config: &HbaseConfig, + merged_config: &(dyn UnifiedRoleConfiguration + Send), pod_builder: &mut PodBuilder, ) -> Result<(), Error> { // This must be always set by the merge mechanism, as we provide a default value, // users can not disable graceful shutdown. - if let Some(graceful_shutdown_timeout) = merged_config.graceful_shutdown_timeout { + if let Some(graceful_shutdown_timeout) = merged_config.graceful_shutdown_timeout() { pod_builder - .termination_grace_period(&graceful_shutdown_timeout) + .termination_grace_period(graceful_shutdown_timeout) .context(SetTerminationGracePeriodSnafu)?; } From cb232dfcf619ae9f7e931159f8ee69495a03ada7 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Wed, 2 Oct 2024 15:01:19 +0300 Subject: [PATCH 02/51] Make UnifiedRoleConfiguration a sub-trait of Send --- rust/crd/src/lib.rs | 6 ++---- rust/operator-binary/src/hbase_controller.rs | 6 +++--- rust/operator-binary/src/operations/graceful_shutdown.rs | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/rust/crd/src/lib.rs b/rust/crd/src/lib.rs index 0a66640b..21fd6675 100644 --- a/rust/crd/src/lib.rs +++ b/rust/crd/src/lib.rs @@ -657,7 +657,7 @@ impl HbaseCluster { role: &HbaseRole, role_group: &str, hdfs_discovery_cm_name: &str, - ) -> Result, Error> { + ) -> Result, Error> { match role { HbaseRole::Master => { let config = self.merged_master_config(role_group, hdfs_discovery_cm_name)?; @@ -1048,7 +1048,7 @@ pub fn merged_env(rolegroup_config: Option<&BTreeMap>) -> Vec &Resources; fn logging(&self) -> &Logging; fn affinity(&self) -> &StackableAffinity; @@ -1183,8 +1183,6 @@ spec: .map(|env_var| (env_var.name.as_str(), env_var.value.clone())) .collect(); - println!("{:#?}", merged_env); - assert_eq!( Some(&Some("MASTER_RG".to_string())), env_map.get("TEST_VAR") diff --git a/rust/operator-binary/src/hbase_controller.rs b/rust/operator-binary/src/hbase_controller.rs index b2a9dcec..17fa440b 100644 --- a/rust/operator-binary/src/hbase_controller.rs +++ b/rust/operator-binary/src/hbase_controller.rs @@ -534,7 +534,7 @@ fn build_rolegroup_config_map( rolegroup: &RoleGroupRef, rolegroup_config: &HashMap>, zookeeper_connection_information: &ZookeeperConnectionInformation, - hbase_config: &(dyn UnifiedRoleConfiguration + Send), + hbase_config: &dyn UnifiedRoleConfiguration, resolved_product_image: &ResolvedProductImage, hbase_opa_config: Option<&HbaseOpaConfig>, vector_aggregator_address: Option<&str>, @@ -742,7 +742,7 @@ fn build_rolegroup_statefulset( hbase_role: &HbaseRole, rolegroup_ref: &RoleGroupRef, rolegroup_config: &HashMap>, - config: &(dyn UnifiedRoleConfiguration + Send), + config: &dyn UnifiedRoleConfiguration, resolved_product_image: &ResolvedProductImage, ) -> Result { let hbase_version = &resolved_product_image.app_version_label; @@ -1033,7 +1033,7 @@ pub fn build_recommended_labels<'a>( /// The content of the HBase `hbase-env.sh` file. fn build_hbase_env_sh( - hbase_config: &(dyn UnifiedRoleConfiguration + Send), + hbase_config: &dyn UnifiedRoleConfiguration, role: &HbaseRole, hbase_version: &str, ) -> Result, Error> { diff --git a/rust/operator-binary/src/operations/graceful_shutdown.rs b/rust/operator-binary/src/operations/graceful_shutdown.rs index e9055cfe..1792e03a 100644 --- a/rust/operator-binary/src/operations/graceful_shutdown.rs +++ b/rust/operator-binary/src/operations/graceful_shutdown.rs @@ -11,7 +11,7 @@ pub enum Error { } pub fn add_graceful_shutdown_config( - merged_config: &(dyn UnifiedRoleConfiguration + Send), + merged_config: &dyn UnifiedRoleConfiguration, pod_builder: &mut PodBuilder, ) -> Result<(), Error> { // This must be always set by the merge mechanism, as we provide a default value, From dea179d61e0ffa533fa907482a73234944daa464 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Wed, 2 Oct 2024 15:28:58 +0300 Subject: [PATCH 03/51] Replace trait with enum. --- rust/crd/src/lib.rs | 79 +++++++++---------- rust/operator-binary/src/hbase_controller.rs | 15 ++-- .../src/operations/graceful_shutdown.rs | 4 +- 3 files changed, 48 insertions(+), 50 deletions(-) diff --git a/rust/crd/src/lib.rs b/rust/crd/src/lib.rs index 21fd6675..04935a75 100644 --- a/rust/crd/src/lib.rs +++ b/rust/crd/src/lib.rs @@ -657,19 +657,19 @@ impl HbaseCluster { role: &HbaseRole, role_group: &str, hdfs_discovery_cm_name: &str, - ) -> Result, Error> { + ) -> Result { match role { HbaseRole::Master => { let config = self.merged_master_config(role_group, hdfs_discovery_cm_name)?; - Ok(Box::new(config)) + Ok(AnyServiceConfig::Master(config)) } HbaseRole::RegionServer => { let config = self.merged_regionserver_config(role_group, hdfs_discovery_cm_name)?; - Ok(Box::new(config)) + Ok(AnyServiceConfig::RegionServer(config)) } HbaseRole::RestServer => { let config = self.merged_rest_config(role_group, hdfs_discovery_cm_name)?; - Ok(Box::new(config)) + Ok(AnyServiceConfig::RestServer(config)) } } } @@ -1047,48 +1047,47 @@ pub fn merged_env(rolegroup_config: Option<&BTreeMap>) -> Vec &Resources; - fn logging(&self) -> &Logging; - fn affinity(&self) -> &StackableAffinity; - fn graceful_shutdown_timeout(&self) -> &Option; - fn hbase_opts(&self) -> &Option; +pub enum AnyServiceConfig { + Master(HbaseConfig), + RegionServer(RegionServerConfig), + RestServer(HbaseConfig), } -impl UnifiedRoleConfiguration for HbaseConfig { - fn resources(&self) -> &Resources { - &self.resources - } - fn logging(&self) -> &Logging { - &self.logging - } - fn affinity(&self) -> &StackableAffinity { - &self.affinity - } - fn graceful_shutdown_timeout(&self) -> &Option { - &self.graceful_shutdown_timeout - } - fn hbase_opts(&self) -> &Option { - &self.hbase_opts - } -} - -impl UnifiedRoleConfiguration for RegionServerConfig { - fn resources(&self) -> &Resources { - &self.resources +impl AnyServiceConfig { + pub fn resources(&self) -> &Resources { + match self { + AnyServiceConfig::Master(config) => &config.resources, + AnyServiceConfig::RegionServer(config) => &config.resources, + AnyServiceConfig::RestServer(config) => &config.resources, + } } - fn logging(&self) -> &Logging { - &self.logging + pub fn logging(&self) -> &Logging { + match self { + AnyServiceConfig::Master(config) => &config.logging, + AnyServiceConfig::RegionServer(config) => &config.logging, + AnyServiceConfig::RestServer(config) => &config.logging, + } } - fn affinity(&self) -> &StackableAffinity { - &self.affinity + pub fn affinity(&self) -> &StackableAffinity { + match self { + AnyServiceConfig::Master(config) => &config.affinity, + AnyServiceConfig::RegionServer(config) => &config.affinity, + AnyServiceConfig::RestServer(config) => &config.affinity, + } } - fn graceful_shutdown_timeout(&self) -> &Option { - &self.graceful_shutdown_timeout + pub fn graceful_shutdown_timeout(&self) -> &Option { + match self { + AnyServiceConfig::Master(config) => &config.graceful_shutdown_timeout, + AnyServiceConfig::RegionServer(config) => &config.graceful_shutdown_timeout, + AnyServiceConfig::RestServer(config) => &config.graceful_shutdown_timeout, + } } - fn hbase_opts(&self) -> &Option { - &self.hbase_opts + pub fn hbase_opts(&self) -> &Option { + match self { + AnyServiceConfig::Master(config) => &config.hbase_opts, + AnyServiceConfig::RegionServer(config) => &config.hbase_opts, + AnyServiceConfig::RestServer(config) => &config.hbase_opts, + } } } diff --git a/rust/operator-binary/src/hbase_controller.rs b/rust/operator-binary/src/hbase_controller.rs index 17fa440b..b668f18c 100644 --- a/rust/operator-binary/src/hbase_controller.rs +++ b/rust/operator-binary/src/hbase_controller.rs @@ -51,7 +51,6 @@ use stackable_operator::{ time::Duration, utils::COMMON_BASH_TRAP_FUNCTIONS, }; -use std::ops::Deref; use std::{ collections::{BTreeMap, HashMap}, fmt::Write, @@ -61,8 +60,8 @@ use std::{ use strum::{EnumDiscriminants, IntoStaticStr, ParseError}; use stackable_hbase_crd::{ - merged_env, Container, HbaseCluster, HbaseClusterStatus, HbaseRole, UnifiedRoleConfiguration, - APP_NAME, CONFIG_DIR_NAME, HBASE_ENV_SH, HBASE_HEAPSIZE, HBASE_MANAGES_ZK, HBASE_MASTER_OPTS, + merged_env, AnyServiceConfig, Container, HbaseCluster, HbaseClusterStatus, HbaseRole, APP_NAME, + CONFIG_DIR_NAME, HBASE_ENV_SH, HBASE_HEAPSIZE, HBASE_MANAGES_ZK, HBASE_MASTER_OPTS, HBASE_REGIONSERVER_OPTS, HBASE_REST_OPTS, HBASE_REST_PORT_NAME_HTTP, HBASE_REST_PORT_NAME_HTTPS, HBASE_SITE_XML, JVM_HEAP_FACTOR, JVM_SECURITY_PROPERTIES_FILE, METRICS_PORT, SSL_CLIENT_XML, SSL_SERVER_XML, @@ -406,7 +405,7 @@ pub async fn reconcile_hbase(hbase: Arc, ctx: Arc) -> Result< &rolegroup, rolegroup_config, &zookeeper_connection_information, - merged_config.deref(), + &merged_config, &resolved_product_image, hbase_opa_config.as_ref(), vector_aggregator_address.as_deref(), @@ -416,7 +415,7 @@ pub async fn reconcile_hbase(hbase: Arc, ctx: Arc) -> Result< &hbase_role, &rolegroup, rolegroup_config, - merged_config.deref(), + &merged_config, &resolved_product_image, )?; cluster_resources @@ -534,7 +533,7 @@ fn build_rolegroup_config_map( rolegroup: &RoleGroupRef, rolegroup_config: &HashMap>, zookeeper_connection_information: &ZookeeperConnectionInformation, - hbase_config: &dyn UnifiedRoleConfiguration, + hbase_config: &AnyServiceConfig, resolved_product_image: &ResolvedProductImage, hbase_opa_config: Option<&HbaseOpaConfig>, vector_aggregator_address: Option<&str>, @@ -742,7 +741,7 @@ fn build_rolegroup_statefulset( hbase_role: &HbaseRole, rolegroup_ref: &RoleGroupRef, rolegroup_config: &HashMap>, - config: &dyn UnifiedRoleConfiguration, + config: &AnyServiceConfig, resolved_product_image: &ResolvedProductImage, ) -> Result { let hbase_version = &resolved_product_image.app_version_label; @@ -1033,7 +1032,7 @@ pub fn build_recommended_labels<'a>( /// The content of the HBase `hbase-env.sh` file. fn build_hbase_env_sh( - hbase_config: &dyn UnifiedRoleConfiguration, + hbase_config: &AnyServiceConfig, role: &HbaseRole, hbase_version: &str, ) -> Result, Error> { diff --git a/rust/operator-binary/src/operations/graceful_shutdown.rs b/rust/operator-binary/src/operations/graceful_shutdown.rs index 1792e03a..48e06463 100644 --- a/rust/operator-binary/src/operations/graceful_shutdown.rs +++ b/rust/operator-binary/src/operations/graceful_shutdown.rs @@ -1,5 +1,5 @@ use snafu::{ResultExt, Snafu}; -use stackable_hbase_crd::UnifiedRoleConfiguration; +use stackable_hbase_crd::AnyServiceConfig; use stackable_operator::builder::pod::PodBuilder; #[derive(Debug, Snafu)] @@ -11,7 +11,7 @@ pub enum Error { } pub fn add_graceful_shutdown_config( - merged_config: &dyn UnifiedRoleConfiguration, + merged_config: &AnyServiceConfig, pod_builder: &mut PodBuilder, ) -> Result<(), Error> { // This must be always set by the merge mechanism, as we provide a default value, From eecaf23739cce7707a1e57d95477fd7c7082e398 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Wed, 2 Oct 2024 17:12:23 +0300 Subject: [PATCH 04/51] implement region mover command --- deploy/helm/hbase-operator/crds/crds.yaml | 62 ++++++++++------ rust/crd/src/lib.rs | 76 +++++++++++++++++--- rust/operator-binary/src/hbase_controller.rs | 43 ++++++++++- rust/operator-binary/src/kerberos.rs | 5 +- 4 files changed, 150 insertions(+), 36 deletions(-) diff --git a/deploy/helm/hbase-operator/crds/crds.yaml b/deploy/helm/hbase-operator/crds/crds.yaml index 3d8db9d3..070878eb 100644 --- a/deploy/helm/hbase-operator/crds/crds.yaml +++ b/deploy/helm/hbase-operator/crds/crds.yaml @@ -630,16 +630,6 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true type: object - gracefulShutdownRegionMoverOpts: - nullable: true - properties: - args: - items: - type: string - type: array - required: - - args - type: object gracefulShutdownTimeout: description: Time period Pods have to gracefully shut down, e.g. `30m`, `1h` or `2d`. Consult the operator documentation for details. nullable: true @@ -734,6 +724,27 @@ spec: nullable: true type: boolean type: object + regionMover: + nullable: true + properties: + ack: + type: boolean + extra_opts: + items: + type: string + type: array + max_threads: + format: uint16 + minimum: 0.0 + type: integer + run_before_shutdown: + type: boolean + required: + - ack + - extra_opts + - max_threads + - run_before_shutdown + type: object resources: default: cpu: @@ -863,16 +874,6 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true type: object - gracefulShutdownRegionMoverOpts: - nullable: true - properties: - args: - items: - type: string - type: array - required: - - args - type: object gracefulShutdownTimeout: description: Time period Pods have to gracefully shut down, e.g. `30m`, `1h` or `2d`. Consult the operator documentation for details. nullable: true @@ -967,6 +968,27 @@ spec: nullable: true type: boolean type: object + regionMover: + nullable: true + properties: + ack: + type: boolean + extra_opts: + items: + type: string + type: array + max_threads: + format: uint16 + minimum: 0.0 + type: integer + run_before_shutdown: + type: boolean + required: + - ack + - extra_opts + - max_threads + - run_before_shutdown + type: object resources: default: cpu: diff --git a/rust/crd/src/lib.rs b/rust/crd/src/lib.rs index 04935a75..cec32a71 100644 --- a/rust/crd/src/lib.rs +++ b/rust/crd/src/lib.rs @@ -85,8 +85,13 @@ pub const METRICS_PORT: u16 = 9100; pub const JVM_HEAP_FACTOR: f32 = 0.8; const DEFAULT_MASTER_GRACEFUL_SHUTDOWN_TIMEOUT: Duration = Duration::from_minutes_unchecked(20); +// The following three values should be kept in sync so that +// DEFAULT_REGION_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT = DEFAULT_REGION_MOVER_TIMEOUT + DEFAULT_REGION_MOVER_DELTA_TO_SHUTDOWN const DEFAULT_REGION_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT: Duration = Duration::from_minutes_unchecked(60); +// This should always be slightly less than the above +const DEFAULT_REGION_MOVER_TIMEOUT: Duration = Duration::from_minutes_unchecked(59); +const DEFAULT_REGION_MOVER_DELTA_TO_SHUTDOWN: Duration = Duration::from_minutes_unchecked(1); const DEFAULT_REST_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT: Duration = Duration::from_minutes_unchecked(5); #[derive(Snafu, Debug)] @@ -312,7 +317,7 @@ fn default_regionserver_config( hdfs_discovery_cm_name, ), graceful_shutdown_timeout: Some(DEFAULT_REGION_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT), - graceful_shutdown_region_mover_opts: Some(CliArgList { args: vec![] }), + region_mover: Some(RegionMover::default()), } } @@ -509,17 +514,32 @@ impl Configuration for HbaseConfigFragment { } } -#[derive(Clone, Debug, Default, JsonSchema, PartialEq, Serialize, Deserialize)] -pub struct CliArgList { - // todo how to serialize this properly? - args: Vec, +#[derive(Clone, Debug, JsonSchema, PartialEq, Serialize, Deserialize)] +pub struct RegionMover { + run_before_shutdown: bool, + max_threads: u16, + ack: bool, + extra_opts: Vec, } -impl Atomic for CliArgList {} +impl Default for RegionMover { + fn default() -> Self { + Self { + run_before_shutdown: false, + max_threads: 1, + ack: true, + extra_opts: vec![], + } + } +} +impl Atomic for RegionMover {} -impl Merge for CliArgList { +impl Merge for RegionMover { fn merge(&mut self, other: &Self) { - self.args.extend(other.args.clone()); + self.run_before_shutdown = other.run_before_shutdown; + self.max_threads = other.max_threads; + self.ack = other.ack; + self.extra_opts.extend(other.extra_opts.clone()); } } @@ -552,7 +572,7 @@ pub struct RegionServerConfig { /// Time period Pods have to gracefully shut down, e.g. `30m`, `1h` or `2d`. Consult the operator documentation for details. #[fragment_attrs(serde(default))] pub graceful_shutdown_timeout: Option, - pub graceful_shutdown_region_mover_opts: CliArgList, + pub region_mover: RegionMover, } impl Configuration for RegionServerConfigFragment { @@ -1089,6 +1109,44 @@ impl AnyServiceConfig { AnyServiceConfig::RestServer(config) => &config.hbase_opts, } } + + pub fn region_mover_command(&self) -> String { + match self { + AnyServiceConfig::RegionServer(config) => { + if config.region_mover.run_before_shutdown { + let timeout = config + .graceful_shutdown_timeout + .map(|d| { + if d.as_secs() < DEFAULT_REGION_MOVER_DELTA_TO_SHUTDOWN.as_secs() { + d.as_secs() + } else { + d.as_secs() - DEFAULT_REGION_MOVER_DELTA_TO_SHUTDOWN.as_secs() + } + }) + .unwrap_or(DEFAULT_REGION_MOVER_TIMEOUT.as_secs()); + let mut command = vec![ + "bin/hbase".to_string(), + "org.apache.hadoop.hbase.util.RegionMover".to_string(), + "--regionserverhost".to_string(), + "localhost".to_string(), + "--operation".to_string(), + "unload".to_string(), + "--ack".to_string(), + config.region_mover.ack.to_string(), + "--timeout".to_string(), + timeout.to_string(), + ]; + // TODO: this is a security risk, we should validate and escape the extra_opts + command.extend(config.region_mover.extra_opts.clone()); + let command = command.join(" "); + format!("\"{command}\"") + } else { + "\"\"".to_string() + } + } + _ => "\"\"".to_string(), + } + } } #[cfg(test)] diff --git a/rust/operator-binary/src/hbase_controller.rs b/rust/operator-binary/src/hbase_controller.rs index b668f18c..3f450eaf 100644 --- a/rust/operator-binary/src/hbase_controller.rs +++ b/rust/operator-binary/src/hbase_controller.rs @@ -49,7 +49,6 @@ use stackable_operator::{ statefulset::StatefulSetConditionBuilder, }, time::Duration, - utils::COMMON_BASH_TRAP_FUNCTIONS, }; use std::{ collections::{BTreeMap, HashMap}, @@ -98,6 +97,42 @@ const HBASE_LOG_CONFIG_TMP_DIR: &str = "/stackable/tmp/log_config"; const DOCKER_IMAGE_BASE_NAME: &str = "hbase"; const HBASE_UID: i64 = 1000; +pub const HBASE_BASH_TRAP_FUNCTIONS: &str = r#" +prepare_signal_handlers() +{ + unset term_child_pid + unset term_kill_needed + trap handle_term_signal TERM +} + +handle_term_signal() +{ + if [ "${term_child_pid}" ]; then + if [ -n "$REGION_MOVER_COMMAND" ]; then + echo Start region mover + source "$REGION_MOVER_COMMAND" + echo Done moving regions + fi + kill -TERM "${term_child_pid}" 2>/dev/null + else + term_kill_needed='yes' + fi +} + +wait_for_termination() +{ + set +e + term_child_pid=$1 + if [[ -v term_kill_needed ]]; then + kill -TERM "${term_child_pid}" 2>/dev/null + fi + wait ${term_child_pid} 2>/dev/null + trap - TERM + wait ${term_child_pid} 2>/dev/null + set -e +} +"#; + pub struct Ctx { pub client: stackable_operator::client::Client, pub product_config: ProductConfigManager, @@ -834,13 +869,15 @@ fn build_rolegroup_statefulset( {kerberos_container_start_commands} - {COMMON_BASH_TRAP_FUNCTIONS} + REGION_MOVER_COMMAND={region_mover_command} + {HBASE_BASH_TRAP_FUNCTIONS} {remove_vector_shutdown_file_command} prepare_signal_handlers bin/hbase {hbase_role_name_in_command} start & wait_for_termination $! {create_vector_shutdown_file_command} ", + region_mover_command=config.region_mover_command(), hbase_role_name_in_command = hbase_role.cli_role_name(), kerberos_container_start_commands = kerberos_container_start_commands(hbase), remove_vector_shutdown_file_command = @@ -934,7 +971,7 @@ fn build_rolegroup_statefulset( add_graceful_shutdown_config(config, &mut pod_builder).context(GracefulShutdownSnafu)?; if hbase.has_kerberos_enabled() { - add_kerberos_pod_config(hbase, hbase_role, &mut hbase_container, &mut pod_builder) + add_kerberos_pod_config(hbase, &mut hbase_container, &mut pod_builder) .context(AddKerberosConfigSnafu)?; } pod_builder.add_container(hbase_container.build()); diff --git a/rust/operator-binary/src/kerberos.rs b/rust/operator-binary/src/kerberos.rs index 8cf45ebb..16bfdcc6 100644 --- a/rust/operator-binary/src/kerberos.rs +++ b/rust/operator-binary/src/kerberos.rs @@ -2,9 +2,7 @@ use std::collections::BTreeMap; use indoc::formatdoc; use snafu::{OptionExt, ResultExt, Snafu}; -use stackable_hbase_crd::{ - HbaseCluster, HbaseRole, TLS_STORE_DIR, TLS_STORE_PASSWORD, TLS_STORE_VOLUME_NAME, -}; +use stackable_hbase_crd::{HbaseCluster, TLS_STORE_DIR, TLS_STORE_PASSWORD, TLS_STORE_VOLUME_NAME}; use stackable_operator::{ builder::pod::{ container::ContainerBuilder, @@ -213,7 +211,6 @@ pub fn kerberos_ssl_client_settings(hbase: &HbaseCluster) -> BTreeMap Result<(), Error> { From 0b14f92581438f93b620ab5a29fdc4dc7b4152cf Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Mon, 14 Oct 2024 12:00:56 +0200 Subject: [PATCH 05/51] fix: crd field names --- deploy/helm/hbase-operator/crds/crds.yaml | 24 +++++++++++------------ rust/crd/src/lib.rs | 2 ++ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/deploy/helm/hbase-operator/crds/crds.yaml b/deploy/helm/hbase-operator/crds/crds.yaml index 070878eb..4a36aed7 100644 --- a/deploy/helm/hbase-operator/crds/crds.yaml +++ b/deploy/helm/hbase-operator/crds/crds.yaml @@ -729,21 +729,21 @@ spec: properties: ack: type: boolean - extra_opts: + extraOpts: + default: [] items: type: string type: array - max_threads: + maxThreads: format: uint16 minimum: 0.0 type: integer - run_before_shutdown: + runBeforeShutdown: type: boolean required: - ack - - extra_opts - - max_threads - - run_before_shutdown + - maxThreads + - runBeforeShutdown type: object resources: default: @@ -973,21 +973,21 @@ spec: properties: ack: type: boolean - extra_opts: + extraOpts: + default: [] items: type: string type: array - max_threads: + maxThreads: format: uint16 minimum: 0.0 type: integer - run_before_shutdown: + runBeforeShutdown: type: boolean required: - ack - - extra_opts - - max_threads - - run_before_shutdown + - maxThreads + - runBeforeShutdown type: object resources: default: diff --git a/rust/crd/src/lib.rs b/rust/crd/src/lib.rs index cec32a71..5468419e 100644 --- a/rust/crd/src/lib.rs +++ b/rust/crd/src/lib.rs @@ -515,10 +515,12 @@ impl Configuration for HbaseConfigFragment { } #[derive(Clone, Debug, JsonSchema, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct RegionMover { run_before_shutdown: bool, max_threads: u16, ack: bool, + #[serde(default)] extra_opts: Vec, } From 71793ea9c25f43065a3d2a3d662f1b8abeb6fdef Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Mon, 14 Oct 2024 16:59:48 +0200 Subject: [PATCH 06/51] unit tests and shell escaping --- Cargo.lock | 7 + Cargo.nix | 156 ++++++++++--------- Cargo.toml | 1 + crate-hashes.json | 4 +- rust/crd/Cargo.toml | 1 + rust/crd/src/lib.rs | 98 +++++++++++- rust/operator-binary/src/hbase_controller.rs | 12 +- 7 files changed, 190 insertions(+), 89 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f5daa777..b1e1f632 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2034,6 +2034,12 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shell-escape" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45bb67a18fa91266cc7807181f62f9178a6873bfad7dc788c42e6430db40184f" + [[package]] name = "shlex" version = "1.3.0" @@ -2132,6 +2138,7 @@ dependencies = [ "serde", "serde_json", "serde_yaml", + "shell-escape", "snafu 0.8.4", "stackable-operator", "strum", diff --git a/Cargo.nix b/Cargo.nix index cc6563c9..b1c47e78 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -446,7 +446,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.75"; + packageId = "syn 2.0.77"; features = [ "full" "visit-mut" ]; } ]; @@ -473,7 +473,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.75"; + packageId = "syn 2.0.77"; usesDefaultFeatures = false; features = [ "full" "visit-mut" "parsing" "printing" "proc-macro" ]; } @@ -884,10 +884,10 @@ rec { }; "clap" = rec { crateName = "clap"; - version = "4.5.16"; + version = "4.5.17"; edition = "2021"; crateBin = []; - sha256 = "068hjwbrndn4iz4fsc6d52q4ymg1kfsymjnqbxzdil23zbzijrzd"; + sha256 = "1b7nx9wsv5kc4n02ql4ca6p7pjh1n94rjk1n7hdjywsy96w22niy"; dependencies = [ { name = "clap_builder"; @@ -925,9 +925,9 @@ rec { }; "clap_builder" = rec { crateName = "clap_builder"; - version = "4.5.15"; + version = "4.5.17"; edition = "2021"; - sha256 = "1dmas5z20yqmlmfhykr38pn1hkcnr4jzxjw4cs2f6lkn2wmyqsi1"; + sha256 = "0wqsnajayxqpmqflqiqgpix2m8jrjwj6nayssvcpl13smw9dvwlc"; dependencies = [ { name = "anstream"; @@ -983,7 +983,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.75"; + packageId = "syn 2.0.77"; features = [ "full" ]; } ]; @@ -1034,9 +1034,9 @@ rec { }; "const_format" = rec { crateName = "const_format"; - version = "0.2.32"; + version = "0.2.33"; edition = "2021"; - sha256 = "0wvns8mzqwkyciwr00p2g5g4ak7zz8m473di85srj11xmz3i98p3"; + sha256 = "0jx6ffj65prbx1w9664ddwm73k7hm5g25afyvjq4y4gi3zc5bijh"; authors = [ "rodrimati1992 " ]; @@ -1066,9 +1066,9 @@ rec { }; "const_format_proc_macros" = rec { crateName = "const_format_proc_macros"; - version = "0.2.32"; + version = "0.2.33"; edition = "2021"; - sha256 = "0015dzbjbd773nn6096dwqv11fm8m3gy4a4a56cz5x10zl4gzxn7"; + sha256 = "1c8f7xh2b2kca9hlzvjplcdkvr4iqpsk4yd236n1nyzljd5s9wgg"; procMacro = true; authors = [ "rodrimati1992 " @@ -1287,7 +1287,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.75"; + packageId = "syn 2.0.77"; features = [ "full" "extra-traits" ]; } ]; @@ -1317,16 +1317,16 @@ rec { } { name = "syn"; - packageId = "syn 2.0.75"; + packageId = "syn 2.0.77"; } ]; }; "delegate" = rec { crateName = "delegate"; - version = "0.12.0"; + version = "0.13.0"; edition = "2018"; - sha256 = "16zpkc6v2ss5qivwx7p7vb1bjnb6s0p7kkifaqkgyl7bpv68y0af"; + sha256 = "0mh98via297c51dq7b2yb0fq7gxlgb8px2iz4w3sjgxpxc7vnq2h"; procMacro = true; authors = [ "Godfrey Chan " @@ -1343,7 +1343,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.75"; + packageId = "syn 2.0.77"; features = [ "full" "visit-mut" ]; } ]; @@ -1888,7 +1888,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.75"; + packageId = "syn 2.0.77"; features = [ "full" ]; } ]; @@ -3227,10 +3227,10 @@ rec { }; "k8s-openapi" = rec { crateName = "k8s-openapi"; - version = "0.22.0"; + version = "0.23.0"; edition = "2021"; - links = "k8s-openapi-0.22.0"; - sha256 = "0mcpy1gdxpqayc74i3x3ayh3q5bl6dzvsgmw91jq1r9sjkxill0r"; + links = "k8s-openapi-0.23.0"; + sha256 = "04qv2iqwm3mgjvyp2m6n3vf6nnpjh5a60kf9ah9k1n184d04g24w"; libName = "k8s_openapi"; authors = [ "Arnav Singh " @@ -3272,17 +3272,17 @@ rec { } ]; features = { - "earliest" = [ "v1_24" ]; - "latest" = [ "v1_30" ]; + "earliest" = [ "v1_26" ]; + "latest" = [ "v1_31" ]; "schemars" = [ "dep:schemars" ]; }; - resolvedDefaultFeatures = [ "schemars" "v1_30" ]; + resolvedDefaultFeatures = [ "schemars" "v1_31" ]; }; "kube" = rec { crateName = "kube"; - version = "0.93.1"; + version = "0.95.0"; edition = "2021"; - sha256 = "05k4wwb1f1hs0izn4hnyaw0l1wljqh0sh74wc4ijs6mgfl094r83"; + sha256 = "1y04cqn7ami9rs6csjsf63c4clm5zyvyx3bzbmyaf828hly0c8gs"; authors = [ "clux " "Natalie Klestrup Röijezon " @@ -3325,34 +3325,35 @@ rec { ]; features = { "admission" = [ "kube-core/admission" ]; + "aws-lc-rs" = [ "kube-client?/aws-lc-rs" ]; "client" = [ "kube-client/client" "config" ]; "config" = [ "kube-client/config" ]; "default" = [ "client" "rustls-tls" ]; "derive" = [ "kube-derive" "kube-core/schema" ]; - "gzip" = [ "kube-client/gzip" ]; - "http-proxy" = [ "kube-client/http-proxy" ]; + "gzip" = [ "kube-client/gzip" "client" ]; + "http-proxy" = [ "kube-client/http-proxy" "client" ]; "jsonpatch" = [ "kube-core/jsonpatch" ]; "kube-client" = [ "dep:kube-client" ]; "kube-derive" = [ "dep:kube-derive" ]; "kube-runtime" = [ "dep:kube-runtime" ]; "kubelet-debug" = [ "kube-client/kubelet-debug" "kube-core/kubelet-debug" ]; - "oauth" = [ "kube-client/oauth" ]; - "oidc" = [ "kube-client/oidc" ]; - "openssl-tls" = [ "kube-client/openssl-tls" ]; + "oauth" = [ "kube-client/oauth" "client" ]; + "oidc" = [ "kube-client/oidc" "client" ]; + "openssl-tls" = [ "kube-client/openssl-tls" "client" ]; "runtime" = [ "kube-runtime" ]; - "rustls-tls" = [ "kube-client/rustls-tls" ]; - "socks5" = [ "kube-client/socks5" ]; - "unstable-client" = [ "kube-client/unstable-client" ]; - "unstable-runtime" = [ "kube-runtime/unstable-runtime" ]; + "rustls-tls" = [ "kube-client/rustls-tls" "client" ]; + "socks5" = [ "kube-client/socks5" "client" ]; + "unstable-client" = [ "kube-client/unstable-client" "client" ]; + "unstable-runtime" = [ "kube-runtime/unstable-runtime" "runtime" ]; "ws" = [ "kube-client/ws" "kube-core/ws" ]; }; resolvedDefaultFeatures = [ "client" "config" "derive" "jsonpatch" "kube-client" "kube-derive" "kube-runtime" "runtime" "rustls-tls" ]; }; "kube-client" = rec { crateName = "kube-client"; - version = "0.93.1"; + version = "0.95.0"; edition = "2021"; - sha256 = "00w69ym31mzdi7kmxq1cjjnjps92cvb7mad5jw6a842v7bmkc4yq"; + sha256 = "1dwvvd37psgzcaqv87lppx2yrmdb8wggx9ki1s8132lxbigkbhii"; libName = "kube_client"; authors = [ "clux " @@ -3543,6 +3544,7 @@ rec { features = { "__non_core" = [ "tracing" "serde_yaml" "base64" ]; "admission" = [ "kube-core/admission" ]; + "aws-lc-rs" = [ "rustls?/aws-lc-rs" ]; "base64" = [ "dep:base64" ]; "bytes" = [ "dep:bytes" ]; "chrono" = [ "dep:chrono" ]; @@ -3591,9 +3593,9 @@ rec { }; "kube-core" = rec { crateName = "kube-core"; - version = "0.93.1"; + version = "0.95.0"; edition = "2021"; - sha256 = "1rhg99v7w5qrj3ikh6n0pbbhp1kj6q7spvydcf846zbq9nkp7qyc"; + sha256 = "0rp6n4k4b1ai6ghxqci72wy67kxrgn6x9rs70ajl9dcx3kchn0zk"; libName = "kube_core"; authors = [ "clux " @@ -3635,6 +3637,10 @@ rec { packageId = "serde"; features = [ "derive" ]; } + { + name = "serde-value"; + packageId = "serde-value"; + } { name = "serde_json"; packageId = "serde_json"; @@ -3664,9 +3670,9 @@ rec { }; "kube-derive" = rec { crateName = "kube-derive"; - version = "0.93.1"; + version = "0.95.0"; edition = "2021"; - sha256 = "1wkqxfjxx4lc8gapd44kylprwgxhk29cwpdy55ri47kr8jc6r8h4"; + sha256 = "09qcgysprgrdhl838y28xfvvyrak0x367s5879vhmmyxisbvx67s"; procMacro = true; libName = "kube_derive"; authors = [ @@ -3693,7 +3699,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.75"; + packageId = "syn 2.0.77"; features = [ "extra-traits" ]; } ]; @@ -3701,9 +3707,9 @@ rec { }; "kube-runtime" = rec { crateName = "kube-runtime"; - version = "0.93.1"; + version = "0.95.0"; edition = "2021"; - sha256 = "197zjakpach42n6s62qdh0g6qrs8cawzyhqb474qaq7d1wy7711v"; + sha256 = "053r458alv2gk2q7vb8nbycw4d1bclsvja7i10j95b21ls5cp5aq"; libName = "kube_runtime"; authors = [ "clux " @@ -4788,7 +4794,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.75"; + packageId = "syn 2.0.77"; } ]; features = { @@ -4861,7 +4867,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.75"; + packageId = "syn 2.0.77"; features = [ "full" "visit-mut" ]; } ]; @@ -5498,7 +5504,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.75"; + packageId = "syn 2.0.77"; features = [ "full" "parsing" "extra-traits" "visit" "visit-mut" ]; } { @@ -5863,7 +5869,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.75"; + packageId = "syn 2.0.77"; features = [ "extra-traits" ]; } ]; @@ -6003,9 +6009,9 @@ rec { }; "serde" = rec { crateName = "serde"; - version = "1.0.208"; + version = "1.0.210"; edition = "2018"; - sha256 = "1cng2zkvv6hh137jrrqdmhi2hllfnqwlqjgviqjalkv8rg98bw6g"; + sha256 = "0flc0z8wgax1k4j5bf2zyq48bgzyv425jkd5w0i6wbh7f8j5kqy8"; authors = [ "Erick Tryzelaar " "David Tolnay " @@ -6058,9 +6064,9 @@ rec { }; "serde_derive" = rec { crateName = "serde_derive"; - version = "1.0.208"; + version = "1.0.210"; edition = "2015"; - sha256 = "1krblvy84j6d9zj12ms9l2wfbwf2w8jazkx0bf7fs4vnzy0qw014"; + sha256 = "07yzy4wafk79ps0hmbqmsqh5xjna4pm4q57wc847bb8gl3nh4f94"; procMacro = true; authors = [ "Erick Tryzelaar " @@ -6081,7 +6087,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.75"; + packageId = "syn 2.0.77"; usesDefaultFeatures = false; features = [ "clone-impls" "derive" "parsing" "printing" "proc-macro" ]; } @@ -6113,7 +6119,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.75"; + packageId = "syn 2.0.77"; usesDefaultFeatures = false; features = [ "clone-impls" "derive" "parsing" "printing" ]; } @@ -6122,9 +6128,9 @@ rec { }; "serde_json" = rec { crateName = "serde_json"; - version = "1.0.125"; + version = "1.0.128"; edition = "2021"; - sha256 = "1v9idlv5nq5f000qsv6v02h2zbsfk2m6d05af2zgbk3kl0sygj43"; + sha256 = "1n43nia50ybpcfmh3gcw4lcc627qsg9nyakzwgkk9pm10xklbxbg"; authors = [ "Erick Tryzelaar " "David Tolnay " @@ -6484,7 +6490,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.75"; + packageId = "syn 2.0.77"; features = [ "full" ]; } ]; @@ -6694,13 +6700,13 @@ rec { }; "stackable-operator" = rec { crateName = "stackable-operator"; - version = "0.74.0"; + version = "0.76.0"; edition = "2021"; workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "c77a5423b66bc1667b63af7d8bec00de88a5303f"; - sha256 = "1g1a0v98wlcb36ibwv1nv75g3b3s1mjmaps443fc2w2maam94lya"; + rev = "a7e70f174fb043a1766e0a80de95834cb4f7513d"; + sha256 = "1cyyyn6lizd0wdq79fc9fjnksnzx073ipydxmh7llciq5si5dnq6"; }; libName = "stackable_operator"; authors = [ @@ -6749,7 +6755,7 @@ rec { name = "k8s-openapi"; packageId = "k8s-openapi"; usesDefaultFeatures = false; - features = [ "schemars" "v1_30" ]; + features = [ "schemars" "v1_31" ]; } { name = "kube"; @@ -6849,8 +6855,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "c77a5423b66bc1667b63af7d8bec00de88a5303f"; - sha256 = "1g1a0v98wlcb36ibwv1nv75g3b3s1mjmaps443fc2w2maam94lya"; + rev = "a7e70f174fb043a1766e0a80de95834cb4f7513d"; + sha256 = "1cyyyn6lizd0wdq79fc9fjnksnzx073ipydxmh7llciq5si5dnq6"; }; procMacro = true; libName = "stackable_operator_derive"; @@ -6872,7 +6878,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.75"; + packageId = "syn 2.0.77"; } ]; @@ -6945,7 +6951,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.75"; + packageId = "syn 2.0.77"; features = [ "parsing" "extra-traits" ]; } ]; @@ -6998,11 +7004,11 @@ rec { }; resolvedDefaultFeatures = [ "clone-impls" "default" "derive" "extra-traits" "full" "parsing" "printing" "proc-macro" "quote" "visit" ]; }; - "syn 2.0.75" = rec { + "syn 2.0.77" = rec { crateName = "syn"; - version = "2.0.75"; + version = "2.0.77"; edition = "2021"; - sha256 = "1nf72xc8pabwny8d0d4kjk5vmadg3fa240dywznka6gw6hq0dbzn"; + sha256 = "1vbkwfp9ymmi0fsyyjsqfvnv7gm8vjgl4pzprbk7p3pxc7gvqdcz"; authors = [ "David Tolnay " ]; @@ -7068,7 +7074,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.75"; + packageId = "syn 2.0.77"; } ]; @@ -7307,9 +7313,9 @@ rec { }; "tokio" = rec { crateName = "tokio"; - version = "1.39.3"; + version = "1.40.0"; edition = "2021"; - sha256 = "1xgzhj7bxqqpjaabjkgsx8hi0f600bzj4iyp9f0a9gr3k6dwkawv"; + sha256 = "166rllhfkyqp0fs7sxn6crv74iizi4wzd3cvxkcpmlk52qip1c72"; authors = [ "Tokio Contributors " ]; @@ -7430,7 +7436,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.75"; + packageId = "syn 2.0.77"; features = [ "full" ]; } ]; @@ -7964,7 +7970,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.75"; + packageId = "syn 2.0.77"; usesDefaultFeatures = false; features = [ "full" "parsing" "printing" "visit-mut" "clone-impls" "extra-traits" "proc-macro" ]; } @@ -8602,7 +8608,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.75"; + packageId = "syn 2.0.77"; features = [ "full" ]; } { @@ -8661,7 +8667,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.75"; + packageId = "syn 2.0.77"; features = [ "visit" "full" ]; } { @@ -9258,7 +9264,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.75"; + packageId = "syn 2.0.77"; } ]; diff --git a/Cargo.toml b/Cargo.toml index a897f099..c149c408 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,6 +20,7 @@ rstest = "0.22" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" serde_yaml = "0.9" +shell-escape = "0.1" snafu = "0.8" stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.76.0" } product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.7.0" } diff --git a/crate-hashes.json b/crate-hashes.json index 8725a492..4ac79c7f 100644 --- a/crate-hashes.json +++ b/crate-hashes.json @@ -1,5 +1,5 @@ { - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.74.0#stackable-operator-derive@0.3.1": "1g1a0v98wlcb36ibwv1nv75g3b3s1mjmaps443fc2w2maam94lya", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.74.0#stackable-operator@0.74.0": "1g1a0v98wlcb36ibwv1nv75g3b3s1mjmaps443fc2w2maam94lya", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.76.0#stackable-operator-derive@0.3.1": "1cyyyn6lizd0wdq79fc9fjnksnzx073ipydxmh7llciq5si5dnq6", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.76.0#stackable-operator@0.76.0": "1cyyyn6lizd0wdq79fc9fjnksnzx073ipydxmh7llciq5si5dnq6", "git+https://github.com/stackabletech/product-config.git?tag=0.7.0#product-config@0.7.0": "0gjsm80g6r75pm3824dcyiz4ysq1ka4c1if6k1mjm9cnd5ym0gny" } \ No newline at end of file diff --git a/rust/crd/Cargo.toml b/rust/crd/Cargo.toml index e59e4464..8fec0dba 100644 --- a/rust/crd/Cargo.toml +++ b/rust/crd/Cargo.toml @@ -12,6 +12,7 @@ publish = false product-config.workspace = true serde.workspace = true serde_json.workspace = true +shell-escape.workspace = true snafu.workspace = true stackable-operator.workspace = true strum.workspace = true diff --git a/rust/crd/src/lib.rs b/rust/crd/src/lib.rs index 5468419e..87571c52 100644 --- a/rust/crd/src/lib.rs +++ b/rust/crd/src/lib.rs @@ -1,6 +1,7 @@ use product_config::types::PropertyNameKind; use security::AuthenticationConfig; use serde::{Deserialize, Serialize}; +use shell_escape::escape; use snafu::{OptionExt, ResultExt, Snafu}; use stackable_operator::k8s_openapi::api::core::v1::PodTemplateSpec; use stackable_operator::{ @@ -1112,7 +1113,12 @@ impl AnyServiceConfig { } } - pub fn region_mover_command(&self) -> String { + /// This function is called for all HBase roles but it currently only returns something for the + /// region server roles. + /// For all other roles it currently returns an empty string meaning there is no command to run + /// before shutdown. + /// This might change in the future. + pub fn pre_shutdown_command(&self) -> String { match self { AnyServiceConfig::RegionServer(config) => { if config.region_mover.run_before_shutdown { @@ -1133,13 +1139,22 @@ impl AnyServiceConfig { "localhost".to_string(), "--operation".to_string(), "unload".to_string(), - "--ack".to_string(), - config.region_mover.ack.to_string(), + "--maxthreads".to_string(), + config.region_mover.max_threads.to_string(), "--timeout".to_string(), timeout.to_string(), ]; - // TODO: this is a security risk, we should validate and escape the extra_opts - command.extend(config.region_mover.extra_opts.clone()); + if !config.region_mover.ack { + command.push("--noack".to_string()); + } + // + command.extend( + config + .region_mover + .extra_opts + .iter() + .map(|s| escape(std::borrow::Cow::Borrowed(s)).to_string()), + ); let command = command.join(" "); format!("\"{command}\"") } else { @@ -1160,7 +1175,10 @@ mod tests { transform_all_roles_to_config, validate_all_roles_and_groups_config, }; - use crate::{merged_env, HbaseCluster, HbaseRole}; + use crate::{ + merged_env, AnyServiceConfig, HbaseCluster, HbaseConfig, HbaseRole, RegionMover, + RegionServerConfig, + }; use product_config::{types::PropertyNameKind, ProductConfigManager}; @@ -1255,4 +1273,72 @@ spec: env_map.get("TEST_VAR_FROM_MRG") ); } + + #[test] + fn test_pre_shutdown_command_master() { + let config = AnyServiceConfig::Master(HbaseConfig::default()); + assert_eq!(config.pre_shutdown_command(), "\"\""); + } + + #[test] + fn test_pre_shutdown_command_region_server_disabled() { + let config = AnyServiceConfig::RegionServer(RegionServerConfig::default()); + assert_eq!(config.pre_shutdown_command(), "\"\""); + } + + #[test] + fn test_pre_shutdown_command_region_server_enabled_1() { + let config = AnyServiceConfig::RegionServer(RegionServerConfig { + region_mover: RegionMover { + run_before_shutdown: true, + max_threads: 1, + ack: true, + extra_opts: vec![], + }, + ..RegionServerConfig::default() + }); + assert_eq!(config.pre_shutdown_command(), "\"bin/hbase org.apache.hadoop.hbase.util.RegionMover --regionserverhost localhost --operation unload --maxthreads 1 --timeout 3540\""); + } + + #[test] + fn test_pre_shutdown_command_region_server_enabled_2() { + let config = AnyServiceConfig::RegionServer(RegionServerConfig { + region_mover: RegionMover { + run_before_shutdown: true, + max_threads: 5, + ack: false, + extra_opts: vec![], + }, + ..RegionServerConfig::default() + }); + assert_eq!(config.pre_shutdown_command(), "\"bin/hbase org.apache.hadoop.hbase.util.RegionMover --regionserverhost localhost --operation unload --maxthreads 5 --timeout 3540 --noack\""); + } + + #[test] + fn test_pre_shutdown_command_region_server_enabled_3() { + let config = AnyServiceConfig::RegionServer(RegionServerConfig { + region_mover: RegionMover { + run_before_shutdown: true, + max_threads: 5, + ack: false, + extra_opts: vec!["-x".to_string(), "/blubb".to_string()], + }, + ..RegionServerConfig::default() + }); + assert_eq!(config.pre_shutdown_command(), "\"bin/hbase org.apache.hadoop.hbase.util.RegionMover --regionserverhost localhost --operation unload --maxthreads 5 --timeout 3540 --noack -x /blubb\""); + } + + #[test] + fn test_pre_shutdown_command_region_server_enabled_4() { + let config = AnyServiceConfig::RegionServer(RegionServerConfig { + region_mover: RegionMover { + run_before_shutdown: true, + max_threads: 1, + ack: true, + extra_opts: vec!["&&".to_string(), "sudo gotcha!".to_string()], + }, + ..RegionServerConfig::default() + }); + assert_eq!(config.pre_shutdown_command(), "\"bin/hbase org.apache.hadoop.hbase.util.RegionMover --regionserverhost localhost --operation unload --maxthreads 1 --timeout 3540 '&&' 'sudo gotcha'\\!''\""); + } } diff --git a/rust/operator-binary/src/hbase_controller.rs b/rust/operator-binary/src/hbase_controller.rs index 3f450eaf..7bfdaf4e 100644 --- a/rust/operator-binary/src/hbase_controller.rs +++ b/rust/operator-binary/src/hbase_controller.rs @@ -108,10 +108,10 @@ prepare_signal_handlers() handle_term_signal() { if [ "${term_child_pid}" ]; then - if [ -n "$REGION_MOVER_COMMAND" ]; then - echo Start region mover - source "$REGION_MOVER_COMMAND" - echo Done moving regions + if [ -n "$PRE_SHUTDOWN_COMMAND" ]; then + echo "Start pre-shutdown command: $PRE_SHUTDOWN_COMMAND" + source "$PRE_SHUTDOWN_COMMAND" + echo "Done pre-shutdown command" fi kill -TERM "${term_child_pid}" 2>/dev/null else @@ -869,7 +869,7 @@ fn build_rolegroup_statefulset( {kerberos_container_start_commands} - REGION_MOVER_COMMAND={region_mover_command} + PRE_SHUTDOWN_COMMAND={pre_shutdown_command} {HBASE_BASH_TRAP_FUNCTIONS} {remove_vector_shutdown_file_command} prepare_signal_handlers @@ -877,7 +877,7 @@ fn build_rolegroup_statefulset( wait_for_termination $! {create_vector_shutdown_file_command} ", - region_mover_command=config.region_mover_command(), + pre_shutdown_command=config.pre_shutdown_command(), hbase_role_name_in_command = hbase_role.cli_role_name(), kerberos_container_start_commands = kerberos_container_start_commands(hbase), remove_vector_shutdown_file_command = From 1644affcf288520295ada8fe0a49b36ca13a0929 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Mon, 14 Oct 2024 17:56:02 +0200 Subject: [PATCH 07/51] update docs --- CHANGELOG.md | 2 ++ deploy/helm/hbase-operator/crds/crds.yaml | 10 +++++++ .../operations/graceful-shutdown.adoc | 28 +++++++++++++++++-- rust/crd/src/lib.rs | 14 ++++++++++ 4 files changed, 52 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8989eca5..16a3fe5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Reduce CRD size from `1.4MB` to `96KB` by accepting arbitrary YAML input instead of the underlying schema for the following fields ([#548]): - `podOverrides` - `affinity` +- Optionally move regions to other pods before shutting down a region server ([#570]). ### Fixed @@ -21,6 +22,7 @@ [#550]: https://github.com/stackabletech/hbase-operator/pull/550 [#556]: https://github.com/stackabletech/hbase-operator/pull/556 [#558]: https://github.com/stackabletech/hbase-operator/pull/558 +[#570]: https://github.com/stackabletech/hbase-operator/pull/570 ## [24.7.0] - 2024-07-24 diff --git a/deploy/helm/hbase-operator/crds/crds.yaml b/deploy/helm/hbase-operator/crds/crds.yaml index 4a36aed7..1e34b8f2 100644 --- a/deploy/helm/hbase-operator/crds/crds.yaml +++ b/deploy/helm/hbase-operator/crds/crds.yaml @@ -725,20 +725,25 @@ spec: type: boolean type: object regionMover: + 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. type: boolean extraOpts: default: [] + description: Additional options to pass to the region mover. items: type: string type: array maxThreads: + description: Maximum number of threads to use for moving regions. format: uint16 minimum: 0.0 type: integer runBeforeShutdown: + description: Move local regions to other servers before terminating a region server's pod. type: boolean required: - ack @@ -969,20 +974,25 @@ spec: type: boolean type: object regionMover: + 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. type: boolean extraOpts: default: [] + description: Additional options to pass to the region mover. items: type: string type: array maxThreads: + description: Maximum number of threads to use for moving regions. format: uint16 minimum: 0.0 type: integer runBeforeShutdown: + description: Move local regions to other servers before terminating a region server's pod. type: boolean required: - ack 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 3eb85373..042deb91 100644 --- a/docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc +++ b/docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc @@ -1,6 +1,6 @@ = Graceful shutdown -You can configure the graceful shutdown as described in xref:concepts:operations/graceful_shutdown.adoc[]. +You can configure the graceful shutdown grace period as described in xref:concepts:operations/graceful_shutdown.adoc[]. == Masters @@ -15,7 +15,7 @@ However, there is no message in the log acknowledging the graceful shutdown. == RegionServers -As a default, RegionServers have `60 minutes` to shut down gracefully. +By default, RegionServers have `60 minutes` to shut down gracefully. They use the same mechanism described above. In contrast to the Master servers, they will, however, acknowledge the graceful shutdown with a message in the logs: @@ -26,6 +26,30 @@ In contrast to the Master servers, they will, however, acknowledge the graceful 2023-10-11 12:38:05,060 INFO [shutdown-hook-0] regionserver.HRegionServer: ***** STOPPING region server 'test-hbase-regionserver-default-0.test-hbase-regionserver-default.kuttl-test-topical-parakeet.svc.cluster.local,16020,1697027870348' ***** ---- +The operator allows for finer control over the shutdown process of region servers. +For each region server pod, the region mover tool may be invoked before terminating the region server's pod. +The affected regions are transfered to other pods thus ensuring that the data is not lost. + +Here is a an example: + +[source,yaml] +---- +spec: + regionServers: + config: + regionMover + runBeforeShutdown: true, <1> + maxThreads: 5, <2> + ack: false, <3> + extraOpts: ["--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. +<3>: Enable or disable region confirmation on the present and target servers. Default is `true`. +<4>: Extra options to pass to the region mover tool. + +NOTE: There is no need to explicitely specify a timeout for the region movement. The operator will compute an appropriate timeout that cannot exceed the `gracefulShutdownTimeout` for region servers. + == RestServers As a default, RestServers have `5 minutes` to shut down gracefully. diff --git a/rust/crd/src/lib.rs b/rust/crd/src/lib.rs index 87571c52..1551fef7 100644 --- a/rust/crd/src/lib.rs +++ b/rust/crd/src/lib.rs @@ -518,9 +518,17 @@ impl Configuration for HbaseConfigFragment { #[derive(Clone, Debug, JsonSchema, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RegionMover { + /// Move local regions to other servers before terminating a region server's pod. run_before_shutdown: bool, + + /// Maximum number of threads to use for moving regions. max_threads: u16, + + /// 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. ack: bool, + + /// Additional options to pass to the region mover. #[serde(default)] extra_opts: Vec, } @@ -575,6 +583,12 @@ pub struct RegionServerConfig { /// Time period Pods have to gracefully shut down, e.g. `30m`, `1h` or `2d`. Consult the operator documentation for details. #[fragment_attrs(serde(default))] pub graceful_shutdown_timeout: Option, + + /// 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. pub region_mover: RegionMover, } From 1903f3645e4cf2f61a9bef23fff6e78c1a5b81bb Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Mon, 14 Oct 2024 18:15:48 +0200 Subject: [PATCH 08/51] spelling --- .../hbase/pages/usage-guide/operations/graceful-shutdown.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 042deb91..3fccc972 100644 --- a/docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc +++ b/docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc @@ -28,7 +28,7 @@ In contrast to the Master servers, they will, however, acknowledge the graceful The operator allows for finer control over the shutdown process of region servers. For each region server pod, the region mover tool may be invoked before terminating the region server's pod. -The affected regions are transfered to other pods thus ensuring that the data is not lost. +The affected regions are transferred to other pods thus ensuring that the data is not lost. Here is a an example: @@ -48,7 +48,7 @@ spec: <3>: Enable or disable region confirmation on the present and target servers. Default is `true`. <4>: Extra options to pass to the region mover tool. -NOTE: There is no need to explicitely specify a timeout for the region movement. The operator will compute an appropriate timeout that cannot exceed the `gracefulShutdownTimeout` for region servers. +NOTE: There is no need to explicitly specify a timeout for the region movement. The operator will compute an appropriate timeout that cannot exceed the `gracefulShutdownTimeout` for region servers. == RestServers From 5e8201f926db1dc0552930cde58641fab2c15ffd Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Mon, 14 Oct 2024 18:19:22 +0200 Subject: [PATCH 09/51] cargo update --- Cargo.lock | 454 ++++++++++++++++++++++++++++------------------------- 1 file changed, 240 insertions(+), 214 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b1e1f632..7f8dc08b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,18 +4,18 @@ version = 3 [[package]] name = "addr2line" -version = "0.22.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "ahash" @@ -96,7 +96,7 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -106,14 +106,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" [[package]] name = "async-broadcast" @@ -129,9 +129,9 @@ dependencies = [ [[package]] name = "async-stream" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" dependencies = [ "async-stream-impl", "futures-core", @@ -140,31 +140,31 @@ dependencies = [ [[package]] name = "async-stream-impl" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] name = "async-trait" -version = "0.1.81" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "backoff" @@ -179,17 +179,17 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.73" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets", ] [[package]] @@ -264,15 +264,15 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.1" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" +checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" [[package]] name = "cc" -version = "1.1.14" +version = "1.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d2eb3cd3d1bf4529e31c215ee6f93ec5a3d536d9f578f93d9d33ee19562932" +checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945" dependencies = [ "jobserver", "libc", @@ -300,9 +300,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.17" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac" +checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" dependencies = [ "clap_builder", "clap_derive", @@ -310,9 +310,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.17" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73" +checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" dependencies = [ "anstream", "anstyle", @@ -322,14 +322,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.13" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -391,9 +391,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] @@ -444,7 +444,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -455,18 +455,18 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] name = "delegate" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5060bb0febb73fa907273f8a7ed17ab4bf831d585eac835b28ec24a1e2460956" +checksum = "bc2323e10c92e1cf4d86e11538512e6dc03ceb586842970b6332af3d4046a046" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -583,8 +583,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2" dependencies = [ "bit-set", - "regex-automata 0.4.7", - "regex-syntax 0.8.4", + "regex-automata 0.4.8", + "regex-syntax 0.8.5", ] [[package]] @@ -619,9 +619,9 @@ checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -634,9 +634,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -644,15 +644,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -661,32 +661,32 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-timer" @@ -696,9 +696,9 @@ checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures 0.1.31", "futures-channel", @@ -736,9 +736,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.29.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "git2" @@ -769,6 +769,12 @@ dependencies = [ "allocator-api2", ] +[[package]] +name = "hashbrown" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" + [[package]] name = "headers" version = "0.4.0" @@ -811,7 +817,7 @@ version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" dependencies = [ - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -850,9 +856,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.4" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -893,7 +899,7 @@ dependencies = [ "hyper-rustls", "hyper-util", "pin-project-lite", - "rustls-native-certs", + "rustls-native-certs 0.7.3", "tokio", "tokio-rustls", "tower-service", @@ -901,9 +907,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http", @@ -911,7 +917,7 @@ dependencies = [ "hyper-util", "log", "rustls", - "rustls-native-certs", + "rustls-native-certs 0.8.0", "rustls-pki-types", "tokio", "tokio-rustls", @@ -933,9 +939,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.7" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" +checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" dependencies = [ "bytes", "futures-channel", @@ -946,16 +952,15 @@ dependencies = [ "pin-project-lite", "socket2", "tokio", - "tower", "tower-service", "tracing", ] [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -992,12 +997,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.4.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.15.0", ] [[package]] @@ -1055,9 +1060,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] @@ -1137,7 +1142,7 @@ dependencies = [ "bytes", "chrono", "either", - "futures 0.3.30", + "futures 0.3.31", "home", "http", "http-body", @@ -1193,7 +1198,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1208,8 +1213,8 @@ dependencies = [ "async-trait", "backoff", "derivative", - "futures 0.3.30", - "hashbrown", + "futures 0.3.31", + "hashbrown 0.14.5", "json-patch", "jsonptr", "k8s-openapi", @@ -1232,9 +1237,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.158" +version = "0.2.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" [[package]] name = "libgit2-sys" @@ -1250,9 +1255,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.19" +version = "1.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc53a7799a7496ebc9fd29f31f7df80e83c9bda5299768af5f9e59eeea74647" +checksum = "d2d16453e800a8cf6dd2fc3eb4bc99b786a9b90c663b8559a5b1a041bf89e472" dependencies = [ "cc", "libc", @@ -1299,11 +1304,11 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "adler", + "adler2", ] [[package]] @@ -1315,7 +1320,7 @@ dependencies = [ "hermit-abi", "libc", "wasi", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -1355,18 +1360,18 @@ dependencies = [ [[package]] name = "object" -version = "0.36.3" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "openssl-probe" @@ -1424,7 +1429,7 @@ dependencies = [ "lazy_static", "once_cell", "opentelemetry", - "ordered-float 4.2.2", + "ordered-float 4.3.0", "percent-encoding", "rand", "thiserror", @@ -1443,9 +1448,9 @@ dependencies = [ [[package]] name = "ordered-float" -version = "4.2.2" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a91171844676f8c7990ce64959210cd2eaef32c2612c50f9fae9f8aaa6065a6" +checksum = "44d501f1a72f71d3c063a6bbc8f7271fa73aa09fe5d6283b6571e2ed176a2537" dependencies = [ "num-traits", ] @@ -1458,9 +1463,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "parking" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot" @@ -1503,9 +1508,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.11" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" +checksum = "879952a81a83930934cbf1786752d6dedc3b1f29e8f8fb2ad1d0a36f377cf442" dependencies = [ "memchr", "thiserror", @@ -1514,9 +1519,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.11" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a548d2beca6773b1c244554d36fcf8548a8a58e74156968211567250e48e49a" +checksum = "d214365f632b123a47fd913301e14c946c61d1c183ee245fa76eb752e59a02dd" dependencies = [ "pest", "pest_generator", @@ -1524,22 +1529,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.11" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c93a82e8d145725dcbaf44e5ea887c8a869efdcc28706df2d08c69e17077183" +checksum = "eb55586734301717aea2ac313f50b2eb8f60d2fc3dc01d190eefa2e625f60c4e" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] name = "pest_meta" -version = "2.7.11" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a941429fea7e08bedec25e4f6785b6ffaacc6b755da98df5ef3e7dcf4a124c4f" +checksum = "b75da2a70cf4d9cb76833c990ac9cd3923c9a8905a8929789ce347c84564d03d" dependencies = [ "once_cell", "pest", @@ -1548,22 +1553,22 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1580,9 +1585,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "powerfmt" @@ -1601,18 +1606,18 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ "toml_edit", ] [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" dependencies = [ "unicode-ident", ] @@ -1629,7 +1634,7 @@ dependencies = [ "serde", "serde_json", "serde_yaml", - "snafu 0.8.4", + "snafu 0.8.5", "xml-rs", ] @@ -1674,23 +1679,23 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.3" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ "bitflags 2.6.0", ] [[package]] name = "regex" -version = "1.10.6" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.7", - "regex-syntax 0.8.4", + "regex-automata 0.4.8", + "regex-syntax 0.8.5", ] [[package]] @@ -1704,13 +1709,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.4", + "regex-syntax 0.8.5", ] [[package]] @@ -1721,9 +1726,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "relative-path" @@ -1743,7 +1748,7 @@ dependencies = [ "libc", "spin", "untrusted", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -1752,7 +1757,7 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b423f0e62bdd61734b67cd21ff50871dfaeb9cc74f869dcd6af974fbcb19936" dependencies = [ - "futures 0.3.30", + "futures 0.3.31", "futures-timer", "rstest_macros", "rustc_version", @@ -1772,7 +1777,7 @@ dependencies = [ "regex", "relative-path", "rustc_version", - "syn 2.0.77", + "syn 2.0.79", "unicode-ident", ] @@ -1784,18 +1789,18 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver", ] [[package]] name = "rustls" -version = "0.23.12" +version = "0.23.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" +checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "log", "once_cell", @@ -1808,9 +1813,22 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04182dffc9091a404e0fc069ea5cd60e5b866c3adf881eff99a32d048242dffa" +checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "rustls-pki-types", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-native-certs" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcaf18a4f2be7326cd874a5fa579fae794320a0f388d365dca7e480e55f83f8a" dependencies = [ "openssl-probe", "rustls-pemfile", @@ -1821,25 +1839,24 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.3" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ - "base64 0.22.1", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" +checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55" [[package]] name = "rustls-webpki" -version = "0.102.6" +version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ "ring", "rustls-pki-types", @@ -1860,11 +1877,11 @@ checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" dependencies = [ - "windows-sys", + "windows-sys 0.59.0", ] [[package]] @@ -1889,7 +1906,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1923,9 +1940,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.1" +version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" dependencies = [ "core-foundation-sys", "libc", @@ -1964,7 +1981,7 @@ checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1975,7 +1992,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -2082,11 +2099,11 @@ dependencies = [ [[package]] name = "snafu" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b835cb902660db3415a672d862905e791e54d306c6e8189168c7f3d9ae1c79d" +checksum = "223891c85e2a29c3fe8fb900c1fae5e69c2e42415e3177752e8718475efa5019" dependencies = [ - "snafu-derive 0.8.4", + "snafu-derive 0.8.5", ] [[package]] @@ -2102,14 +2119,14 @@ dependencies = [ [[package]] name = "snafu-derive" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d1e02fca405f6280643174a50c942219f0bbf4dbf7d480f1dd864d6f211ae5" +checksum = "03c3c6b7927ffe7ecaa769ee0e3994da3b8cafc8f444578982c83ecb161af917" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -2119,7 +2136,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -2139,7 +2156,7 @@ dependencies = [ "serde_json", "serde_yaml", "shell-escape", - "snafu 0.8.4", + "snafu 0.8.5", "stackable-operator", "strum", "tracing", @@ -2153,13 +2170,13 @@ dependencies = [ "built", "clap", "fnv", - "futures 0.3.30", + "futures 0.3.31", "indoc", "product-config", "rstest", "serde", "serde_yaml", - "snafu 0.8.4", + "snafu 0.8.5", "stackable-hbase-crd", "stackable-operator", "strum", @@ -2179,7 +2196,7 @@ dependencies = [ "derivative", "dockerfile-parser", "either", - "futures 0.3.30", + "futures 0.3.31", "json-patch", "k8s-openapi", "kube", @@ -2192,7 +2209,7 @@ dependencies = [ "serde", "serde_json", "serde_yaml", - "snafu 0.8.4", + "snafu 0.8.5", "stackable-operator-derive", "strum", "tokio", @@ -2211,7 +2228,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -2239,7 +2256,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -2261,9 +2278,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.77" +version = "2.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" dependencies = [ "proc-macro2", "quote", @@ -2272,22 +2289,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -2383,7 +2400,7 @@ dependencies = [ "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -2394,7 +2411,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -2410,9 +2427,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" dependencies = [ "futures-core", "pin-project-lite", @@ -2421,9 +2438,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", @@ -2441,9 +2458,9 @@ checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" [[package]] name = "toml_edit" -version = "0.21.1" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ "indexmap", "toml_datetime", @@ -2530,7 +2547,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -2617,36 +2634,36 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucd-trie" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] [[package]] name = "unicode-xid" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "unsafe-libyaml" @@ -2713,9 +2730,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", "once_cell", @@ -2724,24 +2741,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2749,22 +2766,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "web-time" @@ -2816,6 +2833,15 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-targets" version = "0.52.6" @@ -2882,18 +2908,18 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.5.40" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] [[package]] name = "xml-rs" -version = "0.8.21" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "539a77ee7c0de333dcc6da69b177380a0b81e0dacfa4f7344c465a36871ee601" +checksum = "af4e2e2f7cba5a093896c1e150fbfe177d1883e7448200efb81d40b9d339ef26" [[package]] name = "zerocopy" @@ -2913,7 +2939,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] From e76166afe3fea7e98df6b31210243aec7be5c365 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Wed, 16 Oct 2024 18:00:46 +0200 Subject: [PATCH 10/51] added shutdown test & hbase-entrypoint.sh --- Cargo.nix | 869 ++++++++++++------ rust/crd/src/lib.rs | 52 +- rust/operator-binary/src/hbase_controller.rs | 38 +- scripts/run-tests | 67 +- .../kuttl/shutdown/00-limit-range.yaml | 11 + .../kuttl/shutdown/00-patch-ns.yaml.j2 | 9 + .../kuttl/shutdown/01-assert.yaml.j2 | 10 + ...tor-aggregator-discovery-configmap.yaml.j2 | 9 + tests/templates/kuttl/shutdown/10-assert.yaml | 14 + .../shutdown/10-install-zookeeper.yaml.j2 | 29 + tests/templates/kuttl/shutdown/20-assert.yaml | 30 + .../kuttl/shutdown/20-install-hdfs.yaml.j2 | 37 + tests/templates/kuttl/shutdown/30-assert.yaml | 69 ++ .../kuttl/shutdown/30-install-hbase.yaml.j2 | 58 ++ tests/templates/kuttl/shutdown/40-assert.yaml | 14 + .../40-install-hbase-test-runner.yaml | 29 + tests/templates/kuttl/shutdown/50-assert.yaml | 8 + .../kuttl/shutdown/50-test-hbase.yaml | 5 + tests/templates/kuttl/shutdown/test-hbase.py | 135 +++ tests/test-definition.yaml | 12 +- 20 files changed, 1166 insertions(+), 339 deletions(-) create mode 100644 tests/templates/kuttl/shutdown/00-limit-range.yaml create mode 100644 tests/templates/kuttl/shutdown/00-patch-ns.yaml.j2 create mode 100644 tests/templates/kuttl/shutdown/01-assert.yaml.j2 create mode 100644 tests/templates/kuttl/shutdown/01-install-vector-aggregator-discovery-configmap.yaml.j2 create mode 100644 tests/templates/kuttl/shutdown/10-assert.yaml create mode 100644 tests/templates/kuttl/shutdown/10-install-zookeeper.yaml.j2 create mode 100644 tests/templates/kuttl/shutdown/20-assert.yaml create mode 100644 tests/templates/kuttl/shutdown/20-install-hdfs.yaml.j2 create mode 100644 tests/templates/kuttl/shutdown/30-assert.yaml create mode 100644 tests/templates/kuttl/shutdown/30-install-hbase.yaml.j2 create mode 100644 tests/templates/kuttl/shutdown/40-assert.yaml create mode 100644 tests/templates/kuttl/shutdown/40-install-hbase-test-runner.yaml create mode 100644 tests/templates/kuttl/shutdown/50-assert.yaml create mode 100644 tests/templates/kuttl/shutdown/50-test-hbase.yaml create mode 100644 tests/templates/kuttl/shutdown/test-hbase.py diff --git a/Cargo.nix b/Cargo.nix index b1c47e78..f8b64df8 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -85,9 +85,10 @@ rec { crates = { "addr2line" = rec { crateName = "addr2line"; - version = "0.22.0"; + version = "0.24.2"; edition = "2018"; - sha256 = "0y66f1sa27i9kvmlh76ynk60rxfrmkba9ja8x527h32wdb206ibf"; + crateBin = []; + sha256 = "1hd1i57zxgz08j6h5qrhsnm2fi0bcqvsh389fw400xm3arz2ggnz"; dependencies = [ { name = "gimli"; @@ -97,28 +98,29 @@ rec { } ]; features = { + "all" = [ "bin" ]; "alloc" = [ "dep:alloc" ]; + "bin" = [ "loader" "rustc-demangle" "cpp_demangle" "fallible-iterator" "smallvec" "dep:clap" ]; "compiler_builtins" = [ "dep:compiler_builtins" ]; "core" = [ "dep:core" ]; "cpp_demangle" = [ "dep:cpp_demangle" ]; - "default" = [ "rustc-demangle" "cpp_demangle" "std-object" "fallible-iterator" "smallvec" "memmap2" ]; + "default" = [ "rustc-demangle" "cpp_demangle" "loader" "fallible-iterator" "smallvec" ]; "fallible-iterator" = [ "dep:fallible-iterator" ]; - "memmap2" = [ "dep:memmap2" ]; - "object" = [ "dep:object" ]; + "loader" = [ "std" "dep:object" "dep:memmap2" "dep:typed-arena" ]; "rustc-demangle" = [ "dep:rustc-demangle" ]; "rustc-dep-of-std" = [ "core" "alloc" "compiler_builtins" "gimli/rustc-dep-of-std" ]; "smallvec" = [ "dep:smallvec" ]; "std" = [ "gimli/std" ]; - "std-object" = [ "std" "object" "object/std" "object/compression" "gimli/endian-reader" ]; }; }; - "adler" = rec { - crateName = "adler"; - version = "1.0.2"; - edition = "2015"; - sha256 = "1zim79cvzd5yrkzl3nyfx0avijwgk9fqv3yrscdy1cc79ih02qpj"; + "adler2" = rec { + crateName = "adler2"; + version = "2.0.0"; + edition = "2021"; + sha256 = "09r6drylvgy8vv8k20lnbvwq8gp09h7smfn6h1rxsy15pgh629si"; authors = [ "Jonas Schievink " + "oyvindln " ]; features = { "compiler_builtins" = [ "dep:compiler_builtins" ]; @@ -328,7 +330,7 @@ rec { dependencies = [ { name = "windows-sys"; - packageId = "windows-sys"; + packageId = "windows-sys 0.52.0"; target = { target, features }: (target."windows" or false); features = [ "Win32_System_Console" "Win32_Foundation" ]; } @@ -348,7 +350,7 @@ rec { } { name = "windows-sys"; - packageId = "windows-sys"; + packageId = "windows-sys 0.52.0"; target = { target, features }: (target."windows" or false); features = [ "Win32_System_Console" "Win32_Foundation" ]; } @@ -357,9 +359,9 @@ rec { }; "anyhow" = rec { crateName = "anyhow"; - version = "1.0.86"; + version = "1.0.89"; edition = "2018"; - sha256 = "1nk301x8qhpdaks6a9zvcp7yakjqnczjmqndbg7vk4494d3d1ldk"; + sha256 = "1xh1vg89n56h6nqikcmgbpmkixjds33492klrp9m96xrbmhgizc6"; authors = [ "David Tolnay " ]; @@ -402,9 +404,9 @@ rec { }; "async-stream" = rec { crateName = "async-stream"; - version = "0.3.5"; - edition = "2018"; - sha256 = "0l8sjq1rylkb1ak0pdyjn83b3k6x36j22myngl4sqqgg7whdsmnd"; + version = "0.3.6"; + edition = "2021"; + sha256 = "0xl4zqncrdmw2g6241wgr11dxdg4h7byy6bz3l6si03qyfk72nhb"; libName = "async_stream"; authors = [ "Carl Lerche " @@ -427,9 +429,9 @@ rec { }; "async-stream-impl" = rec { crateName = "async-stream-impl"; - version = "0.3.5"; - edition = "2018"; - sha256 = "14q179j4y8p2z1d0ic6aqgy9fhwz8p9cai1ia8kpw4bw7q12mrhn"; + version = "0.3.6"; + edition = "2021"; + sha256 = "0kaplfb5axsvf1gfs2gk6c4zx6zcsns0yf3ssk7iwni7bphlvhn7"; procMacro = true; libName = "async_stream_impl"; authors = [ @@ -446,7 +448,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.77"; + packageId = "syn 2.0.79"; features = [ "full" "visit-mut" ]; } ]; @@ -454,9 +456,9 @@ rec { }; "async-trait" = rec { crateName = "async-trait"; - version = "0.1.81"; + version = "0.1.83"; edition = "2021"; - sha256 = "01w10ad3984czxrmc8ckdrabhmsv80aynfxibjnqwz1dr3f2h33f"; + sha256 = "1p8q8gm4fv2fdka8hwy2w3f8df7p5inixqi7rlmbnky3wmysw73j"; procMacro = true; libName = "async_trait"; authors = [ @@ -473,18 +475,18 @@ rec { } { name = "syn"; - packageId = "syn 2.0.77"; + packageId = "syn 2.0.79"; usesDefaultFeatures = false; - features = [ "full" "visit-mut" "parsing" "printing" "proc-macro" ]; + features = [ "full" "parsing" "printing" "proc-macro" "visit-mut" ]; } ]; }; "autocfg" = rec { crateName = "autocfg"; - version = "1.3.0"; + version = "1.4.0"; edition = "2015"; - sha256 = "1c3njkfzpil03k92q0mij5y1pkhhfr4j3bf0h53bgl2vs85lsjqc"; + sha256 = "09lz3by90d2hphbq56znag9v87gfpd9gb8nr82hll8z6x2nhprdc"; authors = [ "Josh Stone " ]; @@ -526,9 +528,9 @@ rec { }; "backtrace" = rec { crateName = "backtrace"; - version = "0.3.73"; + version = "0.3.74"; edition = "2021"; - sha256 = "02iffg2pkg5nc36pgml8il7f77s138hhjw9f9l56v5zqlilk5hjw"; + sha256 = "06pfif7nwx66qf2zaanc2fcq7m64i91ki9imw9xd3bnz5hrwp0ld"; authors = [ "The Rust Project Developers" ]; @@ -566,11 +568,10 @@ rec { name = "rustc-demangle"; packageId = "rustc-demangle"; } - ]; - buildDependencies = [ { - name = "cc"; - packageId = "cc"; + name = "windows-targets"; + packageId = "windows-targets"; + target = { target, features }: (target."windows" or false); } ]; features = { @@ -578,8 +579,6 @@ rec { "default" = [ "std" ]; "serde" = [ "dep:serde" ]; "serialize-serde" = [ "serde" ]; - "verify-winapi" = [ "winapi/dbghelp" "winapi/handleapi" "winapi/libloaderapi" "winapi/memoryapi" "winapi/minwindef" "winapi/processthreadsapi" "winapi/synchapi" "winapi/tlhelp32" "winapi/winbase" "winapi/winnt" "winapi/winnls" "winapi/stringapiset" ]; - "winapi" = [ "dep:winapi" ]; }; resolvedDefaultFeatures = [ "default" "std" ]; }; @@ -761,9 +760,9 @@ rec { }; "bytes" = rec { crateName = "bytes"; - version = "1.7.1"; + version = "1.7.2"; edition = "2018"; - sha256 = "0l5sf69avjxcw41cznyzxsnymwmkpmk08q0sm7fgicvvn0ysa643"; + sha256 = "1wzs7l57iwqmrszdpr2mmqf1b1hgvpxafc30imxhnry0zfl9m3a2"; authors = [ "Carl Lerche " "Sean McArthur " @@ -776,9 +775,9 @@ rec { }; "cc" = rec { crateName = "cc"; - version = "1.1.14"; + version = "1.1.30"; edition = "2018"; - sha256 = "0ci9aqcywcwx7pwpixfr6vas7i9yz7k5w88wwcllbgyiscyfpljh"; + sha256 = "0icr3vn2r5scpgylbplffd5mh7jcdivqh9dfgsxymnc13fk06s5i"; authors = [ "Alex Crichton " ]; @@ -884,10 +883,10 @@ rec { }; "clap" = rec { crateName = "clap"; - version = "4.5.17"; + version = "4.5.20"; edition = "2021"; crateBin = []; - sha256 = "1b7nx9wsv5kc4n02ql4ca6p7pjh1n94rjk1n7hdjywsy96w22niy"; + sha256 = "1s37v23gcxkjy4800qgnkxkpliz68vslpr5sgn1xar56hmnkfzxr"; dependencies = [ { name = "clap_builder"; @@ -925,9 +924,9 @@ rec { }; "clap_builder" = rec { crateName = "clap_builder"; - version = "4.5.17"; + version = "4.5.20"; edition = "2021"; - sha256 = "0wqsnajayxqpmqflqiqgpix2m8jrjwj6nayssvcpl13smw9dvwlc"; + sha256 = "0m6w10l2f65h3ch0d53lql6p26xxrh20ffipra9ysjsfsjmq1g0r"; dependencies = [ { name = "anstream"; @@ -964,9 +963,9 @@ rec { }; "clap_derive" = rec { crateName = "clap_derive"; - version = "4.5.13"; + version = "4.5.18"; edition = "2021"; - sha256 = "1860xq3rbgwsqwcj9rd14cky9iiywwx86j7fvvngdjixbyfka7ah"; + sha256 = "1ardb26bvcpg72q9myr7yir3a8c83gx7vxk1cccabsd9n73s1ija"; procMacro = true; dependencies = [ { @@ -983,7 +982,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.77"; + packageId = "syn 2.0.79"; features = [ "full" ]; } ]; @@ -1143,9 +1142,9 @@ rec { }; "cpufeatures" = rec { crateName = "cpufeatures"; - version = "0.2.13"; + version = "0.2.14"; edition = "2018"; - sha256 = "1b89kljf7phyh63vxwsvf9lbgwkv0dsj7pcjmqgysnwsvkk55s2i"; + sha256 = "1q3qd9qkw94vs7n5i0y3zz2cqgzcxvdgyb54ryngwmjhfbgrg1k0"; authors = [ "RustCrypto Developers" ]; @@ -1287,7 +1286,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.77"; + packageId = "syn 2.0.79"; features = [ "full" "extra-traits" ]; } ]; @@ -1317,16 +1316,16 @@ rec { } { name = "syn"; - packageId = "syn 2.0.77"; + packageId = "syn 2.0.79"; } ]; }; "delegate" = rec { crateName = "delegate"; - version = "0.13.0"; + version = "0.13.1"; edition = "2018"; - sha256 = "0mh98via297c51dq7b2yb0fq7gxlgb8px2iz4w3sjgxpxc7vnq2h"; + sha256 = "0im08r03vbrjcc5rfhk8b3mkrh3d5r8kh5g1hr6wzqcj1khj68xw"; procMacro = true; authors = [ "Godfrey Chan " @@ -1343,7 +1342,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.77"; + packageId = "syn 2.0.79"; features = [ "full" "visit-mut" ]; } ]; @@ -1639,13 +1638,13 @@ rec { } { name = "regex-automata"; - packageId = "regex-automata 0.4.7"; + packageId = "regex-automata 0.4.8"; usesDefaultFeatures = false; features = [ "alloc" "syntax" "meta" "nfa" "dfa" "hybrid" ]; } { name = "regex-syntax"; - packageId = "regex-syntax 0.8.4"; + packageId = "regex-syntax 0.8.5"; usesDefaultFeatures = false; } ]; @@ -1726,11 +1725,11 @@ rec { }; resolvedDefaultFeatures = [ "default" "use_std" "with-deprecated" ]; }; - "futures 0.3.30" = rec { + "futures 0.3.31" = rec { crateName = "futures"; - version = "0.3.30"; + version = "0.3.31"; edition = "2018"; - sha256 = "1c04g14bccmprwsvx2j9m2blhwrynq7vhl151lsvcv4gi0b6jp34"; + sha256 = "0xh8ddbkm9jy8kc5gbvjp9a4b6rqqxvc8471yb2qaz5wm2qhgg35"; dependencies = [ { name = "futures-channel"; @@ -1789,9 +1788,9 @@ rec { }; "futures-channel" = rec { crateName = "futures-channel"; - version = "0.3.30"; + version = "0.3.31"; edition = "2018"; - sha256 = "0y6b7xxqdjm9hlcjpakcg41qfl7lihf6gavk8fyqijsxhvbzgj7a"; + sha256 = "040vpqpqlbk099razq8lyn74m0f161zd0rp36hciqrwcg2zibzrd"; libName = "futures_channel"; dependencies = [ { @@ -1817,9 +1816,9 @@ rec { }; "futures-core" = rec { crateName = "futures-core"; - version = "0.3.30"; + version = "0.3.31"; edition = "2018"; - sha256 = "07aslayrn3lbggj54kci0ishmd1pr367fp7iks7adia1p05miinz"; + sha256 = "0gk6yrxgi5ihfanm2y431jadrll00n5ifhnpx090c2f2q1cr1wh5"; libName = "futures_core"; features = { "default" = [ "std" ]; @@ -1830,9 +1829,9 @@ rec { }; "futures-executor" = rec { crateName = "futures-executor"; - version = "0.3.30"; + version = "0.3.31"; edition = "2018"; - sha256 = "07dh08gs9vfll2h36kq32q9xd86xm6lyl9xikmmwlkqnmrrgqxm5"; + sha256 = "17vcci6mdfzx4gbk0wx64chr2f13wwwpvyf3xd5fb1gmjzcx2a0y"; libName = "futures_executor"; dependencies = [ { @@ -1861,9 +1860,9 @@ rec { }; "futures-io" = rec { crateName = "futures-io"; - version = "0.3.30"; + version = "0.3.31"; edition = "2018"; - sha256 = "1hgh25isvsr4ybibywhr4dpys8mjnscw4wfxxwca70cn1gi26im4"; + sha256 = "1ikmw1yfbgvsychmsihdkwa8a1knank2d9a8dk01mbjar9w1np4y"; libName = "futures_io"; features = { "default" = [ "std" ]; @@ -1872,9 +1871,9 @@ rec { }; "futures-macro" = rec { crateName = "futures-macro"; - version = "0.3.30"; + version = "0.3.31"; edition = "2018"; - sha256 = "1b49qh9d402y8nka4q6wvvj0c88qq91wbr192mdn5h54nzs0qxc7"; + sha256 = "0l1n7kqzwwmgiznn0ywdc5i24z72zvh9q1dwps54mimppi7f6bhn"; procMacro = true; libName = "futures_macro"; dependencies = [ @@ -1888,7 +1887,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.77"; + packageId = "syn 2.0.79"; features = [ "full" ]; } ]; @@ -1896,9 +1895,9 @@ rec { }; "futures-sink" = rec { crateName = "futures-sink"; - version = "0.3.30"; + version = "0.3.31"; edition = "2018"; - sha256 = "1dag8xyyaya8n8mh8smx7x6w2dpmafg2din145v973a3hw7f1f4z"; + sha256 = "1xyly6naq6aqm52d5rh236snm08kw8zadydwqz8bip70s6vzlxg5"; libName = "futures_sink"; features = { "default" = [ "std" ]; @@ -1908,9 +1907,9 @@ rec { }; "futures-task" = rec { crateName = "futures-task"; - version = "0.3.30"; + version = "0.3.31"; edition = "2018"; - sha256 = "013h1724454hj8qczp8vvs10qfiqrxr937qsrv6rhii68ahlzn1q"; + sha256 = "124rv4n90f5xwfsm9qw6y99755y021cmi5dhzh253s920z77s3zr"; libName = "futures_task"; features = { "default" = [ "std" ]; @@ -1935,9 +1934,9 @@ rec { }; "futures-util" = rec { crateName = "futures-util"; - version = "0.3.30"; + version = "0.3.31"; edition = "2018"; - sha256 = "0j0xqhcir1zf2dcbpd421kgw6wvsk0rpxflylcysn1rlp3g02r1x"; + sha256 = "10aa1ar8bgkgbr4wzxlidkqkcxf77gffyj8j7768h831pcaq784z"; libName = "futures_util"; dependencies = [ { @@ -2091,9 +2090,9 @@ rec { }; "gimli" = rec { crateName = "gimli"; - version = "0.29.0"; + version = "0.31.1"; edition = "2018"; - sha256 = "1zgzprnjaawmg6zyic4f2q2hc39kdhn116qnkqpgvsasgc3x9v20"; + sha256 = "0gvqc0ramx8szv76jhfd4dms0zyamvlg4whhiz11j34hh3dqxqh7"; features = { "default" = [ "read-all" "write" ]; "endian-reader" = [ "read" "dep:stable_deref_trait" ]; @@ -2159,7 +2158,7 @@ rec { ]; }; - "hashbrown" = rec { + "hashbrown 0.14.5" = rec { crateName = "hashbrown"; version = "0.14.5"; edition = "2021"; @@ -2196,7 +2195,30 @@ rec { "rustc-dep-of-std" = [ "nightly" "core" "compiler_builtins" "alloc" "rustc-internal-api" ]; "serde" = [ "dep:serde" ]; }; - resolvedDefaultFeatures = [ "ahash" "allocator-api2" "default" "inline-more" "raw" ]; + resolvedDefaultFeatures = [ "ahash" "allocator-api2" "default" "inline-more" ]; + }; + "hashbrown 0.15.0" = rec { + crateName = "hashbrown"; + version = "0.15.0"; + edition = "2021"; + sha256 = "1yx4xq091s7i6mw6bn77k8cp4jrpcac149xr32rg8szqsj27y20y"; + authors = [ + "Amanieu d'Antras " + ]; + features = { + "alloc" = [ "dep:alloc" ]; + "allocator-api2" = [ "dep:allocator-api2" ]; + "borsh" = [ "dep:borsh" ]; + "compiler_builtins" = [ "dep:compiler_builtins" ]; + "core" = [ "dep:core" ]; + "default" = [ "default-hasher" "inline-more" "allocator-api2" "equivalent" "raw-entry" ]; + "default-hasher" = [ "dep:foldhash" ]; + "equivalent" = [ "dep:equivalent" ]; + "nightly" = [ "allocator-api2?/nightly" "bumpalo/allocator_api" ]; + "rayon" = [ "dep:rayon" ]; + "rustc-dep-of-std" = [ "nightly" "core" "compiler_builtins" "alloc" "rustc-internal-api" "raw-entry" ]; + "serde" = [ "dep:serde" ]; + }; }; "headers" = rec { crateName = "headers"; @@ -2291,7 +2313,7 @@ rec { dependencies = [ { name = "windows-sys"; - packageId = "windows-sys"; + packageId = "windows-sys 0.52.0"; target = { target, features }: (target."windows" or false); features = [ "Win32_Foundation" "Win32_UI_Shell" "Win32_System_Com" ]; } @@ -2388,9 +2410,9 @@ rec { }; "httparse" = rec { crateName = "httparse"; - version = "1.9.4"; + version = "1.9.5"; edition = "2018"; - sha256 = "1nc2s1pziq5ncl39xm7ybdhpnw5xsm505smqirr0py2v2550pk0g"; + sha256 = "0ip9v8m9lvgvq1lznl31wvn0ch1v254na7lhid9p29yx9rbx6wbx"; authors = [ "Sean McArthur " ]; @@ -2551,7 +2573,7 @@ rec { } { name = "rustls-native-certs"; - packageId = "rustls-native-certs"; + packageId = "rustls-native-certs 0.7.3"; optional = true; } { @@ -2602,9 +2624,9 @@ rec { }; "hyper-rustls" = rec { crateName = "hyper-rustls"; - version = "0.27.2"; + version = "0.27.3"; edition = "2021"; - sha256 = "0ma1wyfnqnkz7zyr7wpply3xfvlijd0rqqhb6ajs28c9jhnbxr2y"; + sha256 = "0cxkph8hsmbz693a8ih2ciy7h0xbac844rpm981y6c0iqfsxpbq8"; libName = "hyper_rustls"; dependencies = [ { @@ -2639,7 +2661,7 @@ rec { } { name = "rustls-native-certs"; - packageId = "rustls-native-certs"; + packageId = "rustls-native-certs 0.8.0"; optional = true; } { @@ -2746,9 +2768,9 @@ rec { }; "hyper-util" = rec { crateName = "hyper-util"; - version = "0.1.7"; + version = "0.1.9"; edition = "2021"; - sha256 = "1fg9h591skksq5zxnffyisj7487jhdcgj6c7bvlkckn535bhbryd"; + sha256 = "12yhradh0bpwa9jjyyq6shrrcx9fxbdkrq06xj7ccfhqkyq6waa1"; libName = "hyper_util"; authors = [ "Sean McArthur " @@ -2796,13 +2818,6 @@ rec { optional = true; usesDefaultFeatures = false; } - { - name = "tower"; - packageId = "tower"; - optional = true; - usesDefaultFeatures = false; - features = [ "make" "util" ]; - } { name = "tower-service"; packageId = "tower-service"; @@ -2833,24 +2848,24 @@ rec { } ]; features = { - "client" = [ "hyper/client" "dep:tracing" "dep:futures-channel" "dep:tower" "dep:tower-service" ]; + "client" = [ "hyper/client" "dep:tracing" "dep:futures-channel" "dep:tower-service" ]; "client-legacy" = [ "client" "dep:socket2" "tokio/sync" ]; "full" = [ "client" "client-legacy" "server" "server-auto" "server-graceful" "service" "http1" "http2" "tokio" ]; "http1" = [ "hyper/http1" ]; "http2" = [ "hyper/http2" ]; "server" = [ "hyper/server" ]; "server-auto" = [ "server" "http1" "http2" ]; - "server-graceful" = [ "server" "tokio/sync" ]; - "service" = [ "dep:tower" "dep:tower-service" ]; + "server-graceful" = [ "server" "tokio/sync" "futures-util/alloc" ]; + "service" = [ "dep:tower-service" ]; "tokio" = [ "dep:tokio" "tokio/net" "tokio/rt" "tokio/time" ]; }; resolvedDefaultFeatures = [ "client" "client-legacy" "default" "http1" "tokio" ]; }; "iana-time-zone" = rec { crateName = "iana-time-zone"; - version = "0.1.60"; + version = "0.1.61"; edition = "2018"; - sha256 = "0hdid5xz3jznm04lysjm3vi93h3c523w0hcc3xba47jl3ddbpzz7"; + sha256 = "085jjsls330yj1fnwykfzmb2f10zp6l7w4fhq81ng81574ghhpi3"; libName = "iana_time_zone"; authors = [ "Andrew Straw " @@ -2876,12 +2891,12 @@ rec { { name = "js-sys"; packageId = "js-sys"; - target = { target, features }: ("wasm32" == target."arch" or null); + target = { target, features }: (("wasm32" == target."arch" or null) && ("unknown" == target."os" or null)); } { name = "wasm-bindgen"; packageId = "wasm-bindgen"; - target = { target, features }: ("wasm32" == target."arch" or null); + target = { target, features }: (("wasm32" == target."arch" or null) && ("unknown" == target."os" or null)); } { name = "windows-core"; @@ -2949,9 +2964,9 @@ rec { }; "indexmap" = rec { crateName = "indexmap"; - version = "2.4.0"; + version = "2.6.0"; edition = "2021"; - sha256 = "0p2hwvmir50qcl5q6lib8fjq5dzv4f0gqy8czcyfva3yzhzdbslk"; + sha256 = "1nmrwn8lbs19gkvhxaawffzbvrpyrb5y3drcrr645x957kz0fybh"; dependencies = [ { name = "equivalent"; @@ -2960,9 +2975,8 @@ rec { } { name = "hashbrown"; - packageId = "hashbrown"; + packageId = "hashbrown 0.15.0"; usesDefaultFeatures = false; - features = [ "raw" ]; } ]; features = { @@ -3091,9 +3105,9 @@ rec { }; "js-sys" = rec { crateName = "js-sys"; - version = "0.3.70"; + version = "0.3.72"; edition = "2021"; - sha256 = "0yp3rz7vrn9mmqdpkds426r1p9vs6i8mkxx8ryqdfadr0s2q0s0q"; + sha256 = "1a8r61hbgw5kmscgj3g5pzg2ywlnswvljy0l592v0xdxlayz323a"; libName = "js_sys"; authors = [ "The wasm-bindgen Developers" @@ -3384,7 +3398,7 @@ rec { } { name = "futures"; - packageId = "futures 0.3.30"; + packageId = "futures 0.3.31"; optional = true; usesDefaultFeatures = false; features = [ "std" ]; @@ -3525,7 +3539,7 @@ rec { devDependencies = [ { name = "futures"; - packageId = "futures 0.3.30"; + packageId = "futures 0.3.31"; usesDefaultFeatures = false; features = [ "async-await" ]; } @@ -3699,7 +3713,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.77"; + packageId = "syn 2.0.79"; features = [ "extra-traits" ]; } ]; @@ -3743,13 +3757,13 @@ rec { } { name = "futures"; - packageId = "futures 0.3.30"; + packageId = "futures 0.3.31"; usesDefaultFeatures = false; features = [ "async-await" ]; } { name = "hashbrown"; - packageId = "hashbrown"; + packageId = "hashbrown 0.14.5"; } { name = "json-patch"; @@ -3841,9 +3855,9 @@ rec { }; "libc" = rec { crateName = "libc"; - version = "0.2.158"; + version = "0.2.159"; edition = "2015"; - sha256 = "0fb4qldw1jrxljrwz6bsjn8lv4rqizlqmab41q3j98q332xw9bfq"; + sha256 = "1i9xpia0hn1y8dws7all8rqng6h3lc8ymlgslnljcvm376jrf7an"; authors = [ "The Rust Project Developers" ]; @@ -3901,10 +3915,10 @@ rec { }; "libz-sys" = rec { crateName = "libz-sys"; - version = "1.1.19"; + version = "1.1.20"; edition = "2018"; links = "z"; - sha256 = "0is6lzp9xrgryn57d6ajvadkrs40vzvk37yjkyy6wjd7k5vkmigx"; + sha256 = "0wp4i6zl385ilmcqafv61jwsk1mpk6yb8gpws9nwza00x19n9lfj"; libName = "libz_sys"; authors = [ "Alex Crichton " @@ -4040,17 +4054,17 @@ rec { }; "miniz_oxide" = rec { crateName = "miniz_oxide"; - version = "0.7.4"; - edition = "2018"; - sha256 = "024wv14aa75cvik7005s5y2nfc8zfidddbd7g55g7sjgnzfl18mq"; + version = "0.8.0"; + edition = "2021"; + sha256 = "1wadxkg6a6z4lr7kskapj5d8pxlx7cp1ifw4daqnkzqjxych5n72"; authors = [ "Frommi " "oyvindln " ]; dependencies = [ { - name = "adler"; - packageId = "adler"; + name = "adler2"; + packageId = "adler2"; usesDefaultFeatures = false; } ]; @@ -4059,7 +4073,7 @@ rec { "compiler_builtins" = [ "dep:compiler_builtins" ]; "core" = [ "dep:core" ]; "default" = [ "with-alloc" ]; - "rustc-dep-of-std" = [ "core" "alloc" "compiler_builtins" "adler/rustc-dep-of-std" ]; + "rustc-dep-of-std" = [ "core" "alloc" "compiler_builtins" "adler2/rustc-dep-of-std" ]; "simd" = [ "simd-adler32" ]; "simd-adler32" = [ "dep:simd-adler32" ]; }; @@ -4098,7 +4112,7 @@ rec { } { name = "windows-sys"; - packageId = "windows-sys"; + packageId = "windows-sys 0.52.0"; target = { target, features }: (target."windows" or false); features = [ "Wdk_Foundation" "Wdk_Storage_FileSystem" "Wdk_System_IO" "Win32_Foundation" "Win32_Networking_WinSock" "Win32_Storage_FileSystem" "Win32_System_IO" "Win32_System_WindowsProgramming" ]; } @@ -4195,9 +4209,9 @@ rec { }; "object" = rec { crateName = "object"; - version = "0.36.3"; + version = "0.36.5"; edition = "2018"; - sha256 = "1nggchwvjgilrxarwcmfcisa9fq1phg382y672aa6lb86ir4kdi7"; + sha256 = "0gk8lhbs229c68lapq6w6qmnm4jkj48hrcw5ilfyswy514nhmpxf"; dependencies = [ { name = "memchr"; @@ -4229,9 +4243,9 @@ rec { }; "once_cell" = rec { crateName = "once_cell"; - version = "1.19.0"; + version = "1.20.2"; edition = "2021"; - sha256 = "14kvw7px5z96dk4dwdm1r9cqhhy2cyj1l5n5b29mynbb8yr15nrz"; + sha256 = "0xb7rw1aqr7pa4z3b00y7786gyf8awx2gca3md73afy76dzgwq8j"; authors = [ "Aleksey Kladov " ]; @@ -4445,7 +4459,7 @@ rec { } { name = "ordered-float"; - packageId = "ordered-float 4.2.2"; + packageId = "ordered-float 4.3.0"; } { name = "percent-encoding"; @@ -4533,11 +4547,11 @@ rec { }; resolvedDefaultFeatures = [ "default" "std" ]; }; - "ordered-float 4.2.2" = rec { + "ordered-float 4.3.0" = rec { crateName = "ordered-float"; - version = "4.2.2"; + version = "4.3.0"; edition = "2021"; - sha256 = "19k5c2m8m7xfkw7wa4i65krswbnd2299ar6fj1wqqvv78hc1g4aa"; + sha256 = "0dr5d8byvqkiclxjimp5kyh3m9qz4zvwifx6cg0d6w9glzqh3ma4"; libName = "ordered_float"; authors = [ "Jonathan Reem " @@ -4555,6 +4569,7 @@ rec { "borsh" = [ "dep:borsh" ]; "bytemuck" = [ "dep:bytemuck" ]; "default" = [ "std" ]; + "num-cmp" = [ "dep:num-cmp" ]; "proptest" = [ "dep:proptest" ]; "rand" = [ "dep:rand" ]; "randtest" = [ "rand/std" "rand/std_rng" ]; @@ -4582,9 +4597,9 @@ rec { }; "parking" = rec { crateName = "parking"; - version = "2.2.0"; + version = "2.2.1"; edition = "2018"; - sha256 = "1blwbkq6im1hfxp5wlbr475mw98rsyc0bbr2d5n16m38z253p0dv"; + sha256 = "1fnfgmzkfpjd69v4j9x737b1k8pnn054bvzcn5dm3pkgq595d3gk"; authors = [ "Stjepan Glavina " "The Rust Project Developers" @@ -4706,9 +4721,9 @@ rec { }; "pest" = rec { crateName = "pest"; - version = "2.7.11"; + version = "2.7.14"; edition = "2021"; - sha256 = "15cxh3nc7yibzjn6dbndjkbhadhkry60jdx83kf5ywr67zwdylyd"; + sha256 = "0hplghvnz8yhs4mgpy7854gkpp6ysr96fy7ircs0k4w33al556c7"; authors = [ "Dragoș Tiselice " ]; @@ -4732,6 +4747,7 @@ rec { features = { "default" = [ "std" "memchr" ]; "memchr" = [ "dep:memchr" ]; + "miette-error" = [ "std" "pretty-print" "dep:miette" "dep:thiserror" ]; "pretty-print" = [ "dep:serde" "dep:serde_json" ]; "std" = [ "ucd-trie/std" "dep:thiserror" ]; }; @@ -4739,9 +4755,9 @@ rec { }; "pest_derive" = rec { crateName = "pest_derive"; - version = "2.7.11"; + version = "2.7.14"; edition = "2021"; - sha256 = "16p49072arqm45l6j5blisjshj45rxpx6m254hf3nxx6xhmqsm1a"; + sha256 = "1p82kbjm5dvflxgj9vl3q78n2v4l9khh2cwizm3kl4ibcdgkc56j"; procMacro = true; authors = [ "Dragoș Tiselice " @@ -4768,9 +4784,9 @@ rec { }; "pest_generator" = rec { crateName = "pest_generator"; - version = "2.7.11"; + version = "2.7.14"; edition = "2021"; - sha256 = "10vi0wbrxih85pghd1y2vkpnka68hyl5wkplpbf2amqlilpai4rw"; + sha256 = "0khcyqjyd8pg1qcivh1xzk9613zbn983ycdclap1f5rh6ikmhmgb"; authors = [ "Dragoș Tiselice " ]; @@ -4794,7 +4810,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.77"; + packageId = "syn 2.0.79"; } ]; features = { @@ -4807,9 +4823,9 @@ rec { }; "pest_meta" = rec { crateName = "pest_meta"; - version = "2.7.11"; + version = "2.7.14"; edition = "2021"; - sha256 = "0ksc295cyz9yxzsqvaaxfmmwrapzns2nfksyqbgbw23yxagl4hd9"; + sha256 = "0gfhci2whiz3kiw2k2asj2lcj8rrrp4hm69whdvcpngl1jks4pdp"; authors = [ "Dragoș Tiselice " ]; @@ -4837,9 +4853,9 @@ rec { }; "pin-project" = rec { crateName = "pin-project"; - version = "1.1.5"; + version = "1.1.6"; edition = "2021"; - sha256 = "1cxl146x0q7lawp0m1826wsgj8mmmfs6ja8q7m6f7ff5j6vl7gxn"; + sha256 = "1v4924b870bss0x5ahww9a164d4dbny90vzkmljfbqfxc6hj7wds"; libName = "pin_project"; dependencies = [ { @@ -4851,9 +4867,9 @@ rec { }; "pin-project-internal" = rec { crateName = "pin-project-internal"; - version = "1.1.5"; + version = "1.1.6"; edition = "2021"; - sha256 = "0r9r4ivwiyqf45sv6b30l1dx282lxaax2f6gl84jwa3q590s8f1g"; + sha256 = "1y2pjavbcq40njylbnw3929i8nnrcdzrhgalzgqk57ya2n2jsl54"; procMacro = true; libName = "pin_project_internal"; dependencies = [ @@ -4867,8 +4883,9 @@ rec { } { name = "syn"; - packageId = "syn 2.0.77"; - features = [ "full" "visit-mut" ]; + packageId = "syn 2.0.79"; + usesDefaultFeatures = false; + features = [ "parsing" "printing" "clone-impls" "proc-macro" "full" "visit-mut" ]; } ]; @@ -4894,9 +4911,9 @@ rec { }; "pkg-config" = rec { crateName = "pkg-config"; - version = "0.3.30"; - edition = "2015"; - sha256 = "1v07557dj1sa0aly9c90wsygc0i8xv5vnmyv0g94lpkvj8qb4cfj"; + version = "0.3.31"; + edition = "2018"; + sha256 = "1wk6yp2phl91795ia0lwkr3wl4a9xkrympvhqq8cxk4d75hwhglm"; libName = "pkg_config"; authors = [ "Alex Crichton " @@ -4940,9 +4957,9 @@ rec { }; "proc-macro-crate" = rec { crateName = "proc-macro-crate"; - version = "3.1.0"; + version = "3.2.0"; edition = "2021"; - sha256 = "110jcl9vnj92ihbhjqmkp19m8rzxc14a7i60knlmv99qlwfcadvd"; + sha256 = "0yzsqnavb3lmrcsmbrdjfrky9vcbl46v59xi9avn0796rb3likwf"; libName = "proc_macro_crate"; authors = [ "Bastian Köcher " @@ -4957,9 +4974,9 @@ rec { }; "proc-macro2" = rec { crateName = "proc-macro2"; - version = "1.0.86"; + version = "1.0.87"; edition = "2021"; - sha256 = "0xrv22p8lqlfdf1w0pj4si8n2ws4aw0kilmziwf0vpv5ys6rwway"; + sha256 = "16mifsq1nqzk81qm82aszib44jsd23gpqic5z4kbmzpnvjhdmr5k"; libName = "proc_macro2"; authors = [ "David Tolnay " @@ -5022,7 +5039,7 @@ rec { } { name = "snafu"; - packageId = "snafu 0.8.4"; + packageId = "snafu 0.8.5"; } { name = "xml-rs"; @@ -5152,9 +5169,9 @@ rec { }; "redox_syscall" = rec { crateName = "redox_syscall"; - version = "0.5.3"; - edition = "2018"; - sha256 = "1916m7abg9649gkif055pn5nsvqjhp70isy0v7gx1zgi01p8m41a"; + version = "0.5.7"; + edition = "2021"; + sha256 = "07vpgfr6a04k0x19zqr1xdlqm6fncik3zydbdi3f5g3l5k7zwvcv"; libName = "syscall"; authors = [ "Jeremy Soller " @@ -5167,14 +5184,16 @@ rec { ]; features = { "core" = [ "dep:core" ]; + "default" = [ "userspace" ]; "rustc-dep-of-std" = [ "core" "bitflags/rustc-dep-of-std" ]; }; + resolvedDefaultFeatures = [ "default" "userspace" ]; }; "regex" = rec { crateName = "regex"; - version = "1.10.6"; + version = "1.11.0"; edition = "2021"; - sha256 = "06cnlxwzyqfbw1za1i7ks89ns4i2kr0lpg5ykx56b8v7dd6df6a2"; + sha256 = "1n5imk7yxam409ik5nagsjpwqvbg3f0g0mznd5drf549x1g0w81q"; authors = [ "The Rust Project Developers" "Andrew Gallant " @@ -5194,13 +5213,13 @@ rec { } { name = "regex-automata"; - packageId = "regex-automata 0.4.7"; + packageId = "regex-automata 0.4.8"; usesDefaultFeatures = false; features = [ "alloc" "syntax" "meta" "nfa-pikevm" ]; } { name = "regex-syntax"; - packageId = "regex-syntax 0.8.4"; + packageId = "regex-syntax 0.8.5"; usesDefaultFeatures = false; } ]; @@ -5253,11 +5272,11 @@ rec { }; resolvedDefaultFeatures = [ "default" "regex-syntax" "std" ]; }; - "regex-automata 0.4.7" = rec { + "regex-automata 0.4.8" = rec { crateName = "regex-automata"; - version = "0.4.7"; + version = "0.4.8"; edition = "2021"; - sha256 = "1pwjdi4jckpbaivpl6x4v5g4crb37zr2wac93wlfsbzgqn6gbjiq"; + sha256 = "18wd530ndrmygi6xnz3sp345qi0hy2kdbsa89182nwbl6br5i1rn"; libName = "regex_automata"; authors = [ "The Rust Project Developers" @@ -5278,7 +5297,7 @@ rec { } { name = "regex-syntax"; - packageId = "regex-syntax 0.8.4"; + packageId = "regex-syntax 0.8.5"; optional = true; usesDefaultFeatures = false; } @@ -5329,11 +5348,11 @@ rec { }; resolvedDefaultFeatures = [ "default" "unicode" "unicode-age" "unicode-bool" "unicode-case" "unicode-gencat" "unicode-perl" "unicode-script" "unicode-segment" ]; }; - "regex-syntax 0.8.4" = rec { + "regex-syntax 0.8.5" = rec { crateName = "regex-syntax"; - version = "0.8.4"; + version = "0.8.5"; edition = "2021"; - sha256 = "16r0kjy20vx33dr4mhasj5l1f87czas714x2fz6zl0f8wwxa0rks"; + sha256 = "0p41p3hj9ww7blnbwbj9h7rwxzxg0c1hvrdycgys8rxyhqqw859b"; libName = "regex_syntax"; authors = [ "The Rust Project Developers" @@ -5398,7 +5417,7 @@ rec { } { name = "windows-sys"; - packageId = "windows-sys"; + packageId = "windows-sys 0.52.0"; target = { target, features }: (("aarch64" == target."arch" or null) && ("windows" == target."os" or null)); features = [ "Win32_Foundation" "Win32_System_Threading" ]; } @@ -5436,7 +5455,7 @@ rec { dependencies = [ { name = "futures"; - packageId = "futures 0.3.30"; + packageId = "futures 0.3.31"; optional = true; } { @@ -5504,7 +5523,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.77"; + packageId = "syn 2.0.79"; features = [ "full" "parsing" "extra-traits" "visit" "visit-mut" ]; } { @@ -5541,13 +5560,9 @@ rec { }; "rustc_version" = rec { crateName = "rustc_version"; - version = "0.4.0"; + version = "0.4.1"; edition = "2018"; - sha256 = "0rpk9rcdk405xhbmgclsh4pai0svn49x35aggl4nhbkd4a2zb85z"; - authors = [ - "Dirkjan Ochtman " - "Marvin Löbel " - ]; + sha256 = "14lvdsmr5si5qbqzrajgb6vfn69k0sfygrvfvr2mps26xwi3mjyg"; dependencies = [ { name = "semver"; @@ -5558,9 +5573,9 @@ rec { }; "rustls" = rec { crateName = "rustls"; - version = "0.23.12"; + version = "0.23.14"; edition = "2021"; - sha256 = "0i5h0sw8j6bly8rilidb0snd5czpkyjhzqfcd890mz1f7628r3y5"; + sha256 = "1a0b2sdvq69vqrz08wvjmlqafzh7pfgzhn9j0n107f9wd529jpa1"; dependencies = [ { name = "log"; @@ -5624,11 +5639,45 @@ rec { }; resolvedDefaultFeatures = [ "log" "logging" "ring" "std" "tls12" ]; }; - "rustls-native-certs" = rec { + "rustls-native-certs 0.7.3" = rec { crateName = "rustls-native-certs"; - version = "0.7.2"; + version = "0.7.3"; + edition = "2021"; + sha256 = "1r9ib5gwkfci2wbqnbh44nigvrfgxs4n1x89js82w97dxsab7gz5"; + libName = "rustls_native_certs"; + dependencies = [ + { + name = "openssl-probe"; + packageId = "openssl-probe"; + target = { target, features }: ((target."unix" or false) && (!("macos" == target."os" or null))); + } + { + name = "rustls-pemfile"; + packageId = "rustls-pemfile"; + } + { + name = "rustls-pki-types"; + packageId = "rustls-pki-types"; + rename = "pki-types"; + } + { + name = "schannel"; + packageId = "schannel"; + target = { target, features }: (target."windows" or false); + } + { + name = "security-framework"; + packageId = "security-framework"; + target = { target, features }: ("macos" == target."os" or null); + } + ]; + + }; + "rustls-native-certs 0.8.0" = rec { + crateName = "rustls-native-certs"; + version = "0.8.0"; edition = "2021"; - sha256 = "1ynz8a108bd3k7zix26z79n8cnqfsrfflsf01x7406h9r7zjs604"; + sha256 = "12izz1ahwj3yr9fkd39q1w535577z9wsapsahz6jcwxyyaj1ibzw"; libName = "rustls_native_certs"; dependencies = [ { @@ -5660,17 +5709,11 @@ rec { }; "rustls-pemfile" = rec { crateName = "rustls-pemfile"; - version = "2.1.3"; + version = "2.2.0"; edition = "2018"; - sha256 = "09bl873pkibmb2da49kkbm9jlagscjvzrv257q6k01p101my2vqr"; + sha256 = "0l3f3mrfkgdjrava7ibwzgwc4h3dljw3pdkbsi9rkwz3zvji9qyw"; libName = "rustls_pemfile"; dependencies = [ - { - name = "base64"; - packageId = "base64 0.22.1"; - usesDefaultFeatures = false; - features = [ "alloc" ]; - } { name = "rustls-pki-types"; packageId = "rustls-pki-types"; @@ -5679,15 +5722,15 @@ rec { ]; features = { "default" = [ "std" ]; - "std" = [ "base64/std" ]; + "std" = [ "pki-types/std" ]; }; resolvedDefaultFeatures = [ "default" "std" ]; }; "rustls-pki-types" = rec { crateName = "rustls-pki-types"; - version = "1.8.0"; + version = "1.9.0"; edition = "2021"; - sha256 = "1w6a1x8h61p5ddlnijfvj5fvs516h5xr5rw1pc0m8rgq8vk2q2pw"; + sha256 = "0mcc901b4hm2ql2qwpf2gzqhqn6d7iag92hr872wjr8c6wsnws8f"; libName = "rustls_pki_types"; features = { "default" = [ "alloc" ]; @@ -5699,9 +5742,9 @@ rec { }; "rustls-webpki" = rec { crateName = "rustls-webpki"; - version = "0.102.6"; + version = "0.102.8"; edition = "2021"; - sha256 = "0bl55zb5m78l45d8i5frracq96x8shsshmfwby1zsxm1zpa54swf"; + sha256 = "1sdy8ks86b7jpabpnb2px2s7f1sq8v0nqf6fnlvwzm4vfk41pjk4"; libName = "webpki"; dependencies = [ { @@ -5756,9 +5799,9 @@ rec { }; "schannel" = rec { crateName = "schannel"; - version = "0.1.23"; + version = "0.1.26"; edition = "2018"; - sha256 = "0d1m156bsjrws6xzzr1wyfyih9i22mb2csb5pc5kmkrvci2ibjgv"; + sha256 = "1hfip5mdwqcfnmrnkrq9d8zwy6bssmf6rfm2441nk83ghbjpn8h1"; authors = [ "Steven Fackler " "Steffen Butzer " @@ -5766,14 +5809,14 @@ rec { dependencies = [ { name = "windows-sys"; - packageId = "windows-sys"; - features = [ "Win32_Foundation" "Win32_Security_Cryptography" "Win32_Security_Authentication_Identity" "Win32_Security_Credentials" "Win32_System_Memory" ]; + packageId = "windows-sys 0.59.0"; + features = [ "Win32_Foundation" "Win32_Security_Cryptography" "Win32_Security_Authentication_Identity" "Win32_Security_Credentials" "Win32_System_LibraryLoader" "Win32_System_Memory" "Win32_System_SystemInformation" ]; } ]; devDependencies = [ { name = "windows-sys"; - packageId = "windows-sys"; + packageId = "windows-sys 0.59.0"; features = [ "Win32_System_SystemInformation" "Win32_System_Time" ]; } ]; @@ -5869,7 +5912,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.77"; + packageId = "syn 2.0.79"; features = [ "extra-traits" ]; } ]; @@ -5964,9 +6007,9 @@ rec { }; "security-framework-sys" = rec { crateName = "security-framework-sys"; - version = "2.11.1"; + version = "2.12.0"; edition = "2021"; - sha256 = "1byfpx39sbmndfjrlqqylcxdpn3mpjyb9d92dffzw24vkgz2knkm"; + sha256 = "1dml0lp9lrvvi01s011lyss5kzzsmakaamdwsxr0431jd4l2jjpa"; libName = "security_framework_sys"; authors = [ "Steven Fackler " @@ -6087,7 +6130,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.77"; + packageId = "syn 2.0.79"; usesDefaultFeatures = false; features = [ "clone-impls" "derive" "parsing" "printing" "proc-macro" ]; } @@ -6119,7 +6162,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.77"; + packageId = "syn 2.0.79"; usesDefaultFeatures = false; features = [ "clone-impls" "derive" "parsing" "printing" ]; } @@ -6300,6 +6343,17 @@ rec { "loom" = [ "dep:loom" ]; }; }; + "shell-escape" = rec { + crateName = "shell-escape"; + version = "0.1.5"; + edition = "2015"; + sha256 = "0kqq83dk0r1fqj4cfzddpxrni2hpz5i1y607g366c4m9iyhngfs5"; + libName = "shell_escape"; + authors = [ + "Steven Fackler " + ]; + + }; "shlex" = rec { crateName = "shlex"; version = "1.3.0"; @@ -6407,18 +6461,18 @@ rec { }; resolvedDefaultFeatures = [ "default" "guide" "std" ]; }; - "snafu 0.8.4" = rec { + "snafu 0.8.5" = rec { crateName = "snafu"; - version = "0.8.4"; + version = "0.8.5"; edition = "2018"; - sha256 = "17f7w6d3szwc2s4q2vkc616yb4g70llqcbb7b90v63b60awmr0rb"; + sha256 = "06ahz9g4f6475rspfcay8512x776wpxc205rizzc6a9abv492f12"; authors = [ "Jake Goulding " ]; dependencies = [ { name = "snafu-derive"; - packageId = "snafu-derive 0.8.4"; + packageId = "snafu-derive 0.8.5"; } ]; features = { @@ -6432,6 +6486,7 @@ rec { "pin-project" = [ "dep:pin-project" ]; "rust_1_61" = [ "snafu-derive/rust_1_61" ]; "rust_1_65" = [ "rust_1_61" ]; + "rust_1_81" = [ "rust_1_65" ]; "unstable-provider-api" = [ "snafu-derive/unstable-provider-api" ]; }; resolvedDefaultFeatures = [ "default" "rust_1_61" "rust_1_65" "std" ]; @@ -6464,11 +6519,11 @@ rec { features = { }; }; - "snafu-derive 0.8.4" = rec { + "snafu-derive 0.8.5" = rec { crateName = "snafu-derive"; - version = "0.8.4"; + version = "0.8.5"; edition = "2018"; - sha256 = "1r8s45plv1nxy60d9xyvyjxz0692jh6aax1icj064ps0r8py1l9q"; + sha256 = "05zr38bcngn8ha4mfi7lr2pqqfysjhwhxvk9lz57xzkzjavwdhq3"; procMacro = true; libName = "snafu_derive"; authors = [ @@ -6490,7 +6545,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.77"; + packageId = "syn 2.0.79"; features = [ "full" ]; } ]; @@ -6515,7 +6570,7 @@ rec { } { name = "windows-sys"; - packageId = "windows-sys"; + packageId = "windows-sys 0.52.0"; target = { target, features }: (target."windows" or false); features = [ "Win32_Foundation" "Win32_Networking_WinSock" "Win32_System_IO" "Win32_System_Threading" "Win32_System_WindowsProgramming" ]; } @@ -6572,9 +6627,13 @@ rec { name = "serde_json"; packageId = "serde_json"; } + { + name = "shell-escape"; + packageId = "shell-escape"; + } { name = "snafu"; - packageId = "snafu 0.8.4"; + packageId = "snafu 0.8.5"; } { name = "stackable-operator"; @@ -6636,7 +6695,7 @@ rec { } { name = "futures"; - packageId = "futures 0.3.30"; + packageId = "futures 0.3.31"; features = [ "compat" ]; } { @@ -6654,7 +6713,7 @@ rec { } { name = "snafu"; - packageId = "snafu 0.8.4"; + packageId = "snafu 0.8.5"; } { name = "stackable-hbase-crd"; @@ -6745,7 +6804,7 @@ rec { } { name = "futures"; - packageId = "futures 0.3.30"; + packageId = "futures 0.3.31"; } { name = "json-patch"; @@ -6805,7 +6864,7 @@ rec { } { name = "snafu"; - packageId = "snafu 0.8.4"; + packageId = "snafu 0.8.5"; } { name = "stackable-operator-derive"; @@ -6878,7 +6937,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.77"; + packageId = "syn 2.0.79"; } ]; @@ -6951,7 +7010,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.77"; + packageId = "syn 2.0.79"; features = [ "parsing" "extra-traits" ]; } ]; @@ -7004,11 +7063,11 @@ rec { }; resolvedDefaultFeatures = [ "clone-impls" "default" "derive" "extra-traits" "full" "parsing" "printing" "proc-macro" "quote" "visit" ]; }; - "syn 2.0.77" = rec { + "syn 2.0.79" = rec { crateName = "syn"; - version = "2.0.77"; + version = "2.0.79"; edition = "2021"; - sha256 = "1vbkwfp9ymmi0fsyyjsqfvnv7gm8vjgl4pzprbk7p3pxc7gvqdcz"; + sha256 = "147mk4sgigmvsb9l8qzj199ygf0fgb0bphwdsghn8205pz82q4w9"; authors = [ "David Tolnay " ]; @@ -7039,9 +7098,9 @@ rec { }; "thiserror" = rec { crateName = "thiserror"; - version = "1.0.63"; + version = "1.0.64"; edition = "2021"; - sha256 = "092p83mf4p1vkjb2j6h6z96dan4raq2simhirjv12slbndq26d60"; + sha256 = "114s8lmssxl0c2480s671am88vzlasbaikxbvfv8pyqrq6mzh2nm"; authors = [ "David Tolnay " ]; @@ -7055,9 +7114,9 @@ rec { }; "thiserror-impl" = rec { crateName = "thiserror-impl"; - version = "1.0.63"; + version = "1.0.64"; edition = "2021"; - sha256 = "0qd21l2jjrkvnpr5da3l3b58v4wmrkn6aa0h1z5dg6kb8rc8nmd4"; + sha256 = "1hvzmjx9iamln854l74qyhs0jl2pg3hhqzpqm9p8gszmf9v4x408"; procMacro = true; libName = "thiserror_impl"; authors = [ @@ -7074,7 +7133,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.77"; + packageId = "syn 2.0.79"; } ]; @@ -7371,7 +7430,7 @@ rec { } { name = "windows-sys"; - packageId = "windows-sys"; + packageId = "windows-sys 0.52.0"; optional = true; target = { target, features }: (target."windows" or false); } @@ -7389,7 +7448,7 @@ rec { } { name = "windows-sys"; - packageId = "windows-sys"; + packageId = "windows-sys 0.52.0"; target = {target, features}: (target."windows" or false); features = [ "Win32_Foundation" "Win32_Security_Authorization" ]; } @@ -7436,7 +7495,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.77"; + packageId = "syn 2.0.79"; features = [ "full" ]; } ]; @@ -7485,9 +7544,9 @@ rec { }; "tokio-stream" = rec { crateName = "tokio-stream"; - version = "0.1.15"; + version = "0.1.16"; edition = "2021"; - sha256 = "1brpbsqyg8yfmfc4y0j9zxvc8xsxjc31d48kb0g6jvpc1fgchyi6"; + sha256 = "1wc65gprcsyzqlr0k091glswy96kph90i32gffi4ksyh03hnqkjg"; libName = "tokio_stream"; authors = [ "Tokio Contributors " @@ -7529,9 +7588,9 @@ rec { }; "tokio-util" = rec { crateName = "tokio-util"; - version = "0.7.11"; + version = "0.7.12"; edition = "2021"; - sha256 = "1qcz30db6m8lxkl61b3nic4bim1symi636nhbb3rmi3i6xxv9xlw"; + sha256 = "0spc0g4irbnf2flgag22gfii87avqzibwfm0si0d1g0k9ijw7rv1"; libName = "tokio_util"; authors = [ "Tokio Contributors " @@ -7601,9 +7660,9 @@ rec { }; "toml_edit" = rec { crateName = "toml_edit"; - version = "0.21.1"; + version = "0.22.22"; edition = "2021"; - sha256 = "1qch02syrd9c8krcimfl72gyjz11fmjssh03hrg41dbqgzyk91ba"; + sha256 = "1xf7sxfzmnc45f75x302qrn5aph52vc8w226v59yhrm211i8vr2a"; authors = [ "Andronik Ordian " "Ed Page " @@ -7735,7 +7794,7 @@ rec { "tracing" = [ "dep:tracing" ]; "util" = [ "__common" "futures-util" "pin-project" ]; }; - resolvedDefaultFeatures = [ "__common" "buffer" "default" "filter" "futures-core" "futures-util" "log" "make" "pin-project" "pin-project-lite" "tokio" "tokio-util" "tracing" "util" ]; + resolvedDefaultFeatures = [ "__common" "buffer" "default" "filter" "futures-core" "futures-util" "log" "pin-project" "pin-project-lite" "tokio" "tokio-util" "tracing" "util" ]; }; "tower-http" = rec { crateName = "tower-http"; @@ -7970,7 +8029,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.77"; + packageId = "syn 2.0.79"; usesDefaultFeatures = false; features = [ "full" "parsing" "printing" "visit-mut" "clone-impls" "extra-traits" "proc-macro" ]; } @@ -8321,9 +8380,9 @@ rec { }; "ucd-trie" = rec { crateName = "ucd-trie"; - version = "0.1.6"; + version = "0.1.7"; edition = "2021"; - sha256 = "1ff4yfksirqs37ybin9aw71aa5gva00hw7jdxbw8w668zy964r7d"; + sha256 = "0wc9p07sqwz320848i52nvyjvpsxkx3kv5bfbmm6s35809fdk5i8"; libName = "ucd_trie"; authors = [ "Andrew Gallant " @@ -8335,9 +8394,9 @@ rec { }; "unicode-bidi" = rec { crateName = "unicode-bidi"; - version = "0.3.15"; + version = "0.3.17"; edition = "2018"; - sha256 = "0xcdxm7h0ydyprwpcbh436rbs6s6lph7f3gr527lzgv6lw053y88"; + sha256 = "14vqdsnrm3y5anj6h5zz5s32w88crraycblb88d9k23k9ns7vcas"; libName = "unicode_bidi"; authors = [ "The Servo Project Developers" @@ -8348,15 +8407,16 @@ rec { "flame_it" = [ "flame" "flamer" ]; "flamer" = [ "dep:flamer" ]; "serde" = [ "dep:serde" ]; + "smallvec" = [ "dep:smallvec" ]; "with_serde" = [ "serde" ]; }; resolvedDefaultFeatures = [ "hardcoded-data" "std" ]; }; "unicode-ident" = rec { crateName = "unicode-ident"; - version = "1.0.12"; + version = "1.0.13"; edition = "2018"; - sha256 = "0jzf1znfpb2gx8nr8mvmyqs1crnv79l57nxnbiszc7xf7ynbjm1k"; + sha256 = "1zm1xylzsdfvm2a5ib9li3g5pp7qnkv4amhspydvgbmd9k6mc6z9"; libName = "unicode_ident"; authors = [ "David Tolnay " @@ -8365,9 +8425,9 @@ rec { }; "unicode-normalization" = rec { crateName = "unicode-normalization"; - version = "0.1.23"; + version = "0.1.24"; edition = "2018"; - sha256 = "1x81a50h2zxigj74b9bqjsirxxbyhmis54kg600xj213vf31cvd5"; + sha256 = "0mnrk809z3ix1wspcqy97ld5wxdb31f3xz6nsvg5qcv289ycjcsh"; libName = "unicode_normalization"; authors = [ "kwantam " @@ -8387,9 +8447,9 @@ rec { }; "unicode-xid" = rec { crateName = "unicode-xid"; - version = "0.2.5"; + version = "0.2.6"; edition = "2015"; - sha256 = "02n96yhcjwx7vphbwf9p7xfqbwvqgzdw2qz4h0x3wd5wgxj315r2"; + sha256 = "0lzqaky89fq0bcrh6jj6bhlz37scfd8c7dsj5dq7y32if56c1hgb"; libName = "unicode_xid"; authors = [ "erick.tryzelaar " @@ -8543,9 +8603,9 @@ rec { }; "wasm-bindgen" = rec { crateName = "wasm-bindgen"; - version = "0.2.93"; + version = "0.2.95"; edition = "2021"; - sha256 = "1dfr7pka5kwvky2fx82m9d060p842hc5fyyw8igryikcdb0xybm8"; + sha256 = "0bpbvmxhil380gpv53smaypl8wc7sy7rq8apxfw349pn78v1x38j"; libName = "wasm_bindgen"; authors = [ "The wasm-bindgen Developers" @@ -8578,9 +8638,9 @@ rec { }; "wasm-bindgen-backend" = rec { crateName = "wasm-bindgen-backend"; - version = "0.2.93"; + version = "0.2.95"; edition = "2021"; - sha256 = "0yypblaf94rdgqs5xw97499xfwgs1096yx026d6h88v563d9dqwx"; + sha256 = "0n53wgy78bgzgjwk0z69zbspzhv8p2a4zh69s4fzvpqdrb9x8vfb"; libName = "wasm_bindgen_backend"; authors = [ "The wasm-bindgen Developers" @@ -8608,7 +8668,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.77"; + packageId = "syn 2.0.79"; features = [ "full" ]; } { @@ -8623,9 +8683,9 @@ rec { }; "wasm-bindgen-macro" = rec { crateName = "wasm-bindgen-macro"; - version = "0.2.93"; + version = "0.2.95"; edition = "2021"; - sha256 = "1kycd1xfx4d9xzqknvzbiqhwb5fzvjqrrn88x692q1vblj8lqp2q"; + sha256 = "0mic8b2vab1a91m6x3hjxkwz23094bq1cwhnszarsnlggyz894z7"; procMacro = true; libName = "wasm_bindgen_macro"; authors = [ @@ -8649,9 +8709,9 @@ rec { }; "wasm-bindgen-macro-support" = rec { crateName = "wasm-bindgen-macro-support"; - version = "0.2.93"; + version = "0.2.95"; edition = "2021"; - sha256 = "0dp8w6jmw44srym6l752nkr3hkplyw38a2fxz5f3j1ch9p3l1hxg"; + sha256 = "0s7g6glb85lyx2pj83shbmg4d50mvqhb2c2qk2j28yigaxbspii6"; libName = "wasm_bindgen_macro_support"; authors = [ "The wasm-bindgen Developers" @@ -8667,8 +8727,8 @@ rec { } { name = "syn"; - packageId = "syn 2.0.77"; - features = [ "visit" "full" ]; + packageId = "syn 2.0.79"; + features = [ "visit" "visit-mut" "full" ]; } { name = "wasm-bindgen-backend"; @@ -8687,10 +8747,10 @@ rec { }; "wasm-bindgen-shared" = rec { crateName = "wasm-bindgen-shared"; - version = "0.2.93"; + version = "0.2.95"; edition = "2021"; links = "wasm_bindgen"; - sha256 = "1104bny0hv40jfap3hp8jhs0q4ya244qcrvql39i38xlghq0lan6"; + sha256 = "1386q7mvv5ky003hcc6yyxpid3y1m7fy0l920i3z3ab60vqhkz35"; libName = "wasm_bindgen_shared"; authors = [ "The wasm-bindgen Developers" @@ -8786,7 +8846,7 @@ rec { }; resolvedDefaultFeatures = [ "default" ]; }; - "windows-sys" = rec { + "windows-sys 0.52.0" = rec { crateName = "windows-sys"; version = "0.52.0"; edition = "2021"; @@ -9032,7 +9092,266 @@ rec { "Win32_Web" = [ "Win32" ]; "Win32_Web_InternetExplorer" = [ "Win32_Web" ]; }; - resolvedDefaultFeatures = [ "Wdk" "Wdk_Foundation" "Wdk_Storage" "Wdk_Storage_FileSystem" "Wdk_System" "Wdk_System_IO" "Win32" "Win32_Foundation" "Win32_Networking" "Win32_Networking_WinSock" "Win32_Security" "Win32_Security_Authentication" "Win32_Security_Authentication_Identity" "Win32_Security_Credentials" "Win32_Security_Cryptography" "Win32_Storage" "Win32_Storage_FileSystem" "Win32_System" "Win32_System_Com" "Win32_System_Console" "Win32_System_IO" "Win32_System_Memory" "Win32_System_Pipes" "Win32_System_SystemServices" "Win32_System_Threading" "Win32_System_WindowsProgramming" "Win32_UI" "Win32_UI_Shell" "default" ]; + resolvedDefaultFeatures = [ "Wdk" "Wdk_Foundation" "Wdk_Storage" "Wdk_Storage_FileSystem" "Wdk_System" "Wdk_System_IO" "Win32" "Win32_Foundation" "Win32_Networking" "Win32_Networking_WinSock" "Win32_Security" "Win32_Storage" "Win32_Storage_FileSystem" "Win32_System" "Win32_System_Com" "Win32_System_Console" "Win32_System_IO" "Win32_System_Pipes" "Win32_System_SystemServices" "Win32_System_Threading" "Win32_System_WindowsProgramming" "Win32_UI" "Win32_UI_Shell" "default" ]; + }; + "windows-sys 0.59.0" = rec { + crateName = "windows-sys"; + version = "0.59.0"; + edition = "2021"; + sha256 = "0fw5672ziw8b3zpmnbp9pdv1famk74f1l9fcbc3zsrzdg56vqf0y"; + libName = "windows_sys"; + authors = [ + "Microsoft" + ]; + dependencies = [ + { + name = "windows-targets"; + packageId = "windows-targets"; + } + ]; + features = { + "Wdk" = [ "Win32_Foundation" ]; + "Wdk_Devices" = [ "Wdk" ]; + "Wdk_Devices_Bluetooth" = [ "Wdk_Devices" ]; + "Wdk_Devices_HumanInterfaceDevice" = [ "Wdk_Devices" ]; + "Wdk_Foundation" = [ "Wdk" ]; + "Wdk_Graphics" = [ "Wdk" ]; + "Wdk_Graphics_Direct3D" = [ "Wdk_Graphics" ]; + "Wdk_NetworkManagement" = [ "Wdk" ]; + "Wdk_NetworkManagement_Ndis" = [ "Wdk_NetworkManagement" ]; + "Wdk_NetworkManagement_WindowsFilteringPlatform" = [ "Wdk_NetworkManagement" ]; + "Wdk_Storage" = [ "Wdk" ]; + "Wdk_Storage_FileSystem" = [ "Wdk_Storage" ]; + "Wdk_Storage_FileSystem_Minifilters" = [ "Wdk_Storage_FileSystem" ]; + "Wdk_System" = [ "Wdk" ]; + "Wdk_System_IO" = [ "Wdk_System" ]; + "Wdk_System_Memory" = [ "Wdk_System" ]; + "Wdk_System_OfflineRegistry" = [ "Wdk_System" ]; + "Wdk_System_Registry" = [ "Wdk_System" ]; + "Wdk_System_SystemInformation" = [ "Wdk_System" ]; + "Wdk_System_SystemServices" = [ "Wdk_System" ]; + "Wdk_System_Threading" = [ "Wdk_System" ]; + "Win32" = [ "Win32_Foundation" ]; + "Win32_Data" = [ "Win32" ]; + "Win32_Data_HtmlHelp" = [ "Win32_Data" ]; + "Win32_Data_RightsManagement" = [ "Win32_Data" ]; + "Win32_Devices" = [ "Win32" ]; + "Win32_Devices_AllJoyn" = [ "Win32_Devices" ]; + "Win32_Devices_BiometricFramework" = [ "Win32_Devices" ]; + "Win32_Devices_Bluetooth" = [ "Win32_Devices" ]; + "Win32_Devices_Communication" = [ "Win32_Devices" ]; + "Win32_Devices_DeviceAndDriverInstallation" = [ "Win32_Devices" ]; + "Win32_Devices_DeviceQuery" = [ "Win32_Devices" ]; + "Win32_Devices_Display" = [ "Win32_Devices" ]; + "Win32_Devices_Enumeration" = [ "Win32_Devices" ]; + "Win32_Devices_Enumeration_Pnp" = [ "Win32_Devices_Enumeration" ]; + "Win32_Devices_Fax" = [ "Win32_Devices" ]; + "Win32_Devices_HumanInterfaceDevice" = [ "Win32_Devices" ]; + "Win32_Devices_PortableDevices" = [ "Win32_Devices" ]; + "Win32_Devices_Properties" = [ "Win32_Devices" ]; + "Win32_Devices_Pwm" = [ "Win32_Devices" ]; + "Win32_Devices_Sensors" = [ "Win32_Devices" ]; + "Win32_Devices_SerialCommunication" = [ "Win32_Devices" ]; + "Win32_Devices_Tapi" = [ "Win32_Devices" ]; + "Win32_Devices_Usb" = [ "Win32_Devices" ]; + "Win32_Devices_WebServicesOnDevices" = [ "Win32_Devices" ]; + "Win32_Foundation" = [ "Win32" ]; + "Win32_Gaming" = [ "Win32" ]; + "Win32_Globalization" = [ "Win32" ]; + "Win32_Graphics" = [ "Win32" ]; + "Win32_Graphics_Dwm" = [ "Win32_Graphics" ]; + "Win32_Graphics_Gdi" = [ "Win32_Graphics" ]; + "Win32_Graphics_GdiPlus" = [ "Win32_Graphics" ]; + "Win32_Graphics_Hlsl" = [ "Win32_Graphics" ]; + "Win32_Graphics_OpenGL" = [ "Win32_Graphics" ]; + "Win32_Graphics_Printing" = [ "Win32_Graphics" ]; + "Win32_Graphics_Printing_PrintTicket" = [ "Win32_Graphics_Printing" ]; + "Win32_Management" = [ "Win32" ]; + "Win32_Management_MobileDeviceManagementRegistration" = [ "Win32_Management" ]; + "Win32_Media" = [ "Win32" ]; + "Win32_Media_Audio" = [ "Win32_Media" ]; + "Win32_Media_DxMediaObjects" = [ "Win32_Media" ]; + "Win32_Media_KernelStreaming" = [ "Win32_Media" ]; + "Win32_Media_Multimedia" = [ "Win32_Media" ]; + "Win32_Media_Streaming" = [ "Win32_Media" ]; + "Win32_Media_WindowsMediaFormat" = [ "Win32_Media" ]; + "Win32_NetworkManagement" = [ "Win32" ]; + "Win32_NetworkManagement_Dhcp" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_Dns" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_InternetConnectionWizard" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_IpHelper" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_Multicast" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_Ndis" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_NetBios" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_NetManagement" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_NetShell" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_NetworkDiagnosticsFramework" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_P2P" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_QoS" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_Rras" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_Snmp" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_WNet" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_WebDav" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_WiFi" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_WindowsConnectionManager" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_WindowsFilteringPlatform" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_WindowsFirewall" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_WindowsNetworkVirtualization" = [ "Win32_NetworkManagement" ]; + "Win32_Networking" = [ "Win32" ]; + "Win32_Networking_ActiveDirectory" = [ "Win32_Networking" ]; + "Win32_Networking_Clustering" = [ "Win32_Networking" ]; + "Win32_Networking_HttpServer" = [ "Win32_Networking" ]; + "Win32_Networking_Ldap" = [ "Win32_Networking" ]; + "Win32_Networking_WebSocket" = [ "Win32_Networking" ]; + "Win32_Networking_WinHttp" = [ "Win32_Networking" ]; + "Win32_Networking_WinInet" = [ "Win32_Networking" ]; + "Win32_Networking_WinSock" = [ "Win32_Networking" ]; + "Win32_Networking_WindowsWebServices" = [ "Win32_Networking" ]; + "Win32_Security" = [ "Win32" ]; + "Win32_Security_AppLocker" = [ "Win32_Security" ]; + "Win32_Security_Authentication" = [ "Win32_Security" ]; + "Win32_Security_Authentication_Identity" = [ "Win32_Security_Authentication" ]; + "Win32_Security_Authorization" = [ "Win32_Security" ]; + "Win32_Security_Credentials" = [ "Win32_Security" ]; + "Win32_Security_Cryptography" = [ "Win32_Security" ]; + "Win32_Security_Cryptography_Catalog" = [ "Win32_Security_Cryptography" ]; + "Win32_Security_Cryptography_Certificates" = [ "Win32_Security_Cryptography" ]; + "Win32_Security_Cryptography_Sip" = [ "Win32_Security_Cryptography" ]; + "Win32_Security_Cryptography_UI" = [ "Win32_Security_Cryptography" ]; + "Win32_Security_DiagnosticDataQuery" = [ "Win32_Security" ]; + "Win32_Security_DirectoryServices" = [ "Win32_Security" ]; + "Win32_Security_EnterpriseData" = [ "Win32_Security" ]; + "Win32_Security_ExtensibleAuthenticationProtocol" = [ "Win32_Security" ]; + "Win32_Security_Isolation" = [ "Win32_Security" ]; + "Win32_Security_LicenseProtection" = [ "Win32_Security" ]; + "Win32_Security_NetworkAccessProtection" = [ "Win32_Security" ]; + "Win32_Security_WinTrust" = [ "Win32_Security" ]; + "Win32_Security_WinWlx" = [ "Win32_Security" ]; + "Win32_Storage" = [ "Win32" ]; + "Win32_Storage_Cabinets" = [ "Win32_Storage" ]; + "Win32_Storage_CloudFilters" = [ "Win32_Storage" ]; + "Win32_Storage_Compression" = [ "Win32_Storage" ]; + "Win32_Storage_DistributedFileSystem" = [ "Win32_Storage" ]; + "Win32_Storage_FileHistory" = [ "Win32_Storage" ]; + "Win32_Storage_FileSystem" = [ "Win32_Storage" ]; + "Win32_Storage_Imapi" = [ "Win32_Storage" ]; + "Win32_Storage_IndexServer" = [ "Win32_Storage" ]; + "Win32_Storage_InstallableFileSystems" = [ "Win32_Storage" ]; + "Win32_Storage_IscsiDisc" = [ "Win32_Storage" ]; + "Win32_Storage_Jet" = [ "Win32_Storage" ]; + "Win32_Storage_Nvme" = [ "Win32_Storage" ]; + "Win32_Storage_OfflineFiles" = [ "Win32_Storage" ]; + "Win32_Storage_OperationRecorder" = [ "Win32_Storage" ]; + "Win32_Storage_Packaging" = [ "Win32_Storage" ]; + "Win32_Storage_Packaging_Appx" = [ "Win32_Storage_Packaging" ]; + "Win32_Storage_ProjectedFileSystem" = [ "Win32_Storage" ]; + "Win32_Storage_StructuredStorage" = [ "Win32_Storage" ]; + "Win32_Storage_Vhd" = [ "Win32_Storage" ]; + "Win32_Storage_Xps" = [ "Win32_Storage" ]; + "Win32_System" = [ "Win32" ]; + "Win32_System_AddressBook" = [ "Win32_System" ]; + "Win32_System_Antimalware" = [ "Win32_System" ]; + "Win32_System_ApplicationInstallationAndServicing" = [ "Win32_System" ]; + "Win32_System_ApplicationVerifier" = [ "Win32_System" ]; + "Win32_System_ClrHosting" = [ "Win32_System" ]; + "Win32_System_Com" = [ "Win32_System" ]; + "Win32_System_Com_Marshal" = [ "Win32_System_Com" ]; + "Win32_System_Com_StructuredStorage" = [ "Win32_System_Com" ]; + "Win32_System_Com_Urlmon" = [ "Win32_System_Com" ]; + "Win32_System_ComponentServices" = [ "Win32_System" ]; + "Win32_System_Console" = [ "Win32_System" ]; + "Win32_System_CorrelationVector" = [ "Win32_System" ]; + "Win32_System_DataExchange" = [ "Win32_System" ]; + "Win32_System_DeploymentServices" = [ "Win32_System" ]; + "Win32_System_DeveloperLicensing" = [ "Win32_System" ]; + "Win32_System_Diagnostics" = [ "Win32_System" ]; + "Win32_System_Diagnostics_Ceip" = [ "Win32_System_Diagnostics" ]; + "Win32_System_Diagnostics_Debug" = [ "Win32_System_Diagnostics" ]; + "Win32_System_Diagnostics_Debug_Extensions" = [ "Win32_System_Diagnostics_Debug" ]; + "Win32_System_Diagnostics_Etw" = [ "Win32_System_Diagnostics" ]; + "Win32_System_Diagnostics_ProcessSnapshotting" = [ "Win32_System_Diagnostics" ]; + "Win32_System_Diagnostics_ToolHelp" = [ "Win32_System_Diagnostics" ]; + "Win32_System_Diagnostics_TraceLogging" = [ "Win32_System_Diagnostics" ]; + "Win32_System_DistributedTransactionCoordinator" = [ "Win32_System" ]; + "Win32_System_Environment" = [ "Win32_System" ]; + "Win32_System_ErrorReporting" = [ "Win32_System" ]; + "Win32_System_EventCollector" = [ "Win32_System" ]; + "Win32_System_EventLog" = [ "Win32_System" ]; + "Win32_System_EventNotificationService" = [ "Win32_System" ]; + "Win32_System_GroupPolicy" = [ "Win32_System" ]; + "Win32_System_HostCompute" = [ "Win32_System" ]; + "Win32_System_HostComputeNetwork" = [ "Win32_System" ]; + "Win32_System_HostComputeSystem" = [ "Win32_System" ]; + "Win32_System_Hypervisor" = [ "Win32_System" ]; + "Win32_System_IO" = [ "Win32_System" ]; + "Win32_System_Iis" = [ "Win32_System" ]; + "Win32_System_Ioctl" = [ "Win32_System" ]; + "Win32_System_JobObjects" = [ "Win32_System" ]; + "Win32_System_Js" = [ "Win32_System" ]; + "Win32_System_Kernel" = [ "Win32_System" ]; + "Win32_System_LibraryLoader" = [ "Win32_System" ]; + "Win32_System_Mailslots" = [ "Win32_System" ]; + "Win32_System_Mapi" = [ "Win32_System" ]; + "Win32_System_Memory" = [ "Win32_System" ]; + "Win32_System_Memory_NonVolatile" = [ "Win32_System_Memory" ]; + "Win32_System_MessageQueuing" = [ "Win32_System" ]; + "Win32_System_MixedReality" = [ "Win32_System" ]; + "Win32_System_Ole" = [ "Win32_System" ]; + "Win32_System_PasswordManagement" = [ "Win32_System" ]; + "Win32_System_Performance" = [ "Win32_System" ]; + "Win32_System_Performance_HardwareCounterProfiling" = [ "Win32_System_Performance" ]; + "Win32_System_Pipes" = [ "Win32_System" ]; + "Win32_System_Power" = [ "Win32_System" ]; + "Win32_System_ProcessStatus" = [ "Win32_System" ]; + "Win32_System_Recovery" = [ "Win32_System" ]; + "Win32_System_Registry" = [ "Win32_System" ]; + "Win32_System_RemoteDesktop" = [ "Win32_System" ]; + "Win32_System_RemoteManagement" = [ "Win32_System" ]; + "Win32_System_RestartManager" = [ "Win32_System" ]; + "Win32_System_Restore" = [ "Win32_System" ]; + "Win32_System_Rpc" = [ "Win32_System" ]; + "Win32_System_Search" = [ "Win32_System" ]; + "Win32_System_Search_Common" = [ "Win32_System_Search" ]; + "Win32_System_SecurityCenter" = [ "Win32_System" ]; + "Win32_System_Services" = [ "Win32_System" ]; + "Win32_System_SetupAndMigration" = [ "Win32_System" ]; + "Win32_System_Shutdown" = [ "Win32_System" ]; + "Win32_System_StationsAndDesktops" = [ "Win32_System" ]; + "Win32_System_SubsystemForLinux" = [ "Win32_System" ]; + "Win32_System_SystemInformation" = [ "Win32_System" ]; + "Win32_System_SystemServices" = [ "Win32_System" ]; + "Win32_System_Threading" = [ "Win32_System" ]; + "Win32_System_Time" = [ "Win32_System" ]; + "Win32_System_TpmBaseServices" = [ "Win32_System" ]; + "Win32_System_UserAccessLogging" = [ "Win32_System" ]; + "Win32_System_Variant" = [ "Win32_System" ]; + "Win32_System_VirtualDosMachines" = [ "Win32_System" ]; + "Win32_System_WindowsProgramming" = [ "Win32_System" ]; + "Win32_System_Wmi" = [ "Win32_System" ]; + "Win32_UI" = [ "Win32" ]; + "Win32_UI_Accessibility" = [ "Win32_UI" ]; + "Win32_UI_ColorSystem" = [ "Win32_UI" ]; + "Win32_UI_Controls" = [ "Win32_UI" ]; + "Win32_UI_Controls_Dialogs" = [ "Win32_UI_Controls" ]; + "Win32_UI_HiDpi" = [ "Win32_UI" ]; + "Win32_UI_Input" = [ "Win32_UI" ]; + "Win32_UI_Input_Ime" = [ "Win32_UI_Input" ]; + "Win32_UI_Input_KeyboardAndMouse" = [ "Win32_UI_Input" ]; + "Win32_UI_Input_Pointer" = [ "Win32_UI_Input" ]; + "Win32_UI_Input_Touch" = [ "Win32_UI_Input" ]; + "Win32_UI_Input_XboxController" = [ "Win32_UI_Input" ]; + "Win32_UI_InteractionContext" = [ "Win32_UI" ]; + "Win32_UI_Magnification" = [ "Win32_UI" ]; + "Win32_UI_Shell" = [ "Win32_UI" ]; + "Win32_UI_Shell_Common" = [ "Win32_UI_Shell" ]; + "Win32_UI_Shell_PropertiesSystem" = [ "Win32_UI_Shell" ]; + "Win32_UI_TabletPC" = [ "Win32_UI" ]; + "Win32_UI_TextServices" = [ "Win32_UI" ]; + "Win32_UI_WindowsAndMessaging" = [ "Win32_UI" ]; + "Win32_Web" = [ "Win32" ]; + "Win32_Web_InternetExplorer" = [ "Win32_Web" ]; + }; + resolvedDefaultFeatures = [ "Win32" "Win32_Foundation" "Win32_Security" "Win32_Security_Authentication" "Win32_Security_Authentication_Identity" "Win32_Security_Credentials" "Win32_Security_Cryptography" "Win32_System" "Win32_System_LibraryLoader" "Win32_System_Memory" "Win32_System_SystemInformation" "default" ]; }; "windows-targets" = rec { crateName = "windows-targets"; @@ -9169,9 +9488,9 @@ rec { }; "winnow" = rec { crateName = "winnow"; - version = "0.5.40"; + version = "0.6.20"; edition = "2021"; - sha256 = "0xk8maai7gyxda673mmw3pj1hdizy5fpi7287vaywykkk19sk4zm"; + sha256 = "16y4i8z9vh8hazjxg5mvmq0c5i35wlk8rxi5gkq6cn5vlb0zxh9n"; dependencies = [ { name = "memchr"; @@ -9181,7 +9500,7 @@ rec { } ]; features = { - "debug" = [ "dep:anstream" "dep:anstyle" "dep:is-terminal" "dep:terminal_size" ]; + "debug" = [ "std" "dep:anstream" "dep:anstyle" "dep:is-terminal" "dep:terminal_size" ]; "default" = [ "std" ]; "simd" = [ "dep:memchr" ]; "std" = [ "alloc" "memchr?/std" ]; @@ -9191,10 +9510,10 @@ rec { }; "xml-rs" = rec { crateName = "xml-rs"; - version = "0.8.21"; + version = "0.8.22"; edition = "2021"; crateBin = []; - sha256 = "00g63s3kcnj69hsgg96gvbh822qa71vv2sfsqvf37qqdgkp7g6jk"; + sha256 = "09pg779vjh0xp3ph10j4wy1ihz8pzvxm1qf1jqw0jnmsghpjwkmg"; libName = "xml"; authors = [ "Vladimir Matveev " @@ -9264,7 +9583,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.77"; + packageId = "syn 2.0.79"; } ]; diff --git a/rust/crd/src/lib.rs b/rust/crd/src/lib.rs index 1551fef7..50729cff 100644 --- a/rust/crd/src/lib.rs +++ b/rust/crd/src/lib.rs @@ -18,7 +18,11 @@ use stackable_operator::{ fragment::{self, Fragment, ValidationError}, merge::{Atomic, Merge}, }, - k8s_openapi::{api::core::v1::EnvVar, apimachinery::pkg::api::resource::Quantity, DeepMerge}, + k8s_openapi::{ + api::core::v1::{EnvVar, EnvVarSource, ObjectFieldSelector}, + apimachinery::pkg::api::resource::Quantity, + DeepMerge, + }, kube::{runtime::reflector::ObjectRef, CustomResource, ResourceExt}, product_config_utils::Configuration, product_logging::{self, spec::Logging}, @@ -1051,6 +1055,14 @@ impl HbaseCluster { } } + pub fn service_port(&self, role: &HbaseRole) -> u16 { + match role { + HbaseRole::Master => HBASE_MASTER_PORT, + HbaseRole::RegionServer => HBASE_REGIONSERVER_PORT, + _ => HBASE_REST_PORT, + } + } + /// Name of the port used by the Web UI, which depends on HTTPS usage fn ui_port_name(&self) -> String { if self.has_https_enabled() { @@ -1064,20 +1076,36 @@ impl HbaseCluster { pub fn merged_env(rolegroup_config: Option<&BTreeMap>) -> Vec { let merged_env: Vec = if let Some(rolegroup_config) = rolegroup_config { - let env_vars_from_config: BTreeMap = rolegroup_config + let mut env_vars_from_config: Vec = rolegroup_config .iter() - .map(|(env_name, env_value)| { - ( - env_name.clone(), - EnvVar { - name: env_name.clone(), - value: Some(env_value.to_owned()), - value_from: None, - }, - ) + .map(|(env_name, env_value)| EnvVar { + name: env_name.clone(), + value: Some(env_value.to_owned()), + value_from: None, }) .collect(); - env_vars_from_config.into_values().collect() + + // Needed by the hbase-entrypoint.sh script + env_vars_from_config.push(EnvVar { + name: "NAMESPACE".to_string(), + value: None, + value_from: Some(EnvVarSource { + field_ref: Some(ObjectFieldSelector { + field_path: "metadata.namespace".to_string(), + ..Default::default() + }), + ..Default::default() + }), + }); + + // Needed by the hbase-entrypoint.sh script + env_vars_from_config.push(EnvVar { + name: "REGION_MOVER_OPTS".to_string(), + value: None, + value_from: None, + }); + + env_vars_from_config } else { vec![] }; diff --git a/rust/operator-binary/src/hbase_controller.rs b/rust/operator-binary/src/hbase_controller.rs index 7bfdaf4e..9d491d69 100644 --- a/rust/operator-binary/src/hbase_controller.rs +++ b/rust/operator-binary/src/hbase_controller.rs @@ -110,7 +110,7 @@ handle_term_signal() if [ "${term_child_pid}" ]; then if [ -n "$PRE_SHUTDOWN_COMMAND" ]; then echo "Start pre-shutdown command: $PRE_SHUTDOWN_COMMAND" - source "$PRE_SHUTDOWN_COMMAND" + $(${PRE_SHUTDOWN_COMMAND}) echo "Done pre-shutdown command" fi kill -TERM "${term_child_pid}" 2>/dev/null @@ -853,38 +853,12 @@ fn build_rolegroup_statefulset( let mut hbase_container = ContainerBuilder::new("hbase").expect("ContainerBuilder not created"); hbase_container .image_from_product_image(resolved_product_image) - .command(vec![ - "/bin/bash".to_string(), - "-x".to_string(), - "-euo".to_string(), - "pipefail".to_string(), - "-c".to_string(), + .command(vec!["/stackable/hbase/bin/hbase-entrypoint.sh".to_string()]) + .args(vec![ + hbase_role.cli_role_name(), + rolegroup_ref.object_name(), + hbase.service_port(hbase_role).to_string(), ]) - .args(vec![formatdoc! {" - mkdir -p {CONFIG_DIR_NAME} - cp {HDFS_DISCOVERY_TMP_DIR}/hdfs-site.xml {CONFIG_DIR_NAME} - cp {HDFS_DISCOVERY_TMP_DIR}/core-site.xml {CONFIG_DIR_NAME} - cp {HBASE_CONFIG_TMP_DIR}/* {CONFIG_DIR_NAME} - cp {HBASE_LOG_CONFIG_TMP_DIR}/{log4j_properties_file_name} {CONFIG_DIR_NAME} - - {kerberos_container_start_commands} - - PRE_SHUTDOWN_COMMAND={pre_shutdown_command} - {HBASE_BASH_TRAP_FUNCTIONS} - {remove_vector_shutdown_file_command} - prepare_signal_handlers - bin/hbase {hbase_role_name_in_command} start & - wait_for_termination $! - {create_vector_shutdown_file_command} - ", - pre_shutdown_command=config.pre_shutdown_command(), - hbase_role_name_in_command = hbase_role.cli_role_name(), - kerberos_container_start_commands = kerberos_container_start_commands(hbase), - remove_vector_shutdown_file_command = - remove_vector_shutdown_file_command(STACKABLE_LOG_DIR), - create_vector_shutdown_file_command = - create_vector_shutdown_file_command(STACKABLE_LOG_DIR), - }]) .add_env_vars(merged_env) .add_volume_mount("hbase-config", HBASE_CONFIG_TMP_DIR) .add_volume_mount("hdfs-discovery", HDFS_DISCOVERY_TMP_DIR) diff --git a/scripts/run-tests b/scripts/run-tests index c331043b..02642b18 100755 --- a/scripts/run-tests +++ b/scripts/run-tests @@ -95,11 +95,18 @@ def parse_args(argv: list[str]) -> argparse.Namespace: parser.add_argument( "--operator", help="Patch operator version in release.yaml. Format =", - nargs="*", + action="append", type=cli_parse_operator_args, default=[], ) + parser.add_argument( + "--skip-operator", + help="Skip given operator(s) when installing a release.", + action="append", + default=[], + ) + parser.add_argument( "--test", help="Kuttl test to run.", @@ -138,7 +145,7 @@ def cli_parse_operator_args(args: str) -> tuple[str, str]: f"Invalid operator argument: {args}. Must be in format =" ) op, version = args.split("=", maxsplit=1) - return (op, version) + return op, version def cli_log_level(cli_arg: str) -> int: @@ -179,11 +186,13 @@ def have_requirements() -> None: @contextlib.contextmanager def release_file( - operators: list[tuple[str, str]] = [], + operators: list[tuple[str, str]], skip_ops: list[str] ) -> collections.abc.Generator[str, None, None]: - """Patch release.yaml with operator versions if needed. + """Generate a (possibly modified) copy of the release.yaml file. - If no --operator is set, the default release file is used. + Operator versions passed as --operator take precedence over the release.yaml contents. + + Operators passed as --skip-operator are excluded from the resulting release.yaml contents. If an invalid operator name is provided (i.e. one that doesn't exist in the original release file), a TestRunnerException is raised. @@ -194,36 +203,60 @@ def release_file( def _patch(): release_file = os.path.join("tests", "release.yaml") - # Make a copy so we can mutate it without affecting the original - ops_copy = operators.copy() + # A marker to validate that all ops were patched patched_release = [] with open(release_file, "r") as f: + patched_ops = [] patch_version = "" for line in f: if patch_version: line = re.sub(":.+$", f": {patch_version}", line) patch_version = "" else: - for op, version in ops_copy: + for op, version in operators: if op in line: patch_version = version - ops_copy.remove((op, version)) # found an operator to patch + patched_ops.append(op) break - patched_release.append(line) - if ops_copy: - # Some --operator args were not found in the release file. This is - # most likely a typo and CI pipelines should terminate early in such - # cases. + patched_release.append(line.rstrip("\n")) + + # Sanity test that cli didn't contain garbage that is silently discarded + ops_not_patched = set([op for op, _ in operators]) - set(patched_ops) + if ops_not_patched: + logging.error( + f"Patched operators [{', '.join(ops_not_patched)}] not found in {release_file}" + ) + raise TestRunnerException() + + # Filter out skip operators + release_contents = [] + skip = False + valid_skip_ops = [] + for line in patched_release: + if skip: + skip = False + continue + for op in skip_ops: + if op in line: + skip = True + valid_skip_ops.append(op) + break + else: + release_contents.append(line) + # Sanity test that cli didn't contain garbage that is silently discarded + ops_not_skipped = set(skip_ops) - set(valid_skip_ops) + if ops_not_skipped: logging.error( - f"Operators {', '.join([op for op, _ in ops_copy])} not found in {release_file}" + f"Skipped operators [{', '.join(ops_not_skipped)}] not found in {release_file}" ) raise TestRunnerException() + with tempfile.NamedTemporaryFile( mode="w", delete=False, prefix="patched", ) as f: - pcontents = "".join(patched_release) + pcontents = "\n".join(release_contents) logging.debug(f"Writing patched release to {f.name}: {pcontents}\n") f.write(pcontents) return f.name @@ -353,7 +386,7 @@ def main(argv) -> int: logging.basicConfig(encoding="utf-8", level=opts.log_level) have_requirements() gen_tests(opts.test_suite) - with release_file(opts.operator) as f: + with release_file(opts.operator, opts.skip_operator) as f: maybe_install_release(opts.skip_release, f) if opts.skip_tests: logging.info("Skip running tests.") diff --git a/tests/templates/kuttl/shutdown/00-limit-range.yaml b/tests/templates/kuttl/shutdown/00-limit-range.yaml new file mode 100644 index 00000000..7b6cb30e --- /dev/null +++ b/tests/templates/kuttl/shutdown/00-limit-range.yaml @@ -0,0 +1,11 @@ +--- +apiVersion: v1 +kind: LimitRange +metadata: + name: limit-request-ratio +spec: + limits: + - type: "Container" + maxLimitRequestRatio: + cpu: 5 + memory: 1 diff --git a/tests/templates/kuttl/shutdown/00-patch-ns.yaml.j2 b/tests/templates/kuttl/shutdown/00-patch-ns.yaml.j2 new file mode 100644 index 00000000..67185acf --- /dev/null +++ b/tests/templates/kuttl/shutdown/00-patch-ns.yaml.j2 @@ -0,0 +1,9 @@ +{% if test_scenario['values']['openshift'] == 'true' %} +# see https://github.com/stackabletech/issues/issues/566 +--- +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: + - script: kubectl patch namespace $NAMESPACE -p '{"metadata":{"labels":{"pod-security.kubernetes.io/enforce":"privileged"}}}' + timeout: 120 +{% endif %} diff --git a/tests/templates/kuttl/shutdown/01-assert.yaml.j2 b/tests/templates/kuttl/shutdown/01-assert.yaml.j2 new file mode 100644 index 00000000..50b1d4c3 --- /dev/null +++ b/tests/templates/kuttl/shutdown/01-assert.yaml.j2 @@ -0,0 +1,10 @@ +--- +apiVersion: kuttl.dev/v1beta1 +kind: TestAssert +{% if lookup('env', 'VECTOR_AGGREGATOR') %} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: vector-aggregator-discovery +{% endif %} diff --git a/tests/templates/kuttl/shutdown/01-install-vector-aggregator-discovery-configmap.yaml.j2 b/tests/templates/kuttl/shutdown/01-install-vector-aggregator-discovery-configmap.yaml.j2 new file mode 100644 index 00000000..2d6a0df5 --- /dev/null +++ b/tests/templates/kuttl/shutdown/01-install-vector-aggregator-discovery-configmap.yaml.j2 @@ -0,0 +1,9 @@ +{% if lookup('env', 'VECTOR_AGGREGATOR') %} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: vector-aggregator-discovery +data: + ADDRESS: {{ lookup('env', 'VECTOR_AGGREGATOR') }} +{% endif %} diff --git a/tests/templates/kuttl/shutdown/10-assert.yaml b/tests/templates/kuttl/shutdown/10-assert.yaml new file mode 100644 index 00000000..a1e216b4 --- /dev/null +++ b/tests/templates/kuttl/shutdown/10-assert.yaml @@ -0,0 +1,14 @@ +--- +apiVersion: kuttl.dev/v1beta1 +kind: TestAssert +metadata: + name: install-zk +timeout: 600 +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: test-zk-server-default +status: + readyReplicas: 1 + replicas: 1 diff --git a/tests/templates/kuttl/shutdown/10-install-zookeeper.yaml.j2 b/tests/templates/kuttl/shutdown/10-install-zookeeper.yaml.j2 new file mode 100644 index 00000000..f722d7a7 --- /dev/null +++ b/tests/templates/kuttl/shutdown/10-install-zookeeper.yaml.j2 @@ -0,0 +1,29 @@ +--- +apiVersion: zookeeper.stackable.tech/v1alpha1 +kind: ZookeeperCluster +metadata: + name: test-zk +spec: + image: + productVersion: "{{ test_scenario['values']['zookeeper-latest'] }}" + pullPolicy: IfNotPresent + clusterConfig: + listenerClass: "cluster-internal" +{% if lookup('env', 'VECTOR_AGGREGATOR') %} + vectorAggregatorConfigMapName: vector-aggregator-discovery +{% endif %} + servers: + config: + logging: + enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} + roleGroups: + default: + replicas: 1 +--- +apiVersion: zookeeper.stackable.tech/v1alpha1 +kind: ZookeeperZnode +metadata: + name: test-znode +spec: + clusterRef: + name: test-zk diff --git a/tests/templates/kuttl/shutdown/20-assert.yaml b/tests/templates/kuttl/shutdown/20-assert.yaml new file mode 100644 index 00000000..8800b24d --- /dev/null +++ b/tests/templates/kuttl/shutdown/20-assert.yaml @@ -0,0 +1,30 @@ +--- +apiVersion: kuttl.dev/v1beta1 +kind: TestAssert +metadata: + name: install-hdfs +timeout: 600 +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: test-hdfs-namenode-default +status: + readyReplicas: 2 + replicas: 2 +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: test-hdfs-journalnode-default +status: + readyReplicas: 1 + replicas: 1 +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: test-hdfs-datanode-default +status: + readyReplicas: 1 + replicas: 1 diff --git a/tests/templates/kuttl/shutdown/20-install-hdfs.yaml.j2 b/tests/templates/kuttl/shutdown/20-install-hdfs.yaml.j2 new file mode 100644 index 00000000..75c3f1ec --- /dev/null +++ b/tests/templates/kuttl/shutdown/20-install-hdfs.yaml.j2 @@ -0,0 +1,37 @@ +--- +apiVersion: hdfs.stackable.tech/v1alpha1 +kind: HdfsCluster +metadata: + name: test-hdfs +spec: + image: + productVersion: "{{ test_scenario['values']['hdfs-latest'] }}" + pullPolicy: IfNotPresent + clusterConfig: + zookeeperConfigMapName: test-znode +{% if lookup('env', 'VECTOR_AGGREGATOR') %} + vectorAggregatorConfigMapName: vector-aggregator-discovery +{% endif %} + nameNodes: + config: + listenerClass: "cluster-internal" + logging: + enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} + roleGroups: + default: + replicas: 2 + dataNodes: + config: + listenerClass: "cluster-internal" + logging: + enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} + roleGroups: + default: + replicas: 1 + journalNodes: + config: + logging: + enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} + roleGroups: + default: + replicas: 1 diff --git a/tests/templates/kuttl/shutdown/30-assert.yaml b/tests/templates/kuttl/shutdown/30-assert.yaml new file mode 100644 index 00000000..cae4a019 --- /dev/null +++ b/tests/templates/kuttl/shutdown/30-assert.yaml @@ -0,0 +1,69 @@ +--- +apiVersion: kuttl.dev/v1beta1 +kind: TestAssert +metadata: + name: install-hbase +timeout: 600 +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: test-hbase-master-default +spec: + template: + spec: + terminationGracePeriodSeconds: 1200 +status: + readyReplicas: 2 + replicas: 2 +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: test-hbase-regionserver-default +spec: + template: + spec: + terminationGracePeriodSeconds: 3600 +status: + readyReplicas: 2 + replicas: 2 +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: test-hbase-restserver-default +spec: + template: + spec: + terminationGracePeriodSeconds: 300 +status: + readyReplicas: 2 + replicas: 2 +--- +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: test-hbase-master +status: + expectedPods: 2 + currentHealthy: 2 + disruptionsAllowed: 1 +--- +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: test-hbase-regionserver +status: + expectedPods: 2 + currentHealthy: 2 + disruptionsAllowed: 1 +--- +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: test-hbase-restserver +status: + expectedPods: 2 + currentHealthy: 2 + disruptionsAllowed: 1 diff --git a/tests/templates/kuttl/shutdown/30-install-hbase.yaml.j2 b/tests/templates/kuttl/shutdown/30-install-hbase.yaml.j2 new file mode 100644 index 00000000..6b80fd09 --- /dev/null +++ b/tests/templates/kuttl/shutdown/30-install-hbase.yaml.j2 @@ -0,0 +1,58 @@ +--- +apiVersion: hbase.stackable.tech/v1alpha1 +kind: HbaseCluster +metadata: + name: test-hbase +spec: + image: +{% if test_scenario['values']['hbase'].find(",") > 0 %} + custom: "{{ test_scenario['values']['hbase'].split(',')[1] }}" + productVersion: "{{ test_scenario['values']['hbase'].split(',')[0] }}" +{% else %} + productVersion: "{{ test_scenario['values']['hbase'] }}" +{% endif %} + pullPolicy: IfNotPresent + clusterConfig: + hdfsConfigMapName: test-hdfs + zookeeperConfigMapName: test-znode + listenerClass: "cluster-internal" +{% if lookup('env', 'VECTOR_AGGREGATOR') %} + vectorAggregatorConfigMapName: vector-aggregator-discovery +{% endif %} + masters: + config: + logging: + enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} + roleGroups: + default: + configOverrides: + hbase-site.xml: + phoenix.log.saltBuckets: "2" + hbase.regionserver.wal.codec: "org.apache.hadoop.hbase.regionserver.wal.IndexedWALEditCodec" + replicas: 2 + regionServers: + config: + logging: + enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} + regionMover: + runBeforeShutdown: true + ack: true + maxThreads: 1 + roleGroups: + default: + configOverrides: + hbase-site.xml: + phoenix.log.saltBuckets: "2" + hbase.regionserver.wal.codec: "org.apache.hadoop.hbase.regionserver.wal.IndexedWALEditCodec" + replicas: 2 + restServers: + config: + logging: + enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} + roleGroups: + default: + configOverrides: + hbase-site.xml: + phoenix.log.saltBuckets: "2" + hbase.regionserver.wal.codec: "org.apache.hadoop.hbase.regionserver.wal.IndexedWALEditCodec" + replicas: 2 diff --git a/tests/templates/kuttl/shutdown/40-assert.yaml b/tests/templates/kuttl/shutdown/40-assert.yaml new file mode 100644 index 00000000..7a457955 --- /dev/null +++ b/tests/templates/kuttl/shutdown/40-assert.yaml @@ -0,0 +1,14 @@ +--- +apiVersion: kuttl.dev/v1beta1 +kind: TestAssert +metadata: + name: hbase-test-runner +timeout: 300 +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: hbase-test-runner +status: + readyReplicas: 1 + replicas: 1 diff --git a/tests/templates/kuttl/shutdown/40-install-hbase-test-runner.yaml b/tests/templates/kuttl/shutdown/40-install-hbase-test-runner.yaml new file mode 100644 index 00000000..35303aa6 --- /dev/null +++ b/tests/templates/kuttl/shutdown/40-install-hbase-test-runner.yaml @@ -0,0 +1,29 @@ +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: hbase-test-runner + labels: + app: hbase-test-runner +spec: + replicas: 1 + selector: + matchLabels: + app: hbase-test-runner + template: + metadata: + labels: + app: hbase-test-runner + spec: + containers: + - name: hbase-test-runner + image: docker.stackable.tech/stackable/testing-tools:0.2.0-stackable0.0.0-dev + stdin: true + tty: true + resources: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "128Mi" + cpu: "500m" diff --git a/tests/templates/kuttl/shutdown/50-assert.yaml b/tests/templates/kuttl/shutdown/50-assert.yaml new file mode 100644 index 00000000..b7f37813 --- /dev/null +++ b/tests/templates/kuttl/shutdown/50-assert.yaml @@ -0,0 +1,8 @@ +--- +apiVersion: kuttl.dev/v1beta1 +kind: TestAssert +metadata: + name: test-hbase +commands: + - script: kubectl exec --namespace=$NAMESPACE hbase-test-runner-0 -- python /tmp/test-hbase.py http://test-hbase-restserver-default:8080 +timeout: 240 diff --git a/tests/templates/kuttl/shutdown/50-test-hbase.yaml b/tests/templates/kuttl/shutdown/50-test-hbase.yaml new file mode 100644 index 00000000..6863fc61 --- /dev/null +++ b/tests/templates/kuttl/shutdown/50-test-hbase.yaml @@ -0,0 +1,5 @@ +--- +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: + - script: kubectl cp --namespace=$NAMESPACE ./test-hbase.py hbase-test-runner-0:/tmp diff --git a/tests/templates/kuttl/shutdown/test-hbase.py b/tests/templates/kuttl/shutdown/test-hbase.py new file mode 100644 index 00000000..ca170169 --- /dev/null +++ b/tests/templates/kuttl/shutdown/test-hbase.py @@ -0,0 +1,135 @@ +import base64 +import http +import requests +import xml.etree.ElementTree as ET +import sys + + +class HbaseClient: + def __init__(self): + self.session = requests.Session() + self.session.headers.update( + { + "Accept": "text/xml", + "Content-Type": "text/xml", + } + ) + http.client.HTTPConnection.debuglevel = 1 + + @staticmethod + def encode_value(plain_string): + return base64.b64encode(plain_string.encode("utf-8")).decode("ascii") + + @staticmethod + def decode_value(base64_string): + return base64.b64decode(base64_string).decode("utf-8") + + def create_table(self, rest_url, name, column_family, compression): + response = self.session.put( + f"{rest_url}/{name}/schema", + data=f""" + + + + """, + ) + assert response.status_code == 201 + table_schema_location = response.headers["location"] + table_location = table_schema_location.removesuffix("/schema") + return (table_location, table_schema_location) + + def delete_table(self, table_schema_location): + response = self.session.delete(table_schema_location) + assert response.status_code == 200 + + def put_row(self, table_location, row_key, column_family, column, cell_value): + cell_column = f"{column_family}:{column}" + response = self.session.put( + f"{table_location}/{row_key}", + data=f""" + + + + {self.encode_value(cell_value)} + + + + """, + ) + assert response.status_code == 200 + + def put_scanner(self, table_location): + response = self.session.put( + f"{table_location}/scanner", data='' + ) + assert response.status_code == 201 + return response.headers["location"] + + def get_scanner(self, scanner_location): + response = self.session.get(scanner_location) + assert response.status_code == 200 + return response.text + + def delete_scanner(self, scanner_location): + response = self.session.delete(scanner_location) + assert response.status_code == 200 + + +hbase_rest_url = sys.argv[1] + +hbase = HbaseClient() + +# supported compression algorithms: SNAPPY, GZ +compression_opts = ["NONE", "SNAPPY", "GZ"] + +for compression in compression_opts: + print(f""" + Create a table with compression={compression} + ==============""") + column_family = "cf" + (table_location, table_schema_location) = hbase.create_table( + rest_url=hbase_rest_url, + name="companies", + column_family=column_family, + compression=compression, + ) + + print(""" + Write a row to the table + ========================""") + cell_value = "Stackable GmbH" + hbase.put_row( + table_location=table_location, + row_key="stackable", + column_family=column_family, + column="name", + cell_value=cell_value, + ) + + print(""" + Get a scanner object + ====================""") + scanner_location = hbase.put_scanner(table_location) + + print(""" + Get the next batch from the scanner + ===================================""") + scan = hbase.get_scanner(scanner_location) + + print(""" + Verify table content + ====================""") + parser = ET.fromstring(scan) + actual_cell_value = hbase.decode_value(parser.findtext("./Row/Cell")) + print(f'assert "{actual_cell_value}" == "{cell_value}"') + assert actual_cell_value == cell_value + + print(""" + Delete the scanner + ==================""") + hbase.delete_scanner(scanner_location) + + print(""" + Delete the table + ================""") + hbase.delete_table(table_schema_location) diff --git a/tests/test-definition.yaml b/tests/test-definition.yaml index f6c8053d..14376f53 100644 --- a/tests/test-definition.yaml +++ b/tests/test-definition.yaml @@ -2,10 +2,10 @@ dimensions: - name: hbase values: - - 2.6.0 - - 2.4.18 + #- 2.6.0 + #- 2.4.18 # To use a custom image, add a comma and the full name after the product version - # - 2.6.0,docker.stackable.tech/sandbox/hbase:2.6.0-stackable0.0.0-dev + - 2.6.0,razvan:hbase-2.6.0 # - 2.4.18,docker.stackable.tech/sandbox/hbase:2.4.18-stackable0.0.0-dev - name: hbase-opa values: @@ -130,6 +130,12 @@ tests: - zookeeper-latest - omid - openshift + - name: shutdown + dimensions: + - hbase + - hdfs-latest + - zookeeper-latest + - openshift suites: - name: nightly patch: From 3c63da168f6ba7a98be0ab27e983f0750fb4e665 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Thu, 17 Oct 2024 12:27:46 +0200 Subject: [PATCH 11/51] cleanup and set region mover opts env var --- Cargo.lock | 30 ++--- rust/crd/src/lib.rs | 134 +++---------------- rust/operator-binary/Cargo.toml | 2 +- rust/operator-binary/src/hbase_controller.rs | 69 +++------- rust/operator-binary/src/kerberos.rs | 11 -- 5 files changed, 52 insertions(+), 194 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7f8dc08b..0e50947e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -868,9 +868,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" dependencies = [ "bytes", "futures-channel", @@ -1237,9 +1237,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.159" +version = "0.2.160" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +checksum = "f0b21006cd1874ae9e650973c565615676dc4a274c965bb0a73796dac838ce4f" [[package]] name = "libgit2-sys" @@ -1429,7 +1429,7 @@ dependencies = [ "lazy_static", "once_cell", "opentelemetry", - "ordered-float 4.3.0", + "ordered-float 4.4.0", "percent-encoding", "rand", "thiserror", @@ -1448,9 +1448,9 @@ dependencies = [ [[package]] name = "ordered-float" -version = "4.3.0" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d501f1a72f71d3c063a6bbc8f7271fa73aa09fe5d6283b6571e2ed176a2537" +checksum = "83e7ccb95e240b7c9506a3d544f10d935e142cc90b0a1d56954fb44d89ad6b97" dependencies = [ "num-traits", ] @@ -1615,9 +1615,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.87" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" +checksum = "7c3a7fc5db1e57d5a779a352c8cdb57b29aa4c40cc69c3a68a7fedc815fbf2f9" dependencies = [ "unicode-ident", ] @@ -1798,9 +1798,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.14" +version = "0.23.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" +checksum = "5fbb44d7acc4e873d613422379f69f237a1b141928c02f6bc6ccfddddc2d7993" dependencies = [ "log", "once_cell", @@ -1848,9 +1848,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55" +checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" [[package]] name = "rustls-webpki" @@ -1865,9 +1865,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" [[package]] name = "ryu" diff --git a/rust/crd/src/lib.rs b/rust/crd/src/lib.rs index 50729cff..4cdaebe4 100644 --- a/rust/crd/src/lib.rs +++ b/rust/crd/src/lib.rs @@ -18,11 +18,7 @@ use stackable_operator::{ fragment::{self, Fragment, ValidationError}, merge::{Atomic, Merge}, }, - k8s_openapi::{ - api::core::v1::{EnvVar, EnvVarSource, ObjectFieldSelector}, - apimachinery::pkg::api::resource::Quantity, - DeepMerge, - }, + k8s_openapi::{api::core::v1::EnvVar, apimachinery::pkg::api::resource::Quantity, DeepMerge}, kube::{runtime::reflector::ObjectRef, CustomResource, ResourceExt}, product_config_utils::Configuration, product_logging::{self, spec::Logging}, @@ -1076,36 +1072,14 @@ impl HbaseCluster { pub fn merged_env(rolegroup_config: Option<&BTreeMap>) -> Vec { let merged_env: Vec = if let Some(rolegroup_config) = rolegroup_config { - let mut env_vars_from_config: Vec = rolegroup_config + rolegroup_config .iter() .map(|(env_name, env_value)| EnvVar { name: env_name.clone(), value: Some(env_value.to_owned()), value_from: None, }) - .collect(); - - // Needed by the hbase-entrypoint.sh script - env_vars_from_config.push(EnvVar { - name: "NAMESPACE".to_string(), - value: None, - value_from: Some(EnvVarSource { - field_ref: Some(ObjectFieldSelector { - field_path: "metadata.namespace".to_string(), - ..Default::default() - }), - ..Default::default() - }), - }); - - // Needed by the hbase-entrypoint.sh script - env_vars_from_config.push(EnvVar { - name: "REGION_MOVER_OPTS".to_string(), - value: None, - value_from: None, - }); - - env_vars_from_config + .collect() } else { vec![] }; @@ -1155,12 +1129,14 @@ impl AnyServiceConfig { } } - /// This function is called for all HBase roles but it currently only returns something for the - /// region server roles. - /// For all other roles it currently returns an empty string meaning there is no command to run - /// before shutdown. - /// This might change in the future. - pub fn pre_shutdown_command(&self) -> String { + /// Returns command line arguments to pass on to the region mover tool. + /// The follwing arguments are excluded because they are already part of the + /// hbase-entrypoint.sh script. + /// The most important argument, '--regionserverhost' can only be computed on the Pod + /// because it contains the pod's hostname. + /// + /// Returns an empty string if the region mover is disabled or any other role is "self". + pub fn region_mover_args(&self) -> String { match self { AnyServiceConfig::RegionServer(config) => { if config.region_mover.run_before_shutdown { @@ -1175,12 +1151,6 @@ impl AnyServiceConfig { }) .unwrap_or(DEFAULT_REGION_MOVER_TIMEOUT.as_secs()); let mut command = vec![ - "bin/hbase".to_string(), - "org.apache.hadoop.hbase.util.RegionMover".to_string(), - "--regionserverhost".to_string(), - "localhost".to_string(), - "--operation".to_string(), - "unload".to_string(), "--maxthreads".to_string(), config.region_mover.max_threads.to_string(), "--timeout".to_string(), @@ -1189,7 +1159,7 @@ impl AnyServiceConfig { if !config.region_mover.ack { command.push("--noack".to_string()); } - // + command.extend( config .region_mover @@ -1197,13 +1167,12 @@ impl AnyServiceConfig { .iter() .map(|s| escape(std::borrow::Cow::Borrowed(s)).to_string()), ); - let command = command.join(" "); - format!("\"{command}\"") + command.join(" ") } else { - "\"\"".to_string() + "".to_string() } } - _ => "\"\"".to_string(), + _ => "".to_string(), } } } @@ -1217,10 +1186,7 @@ mod tests { transform_all_roles_to_config, validate_all_roles_and_groups_config, }; - use crate::{ - merged_env, AnyServiceConfig, HbaseCluster, HbaseConfig, HbaseRole, RegionMover, - RegionServerConfig, - }; + use crate::{merged_env, HbaseCluster, HbaseRole}; use product_config::{types::PropertyNameKind, ProductConfigManager}; @@ -1315,72 +1281,4 @@ spec: env_map.get("TEST_VAR_FROM_MRG") ); } - - #[test] - fn test_pre_shutdown_command_master() { - let config = AnyServiceConfig::Master(HbaseConfig::default()); - assert_eq!(config.pre_shutdown_command(), "\"\""); - } - - #[test] - fn test_pre_shutdown_command_region_server_disabled() { - let config = AnyServiceConfig::RegionServer(RegionServerConfig::default()); - assert_eq!(config.pre_shutdown_command(), "\"\""); - } - - #[test] - fn test_pre_shutdown_command_region_server_enabled_1() { - let config = AnyServiceConfig::RegionServer(RegionServerConfig { - region_mover: RegionMover { - run_before_shutdown: true, - max_threads: 1, - ack: true, - extra_opts: vec![], - }, - ..RegionServerConfig::default() - }); - assert_eq!(config.pre_shutdown_command(), "\"bin/hbase org.apache.hadoop.hbase.util.RegionMover --regionserverhost localhost --operation unload --maxthreads 1 --timeout 3540\""); - } - - #[test] - fn test_pre_shutdown_command_region_server_enabled_2() { - let config = AnyServiceConfig::RegionServer(RegionServerConfig { - region_mover: RegionMover { - run_before_shutdown: true, - max_threads: 5, - ack: false, - extra_opts: vec![], - }, - ..RegionServerConfig::default() - }); - assert_eq!(config.pre_shutdown_command(), "\"bin/hbase org.apache.hadoop.hbase.util.RegionMover --regionserverhost localhost --operation unload --maxthreads 5 --timeout 3540 --noack\""); - } - - #[test] - fn test_pre_shutdown_command_region_server_enabled_3() { - let config = AnyServiceConfig::RegionServer(RegionServerConfig { - region_mover: RegionMover { - run_before_shutdown: true, - max_threads: 5, - ack: false, - extra_opts: vec!["-x".to_string(), "/blubb".to_string()], - }, - ..RegionServerConfig::default() - }); - assert_eq!(config.pre_shutdown_command(), "\"bin/hbase org.apache.hadoop.hbase.util.RegionMover --regionserverhost localhost --operation unload --maxthreads 5 --timeout 3540 --noack -x /blubb\""); - } - - #[test] - fn test_pre_shutdown_command_region_server_enabled_4() { - let config = AnyServiceConfig::RegionServer(RegionServerConfig { - region_mover: RegionMover { - run_before_shutdown: true, - max_threads: 1, - ack: true, - extra_opts: vec!["&&".to_string(), "sudo gotcha!".to_string()], - }, - ..RegionServerConfig::default() - }); - assert_eq!(config.pre_shutdown_command(), "\"bin/hbase org.apache.hadoop.hbase.util.RegionMover --regionserverhost localhost --operation unload --maxthreads 1 --timeout 3540 '&&' 'sudo gotcha'\\!''\""); - } } diff --git a/rust/operator-binary/Cargo.toml b/rust/operator-binary/Cargo.toml index 74f9b29d..b4822d0f 100644 --- a/rust/operator-binary/Cargo.toml +++ b/rust/operator-binary/Cargo.toml @@ -15,7 +15,6 @@ anyhow.workspace = true clap.workspace = true fnv.workspace = true futures.workspace = true -indoc.workspace = true product-config.workspace = true serde.workspace = true snafu.workspace = true @@ -30,3 +29,4 @@ built.workspace = true [dev-dependencies] rstest.workspace = true serde_yaml.workspace = true +indoc.workspace = true diff --git a/rust/operator-binary/src/hbase_controller.rs b/rust/operator-binary/src/hbase_controller.rs index 9d491d69..e08a3d1c 100644 --- a/rust/operator-binary/src/hbase_controller.rs +++ b/rust/operator-binary/src/hbase_controller.rs @@ -1,5 +1,4 @@ //! Ensures that `Pod`s are configured and running for each [`HbaseCluster`] -use indoc::formatdoc; use product_config::{ types::PropertyNameKind, writer::{to_hadoop_xml, to_java_properties_string, PropertiesWriterError}, @@ -24,8 +23,8 @@ use stackable_operator::{ api::{ apps::v1::{StatefulSet, StatefulSetSpec}, core::v1::{ - ConfigMap, ConfigMapVolumeSource, ContainerPort, Probe, Service, ServicePort, - ServiceSpec, TCPSocketAction, Volume, + ConfigMap, ConfigMapVolumeSource, ContainerPort, EnvVar, Probe, Service, + ServicePort, ServiceSpec, TCPSocketAction, Volume, }, }, apimachinery::pkg::{apis::meta::v1::LabelSelector, util::intstr::IntOrString}, @@ -37,7 +36,6 @@ use stackable_operator::{ product_config_utils::{transform_all_roles_to_config, validate_all_roles_and_groups_config}, product_logging::{ self, - framework::{create_vector_shutdown_file_command, remove_vector_shutdown_file_command}, spec::{ ConfigMapLogConfig, ContainerLogConfig, ContainerLogConfigChoice, CustomContainerLogConfig, @@ -71,14 +69,11 @@ use crate::security::opa::HbaseOpaConfig; use crate::{ discovery::build_discovery_configmap, kerberos::{ - self, add_kerberos_pod_config, kerberos_config_properties, - kerberos_container_start_commands, kerberos_ssl_client_settings, + self, add_kerberos_pod_config, kerberos_config_properties, kerberos_ssl_client_settings, kerberos_ssl_server_settings, }, operations::{graceful_shutdown::add_graceful_shutdown_config, pdb::add_pdbs}, - product_logging::{ - extend_role_group_config_map, log4j_properties_file_name, resolve_vector_aggregator_address, - }, + product_logging::{extend_role_group_config_map, resolve_vector_aggregator_address}, security, zookeeper::{self, ZookeeperConnectionInformation}, OPERATOR_NAME, @@ -97,42 +92,6 @@ const HBASE_LOG_CONFIG_TMP_DIR: &str = "/stackable/tmp/log_config"; const DOCKER_IMAGE_BASE_NAME: &str = "hbase"; const HBASE_UID: i64 = 1000; -pub const HBASE_BASH_TRAP_FUNCTIONS: &str = r#" -prepare_signal_handlers() -{ - unset term_child_pid - unset term_kill_needed - trap handle_term_signal TERM -} - -handle_term_signal() -{ - if [ "${term_child_pid}" ]; then - if [ -n "$PRE_SHUTDOWN_COMMAND" ]; then - echo "Start pre-shutdown command: $PRE_SHUTDOWN_COMMAND" - $(${PRE_SHUTDOWN_COMMAND}) - echo "Done pre-shutdown command" - fi - kill -TERM "${term_child_pid}" 2>/dev/null - else - term_kill_needed='yes' - fi -} - -wait_for_termination() -{ - set +e - term_child_pid=$1 - if [[ -v term_kill_needed ]]; then - kill -TERM "${term_child_pid}" 2>/dev/null - fi - wait ${term_child_pid} 2>/dev/null - trap - TERM - wait ${term_child_pid} 2>/dev/null - set -e -} -"#; - pub struct Ctx { pub client: stackable_operator::client::Client, pub product_config: ProductConfigManager, @@ -846,17 +805,29 @@ fn build_rolegroup_statefulset( ..probe_template }; - let merged_env = merged_env(rolegroup_config.get(&PropertyNameKind::Env)); + let mut merged_env = merged_env(rolegroup_config.get(&PropertyNameKind::Env)); + // This env var is set for all roles to avoid bash's "unbound variable" errors + merged_env.push(EnvVar { + name: "REGION_MOVER_OPTS".to_string(), + value: Some(config.region_mover_args()), + ..EnvVar::default() + }); - let log4j_properties_file_name = - log4j_properties_file_name(&resolved_product_image.product_version); let mut hbase_container = ContainerBuilder::new("hbase").expect("ContainerBuilder not created"); hbase_container .image_from_product_image(resolved_product_image) .command(vec!["/stackable/hbase/bin/hbase-entrypoint.sh".to_string()]) .args(vec![ hbase_role.cli_role_name(), - rolegroup_ref.object_name(), + format!( + "{}.{}.svc.cluster.local", + rolegroup_ref.object_name(), + hbase + .metadata + .namespace + .clone() + .context(ObjectHasNoNamespaceSnafu)? + ), hbase.service_port(hbase_role).to_string(), ]) .add_env_vars(merged_env) diff --git a/rust/operator-binary/src/kerberos.rs b/rust/operator-binary/src/kerberos.rs index 16bfdcc6..4e4b8550 100644 --- a/rust/operator-binary/src/kerberos.rs +++ b/rust/operator-binary/src/kerberos.rs @@ -1,6 +1,5 @@ use std::collections::BTreeMap; -use indoc::formatdoc; use snafu::{OptionExt, ResultExt, Snafu}; use stackable_hbase_crd::{HbaseCluster, TLS_STORE_DIR, TLS_STORE_PASSWORD, TLS_STORE_VOLUME_NAME}; use stackable_operator::{ @@ -259,16 +258,6 @@ pub fn add_kerberos_pod_config( Ok(()) } -pub fn kerberos_container_start_commands(hbase: &HbaseCluster) -> String { - if !hbase.has_kerberos_enabled() { - return String::new(); - } - - formatdoc! {" - export KERBEROS_REALM=$(grep -oP 'default_realm = \\K.*' /stackable/kerberos/krb5.conf)" - } -} - fn principal_host_part(hbase: &HbaseCluster) -> Result { let hbase_name = hbase.name_any(); let hbase_namespace = hbase.namespace().context(ObjectMissingNamespaceSnafu { From 8dbde9b2c2ee57c26653781bf677a8d032921a7e Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Thu, 17 Oct 2024 15:30:10 +0200 Subject: [PATCH 12/51] first successful integration test --- Cargo.nix | 29 ++-- tests/templates/kuttl/shutdown/40-assert.yaml | 14 -- .../40-install-hbase-test-runner.yaml | 29 ---- tests/templates/kuttl/shutdown/50-assert.yaml | 5 +- .../kuttl/shutdown/50-test-hbase.yaml | 3 +- .../templates/kuttl/shutdown/count_regions.sh | 11 ++ .../kuttl/shutdown/create_regions.sh | 15 ++ tests/templates/kuttl/shutdown/test-hbase.py | 135 ------------------ 8 files changed, 47 insertions(+), 194 deletions(-) delete mode 100644 tests/templates/kuttl/shutdown/40-assert.yaml delete mode 100644 tests/templates/kuttl/shutdown/40-install-hbase-test-runner.yaml create mode 100755 tests/templates/kuttl/shutdown/count_regions.sh create mode 100755 tests/templates/kuttl/shutdown/create_regions.sh delete mode 100644 tests/templates/kuttl/shutdown/test-hbase.py diff --git a/Cargo.nix b/Cargo.nix index 697333bd..e5309d34 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -3855,9 +3855,9 @@ rec { }; "libc" = rec { crateName = "libc"; - version = "0.2.159"; + version = "0.2.160"; edition = "2015"; - sha256 = "1i9xpia0hn1y8dws7all8rqng6h3lc8ymlgslnljcvm376jrf7an"; + sha256 = "0kyf734dm5iplyq5p5jc4x5dqxjnc5jwawq9cngawx0qrl311cph"; authors = [ "The Rust Project Developers" ]; @@ -4459,7 +4459,7 @@ rec { } { name = "ordered-float"; - packageId = "ordered-float 4.3.0"; + packageId = "ordered-float 4.4.0"; } { name = "percent-encoding"; @@ -4547,11 +4547,11 @@ rec { }; resolvedDefaultFeatures = [ "default" "std" ]; }; - "ordered-float 4.3.0" = rec { + "ordered-float 4.4.0" = rec { crateName = "ordered-float"; - version = "4.3.0"; + version = "4.4.0"; edition = "2021"; - sha256 = "0dr5d8byvqkiclxjimp5kyh3m9qz4zvwifx6cg0d6w9glzqh3ma4"; + sha256 = "15vbmn4lvd2gjmb1s2hbr4n18plk1pql9md30sapq2r4bswwrrw3"; libName = "ordered_float"; authors = [ "Jonathan Reem " @@ -4569,6 +4569,7 @@ rec { "borsh" = [ "dep:borsh" ]; "bytemuck" = [ "dep:bytemuck" ]; "default" = [ "std" ]; + "derive-visitor" = [ "dep:derive-visitor" ]; "num-cmp" = [ "dep:num-cmp" ]; "proptest" = [ "dep:proptest" ]; "rand" = [ "dep:rand" ]; @@ -4974,9 +4975,9 @@ rec { }; "proc-macro2" = rec { crateName = "proc-macro2"; - version = "1.0.87"; + version = "1.0.88"; edition = "2021"; - sha256 = "16mifsq1nqzk81qm82aszib44jsd23gpqic5z4kbmzpnvjhdmr5k"; + sha256 = "1ygjzcawivbziakc6sfc816alabvnp6whlm3g6kxamqyvg2pyfkw"; libName = "proc_macro2"; authors = [ "David Tolnay " @@ -5573,9 +5574,9 @@ rec { }; "rustls" = rec { crateName = "rustls"; - version = "0.23.14"; + version = "0.23.15"; edition = "2021"; - sha256 = "1a0b2sdvq69vqrz08wvjmlqafzh7pfgzhn9j0n107f9wd529jpa1"; + sha256 = "14vr5pfdvzfcqrmjzh1834a1nyi3kzv7j8s22gb77s64mkbl9fsz"; dependencies = [ { name = "log"; @@ -6698,10 +6699,6 @@ rec { packageId = "futures 0.3.31"; features = [ "compat" ]; } - { - name = "indoc"; - packageId = "indoc"; - } { name = "product-config"; packageId = "product-config"; @@ -6746,6 +6743,10 @@ rec { } ]; devDependencies = [ + { + name = "indoc"; + packageId = "indoc"; + } { name = "rstest"; packageId = "rstest"; diff --git a/tests/templates/kuttl/shutdown/40-assert.yaml b/tests/templates/kuttl/shutdown/40-assert.yaml deleted file mode 100644 index 7a457955..00000000 --- a/tests/templates/kuttl/shutdown/40-assert.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- -apiVersion: kuttl.dev/v1beta1 -kind: TestAssert -metadata: - name: hbase-test-runner -timeout: 300 ---- -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: hbase-test-runner -status: - readyReplicas: 1 - replicas: 1 diff --git a/tests/templates/kuttl/shutdown/40-install-hbase-test-runner.yaml b/tests/templates/kuttl/shutdown/40-install-hbase-test-runner.yaml deleted file mode 100644 index 35303aa6..00000000 --- a/tests/templates/kuttl/shutdown/40-install-hbase-test-runner.yaml +++ /dev/null @@ -1,29 +0,0 @@ ---- -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: hbase-test-runner - labels: - app: hbase-test-runner -spec: - replicas: 1 - selector: - matchLabels: - app: hbase-test-runner - template: - metadata: - labels: - app: hbase-test-runner - spec: - containers: - - name: hbase-test-runner - image: docker.stackable.tech/stackable/testing-tools:0.2.0-stackable0.0.0-dev - stdin: true - tty: true - resources: - requests: - memory: "128Mi" - cpu: "100m" - limits: - memory: "128Mi" - cpu: "500m" diff --git a/tests/templates/kuttl/shutdown/50-assert.yaml b/tests/templates/kuttl/shutdown/50-assert.yaml index b7f37813..127864db 100644 --- a/tests/templates/kuttl/shutdown/50-assert.yaml +++ b/tests/templates/kuttl/shutdown/50-assert.yaml @@ -4,5 +4,8 @@ kind: TestAssert metadata: name: test-hbase commands: - - script: kubectl exec --namespace=$NAMESPACE hbase-test-runner-0 -- python /tmp/test-hbase.py http://test-hbase-restserver-default:8080 + - script: kubectl exec --namespace=$NAMESPACE test-hbase-master-default-0 -- /tmp/create_regions.sh + - script: kubectl delete --namespace=$NAMESPACE pod/test-hbase-regionserver-default-0 + - script: sleep 10 + - script: kubectl exec --namespace=$NAMESPACE test-hbase-master-default-0 -- /tmp/count_regions.sh timeout: 240 diff --git a/tests/templates/kuttl/shutdown/50-test-hbase.yaml b/tests/templates/kuttl/shutdown/50-test-hbase.yaml index 6863fc61..6c5d290a 100644 --- a/tests/templates/kuttl/shutdown/50-test-hbase.yaml +++ b/tests/templates/kuttl/shutdown/50-test-hbase.yaml @@ -2,4 +2,5 @@ apiVersion: kuttl.dev/v1beta1 kind: TestStep commands: - - script: kubectl cp --namespace=$NAMESPACE ./test-hbase.py hbase-test-runner-0:/tmp + - script: kubectl cp --namespace=$NAMESPACE ./create_regions.sh test-hbase-master-default-0:/tmp + - script: kubectl cp --namespace=$NAMESPACE ./count_regions.sh test-hbase-master-default-0:/tmp diff --git a/tests/templates/kuttl/shutdown/count_regions.sh b/tests/templates/kuttl/shutdown/count_regions.sh new file mode 100755 index 00000000..8ba26409 --- /dev/null +++ b/tests/templates/kuttl/shutdown/count_regions.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +# +# Count the number of regions on server 1. +# It should contain all 15 regions after region server 0 has been restarted. +# +set -euo 'pipefail' +set -x + +REGION_COUNT_ON_1=$(echo "list_regions 't1'" | /stackable/hbase/bin/hbase shell --noninteractive | grep test-hbase-regionserver-default-1 | wc -l) + +test "${REGION_COUNT_ON_1}" -eq 15 diff --git a/tests/templates/kuttl/shutdown/create_regions.sh b/tests/templates/kuttl/shutdown/create_regions.sh new file mode 100755 index 00000000..74b5754f --- /dev/null +++ b/tests/templates/kuttl/shutdown/create_regions.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +# +# Create a table with 15 regions and count the number of regions on server 0. +# It should be more than 0. +# +set -euo 'pipefail' +set -x + +echo "balance_switch false" | /stackable/hbase/bin/hbase shell --noninteractive + +echo "create 't1', 'f1', {NUMREGIONS => 15, SPLITALGO => 'HexStringSplit'}" | /stackable/hbase/bin/hbase shell --noninteractive + +REGION_COUNT_ON_0=$(echo "list_regions 't1'" | /stackable/hbase/bin/hbase shell --noninteractive | grep test-hbase-regionserver-default-0 | wc -l) + +test "${REGION_COUNT_ON_0}" -ge 0 diff --git a/tests/templates/kuttl/shutdown/test-hbase.py b/tests/templates/kuttl/shutdown/test-hbase.py deleted file mode 100644 index ca170169..00000000 --- a/tests/templates/kuttl/shutdown/test-hbase.py +++ /dev/null @@ -1,135 +0,0 @@ -import base64 -import http -import requests -import xml.etree.ElementTree as ET -import sys - - -class HbaseClient: - def __init__(self): - self.session = requests.Session() - self.session.headers.update( - { - "Accept": "text/xml", - "Content-Type": "text/xml", - } - ) - http.client.HTTPConnection.debuglevel = 1 - - @staticmethod - def encode_value(plain_string): - return base64.b64encode(plain_string.encode("utf-8")).decode("ascii") - - @staticmethod - def decode_value(base64_string): - return base64.b64decode(base64_string).decode("utf-8") - - def create_table(self, rest_url, name, column_family, compression): - response = self.session.put( - f"{rest_url}/{name}/schema", - data=f""" - - - - """, - ) - assert response.status_code == 201 - table_schema_location = response.headers["location"] - table_location = table_schema_location.removesuffix("/schema") - return (table_location, table_schema_location) - - def delete_table(self, table_schema_location): - response = self.session.delete(table_schema_location) - assert response.status_code == 200 - - def put_row(self, table_location, row_key, column_family, column, cell_value): - cell_column = f"{column_family}:{column}" - response = self.session.put( - f"{table_location}/{row_key}", - data=f""" - - - - {self.encode_value(cell_value)} - - - - """, - ) - assert response.status_code == 200 - - def put_scanner(self, table_location): - response = self.session.put( - f"{table_location}/scanner", data='' - ) - assert response.status_code == 201 - return response.headers["location"] - - def get_scanner(self, scanner_location): - response = self.session.get(scanner_location) - assert response.status_code == 200 - return response.text - - def delete_scanner(self, scanner_location): - response = self.session.delete(scanner_location) - assert response.status_code == 200 - - -hbase_rest_url = sys.argv[1] - -hbase = HbaseClient() - -# supported compression algorithms: SNAPPY, GZ -compression_opts = ["NONE", "SNAPPY", "GZ"] - -for compression in compression_opts: - print(f""" - Create a table with compression={compression} - ==============""") - column_family = "cf" - (table_location, table_schema_location) = hbase.create_table( - rest_url=hbase_rest_url, - name="companies", - column_family=column_family, - compression=compression, - ) - - print(""" - Write a row to the table - ========================""") - cell_value = "Stackable GmbH" - hbase.put_row( - table_location=table_location, - row_key="stackable", - column_family=column_family, - column="name", - cell_value=cell_value, - ) - - print(""" - Get a scanner object - ====================""") - scanner_location = hbase.put_scanner(table_location) - - print(""" - Get the next batch from the scanner - ===================================""") - scan = hbase.get_scanner(scanner_location) - - print(""" - Verify table content - ====================""") - parser = ET.fromstring(scan) - actual_cell_value = hbase.decode_value(parser.findtext("./Row/Cell")) - print(f'assert "{actual_cell_value}" == "{cell_value}"') - assert actual_cell_value == cell_value - - print(""" - Delete the scanner - ==================""") - hbase.delete_scanner(scanner_location) - - print(""" - Delete the table - ================""") - hbase.delete_table(table_schema_location) From 43abf6db5fc9a6c94b64f6ab67e85d2f53c6abfc Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Thu, 17 Oct 2024 16:59:53 +0200 Subject: [PATCH 13/51] fix image pull policy for the kerberos tests --- tests/templates/kuttl/kerberos/10-install-zk.yaml.j2 | 1 + tests/templates/kuttl/kerberos/11-install-hdfs.yaml.j2 | 1 + tests/templates/kuttl/kerberos/20-access-hdfs.yaml.j2 | 1 + tests/templates/kuttl/kerberos/30-install-hbase.yaml.j2 | 1 + tests/templates/kuttl/kerberos/41-access-hbase.yaml.j2 | 1 + 5 files changed, 5 insertions(+) diff --git a/tests/templates/kuttl/kerberos/10-install-zk.yaml.j2 b/tests/templates/kuttl/kerberos/10-install-zk.yaml.j2 index 6bbee739..58440246 100644 --- a/tests/templates/kuttl/kerberos/10-install-zk.yaml.j2 +++ b/tests/templates/kuttl/kerberos/10-install-zk.yaml.j2 @@ -6,6 +6,7 @@ metadata: spec: image: productVersion: "{{ test_scenario['values']['zookeeper-latest'] }}" + pullPolicy: IfNotPresent clusterConfig: listenerClass: {{ test_scenario['values']['listener-class'] }} {% if lookup('env', 'VECTOR_AGGREGATOR') %} diff --git a/tests/templates/kuttl/kerberos/11-install-hdfs.yaml.j2 b/tests/templates/kuttl/kerberos/11-install-hdfs.yaml.j2 index 961a686e..4808e11d 100644 --- a/tests/templates/kuttl/kerberos/11-install-hdfs.yaml.j2 +++ b/tests/templates/kuttl/kerberos/11-install-hdfs.yaml.j2 @@ -19,6 +19,7 @@ commands: spec: image: productVersion: "{{ test_scenario['values']['hdfs-latest'] }}" + pullPolicy: IfNotPresent clusterConfig: zookeeperConfigMapName: hdfs-znode dfsReplication: 1 diff --git a/tests/templates/kuttl/kerberos/20-access-hdfs.yaml.j2 b/tests/templates/kuttl/kerberos/20-access-hdfs.yaml.j2 index c8386026..6d826dd0 100644 --- a/tests/templates/kuttl/kerberos/20-access-hdfs.yaml.j2 +++ b/tests/templates/kuttl/kerberos/20-access-hdfs.yaml.j2 @@ -16,6 +16,7 @@ commands: containers: - name: access-hdfs image: docker.stackable.tech/stackable/hadoop:{{ test_scenario['values']['hdfs-latest'] }}-stackable0.0.0-dev + imagePullPolicy: IfNotPresent env: - name: HADOOP_CONF_DIR value: /stackable/conf/hdfs diff --git a/tests/templates/kuttl/kerberos/30-install-hbase.yaml.j2 b/tests/templates/kuttl/kerberos/30-install-hbase.yaml.j2 index f862651c..bc85ef68 100644 --- a/tests/templates/kuttl/kerberos/30-install-hbase.yaml.j2 +++ b/tests/templates/kuttl/kerberos/30-install-hbase.yaml.j2 @@ -24,6 +24,7 @@ commands: {% else %} productVersion: "{{ test_scenario['values']['hbase'] }}" {% endif %} + pullPolicy: IfNotPresent clusterConfig: hdfsConfigMapName: hdfs zookeeperConfigMapName: hbase-znode diff --git a/tests/templates/kuttl/kerberos/41-access-hbase.yaml.j2 b/tests/templates/kuttl/kerberos/41-access-hbase.yaml.j2 index 8555cf19..7ed1a489 100644 --- a/tests/templates/kuttl/kerberos/41-access-hbase.yaml.j2 +++ b/tests/templates/kuttl/kerberos/41-access-hbase.yaml.j2 @@ -20,6 +20,7 @@ commands: {% else %} image: docker.stackable.tech/stackable/hbase:{{ test_scenario['values']['hbase'] }}-stackable0.0.0-dev {% endif %} + imagePullPolicy: IfNotPresent env: - name: HBASE_CONF_DIR value: /stackable/conf/hbase From 2b6e89b1327beebd29f7df556bf9f8f31019e3e3 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Thu, 17 Oct 2024 17:23:48 +0200 Subject: [PATCH 14/51] add RUN_REGION_MOVER env var --- rust/crd/src/lib.rs | 7 +++++++ rust/operator-binary/src/hbase_controller.rs | 17 ++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/rust/crd/src/lib.rs b/rust/crd/src/lib.rs index 4cdaebe4..7d7d37c4 100644 --- a/rust/crd/src/lib.rs +++ b/rust/crd/src/lib.rs @@ -1175,6 +1175,13 @@ impl AnyServiceConfig { _ => "".to_string(), } } + + pub fn run_region_mover(&self) -> bool { + match self { + AnyServiceConfig::RegionServer(config) => config.region_mover.run_before_shutdown, + _ => false, + } + } } #[cfg(test)] diff --git a/rust/operator-binary/src/hbase_controller.rs b/rust/operator-binary/src/hbase_controller.rs index e08a3d1c..0695e1a9 100644 --- a/rust/operator-binary/src/hbase_controller.rs +++ b/rust/operator-binary/src/hbase_controller.rs @@ -807,11 +807,18 @@ fn build_rolegroup_statefulset( let mut merged_env = merged_env(rolegroup_config.get(&PropertyNameKind::Env)); // This env var is set for all roles to avoid bash's "unbound variable" errors - merged_env.push(EnvVar { - name: "REGION_MOVER_OPTS".to_string(), - value: Some(config.region_mover_args()), - ..EnvVar::default() - }); + merged_env.extend([ + EnvVar { + name: "REGION_MOVER_OPTS".to_string(), + value: Some(config.region_mover_args()), + ..EnvVar::default() + }, + EnvVar { + name: "RUN_REGION_MOVER".to_string(), + value: Some(config.run_region_mover().to_string()), + ..EnvVar::default() + }, + ]); let mut hbase_container = ContainerBuilder::new("hbase").expect("ContainerBuilder not created"); hbase_container From c53497a63f11c830db45fcb1518968056acff19b Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Thu, 17 Oct 2024 18:56:18 +0300 Subject: [PATCH 15/51] Update docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc Co-authored-by: Nick <10092581+NickLarsenNZ@users.noreply.github.com> --- .../pages/usage-guide/operations/graceful-shutdown.adoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 3fccc972..d511a799 100644 --- a/docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc +++ b/docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc @@ -38,10 +38,10 @@ spec: regionServers: config: regionMover - runBeforeShutdown: true, <1> - maxThreads: 5, <2> - ack: false, <3> - extraOpts: ["--designatedFile", "/path/to/designatedFile"] <4> + runBeforeShutdown: true # <1> + maxThreads: 5 # <2> + ack: false # <3> + extraOpts: ["--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. From 4e31a3c8304d3507fd6da4f10bbb37249db1f41a Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Thu, 17 Oct 2024 18:15:40 +0200 Subject: [PATCH 16/51] remove trailing whitespace in docs --- .../hbase/pages/usage-guide/operations/graceful-shutdown.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 d511a799..4b3471c2 100644 --- a/docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc +++ b/docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc @@ -38,8 +38,8 @@ spec: regionServers: config: regionMover - runBeforeShutdown: true # <1> - maxThreads: 5 # <2> + runBeforeShutdown: true # <1> + maxThreads: 5 # <2> ack: false # <3> extraOpts: ["--designatedFile", "/path/to/designatedFile"] # <4> ---- From a10caa0f6cd00e5db2f91333c5b814638a87f4eb Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Thu, 17 Oct 2024 18:17:50 +0200 Subject: [PATCH 17/51] rust : remove unused dep --- Cargo.lock | 1 - rust/operator-binary/Cargo.toml | 1 - 2 files changed, 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0e50947e..527ef6c1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2171,7 +2171,6 @@ dependencies = [ "clap", "fnv", "futures 0.3.31", - "indoc", "product-config", "rstest", "serde", diff --git a/rust/operator-binary/Cargo.toml b/rust/operator-binary/Cargo.toml index b4822d0f..9f98c653 100644 --- a/rust/operator-binary/Cargo.toml +++ b/rust/operator-binary/Cargo.toml @@ -29,4 +29,3 @@ built.workspace = true [dev-dependencies] rstest.workspace = true serde_yaml.workspace = true -indoc.workspace = true From f42ab0591e23897fa1dae0f2b96ffb4b2eb3aa1e Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Thu, 17 Oct 2024 18:21:04 +0200 Subject: [PATCH 18/51] fix shellcheck lint --- tests/templates/kuttl/shutdown/count_regions.sh | 2 +- tests/templates/kuttl/shutdown/create_regions.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/templates/kuttl/shutdown/count_regions.sh b/tests/templates/kuttl/shutdown/count_regions.sh index 8ba26409..9ca3bd47 100755 --- a/tests/templates/kuttl/shutdown/count_regions.sh +++ b/tests/templates/kuttl/shutdown/count_regions.sh @@ -6,6 +6,6 @@ set -euo 'pipefail' set -x -REGION_COUNT_ON_1=$(echo "list_regions 't1'" | /stackable/hbase/bin/hbase shell --noninteractive | grep test-hbase-regionserver-default-1 | wc -l) +REGION_COUNT_ON_1=$(echo "list_regions 't1'" | /stackable/hbase/bin/hbase shell --noninteractive | grep -c test-hbase-regionserver-default-1) test "${REGION_COUNT_ON_1}" -eq 15 diff --git a/tests/templates/kuttl/shutdown/create_regions.sh b/tests/templates/kuttl/shutdown/create_regions.sh index 74b5754f..fef16b9a 100755 --- a/tests/templates/kuttl/shutdown/create_regions.sh +++ b/tests/templates/kuttl/shutdown/create_regions.sh @@ -10,6 +10,6 @@ echo "balance_switch false" | /stackable/hbase/bin/hbase shell --noninteractive echo "create 't1', 'f1', {NUMREGIONS => 15, SPLITALGO => 'HexStringSplit'}" | /stackable/hbase/bin/hbase shell --noninteractive -REGION_COUNT_ON_0=$(echo "list_regions 't1'" | /stackable/hbase/bin/hbase shell --noninteractive | grep test-hbase-regionserver-default-0 | wc -l) +REGION_COUNT_ON_0=$(echo "list_regions 't1'" | /stackable/hbase/bin/hbase shell --noninteractive | grep -c test-hbase-regionserver-default-0) test "${REGION_COUNT_ON_0}" -ge 0 From 0e9e37e3a36266d9b89975670f0d2590beb98eb5 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Fri, 18 Oct 2024 11:04:35 +0200 Subject: [PATCH 19/51] update shutdown test and run it successfuly --- .../templates/kuttl/shutdown/10-install-zookeeper.yaml.j2 | 1 + tests/templates/kuttl/shutdown/20-install-hdfs.yaml.j2 | 3 +++ tests/templates/kuttl/shutdown/30-assert.yaml | 6 +++--- tests/templates/kuttl/shutdown/30-install-hbase.yaml.j2 | 3 +++ tests/templates/kuttl/shutdown/50-assert.yaml | 7 +++++++ tests/test-definition.yaml | 7 ++++--- 6 files changed, 21 insertions(+), 6 deletions(-) diff --git a/tests/templates/kuttl/shutdown/10-install-zookeeper.yaml.j2 b/tests/templates/kuttl/shutdown/10-install-zookeeper.yaml.j2 index f722d7a7..e5f6ec65 100644 --- a/tests/templates/kuttl/shutdown/10-install-zookeeper.yaml.j2 +++ b/tests/templates/kuttl/shutdown/10-install-zookeeper.yaml.j2 @@ -14,6 +14,7 @@ spec: {% endif %} servers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/shutdown/20-install-hdfs.yaml.j2 b/tests/templates/kuttl/shutdown/20-install-hdfs.yaml.j2 index 75c3f1ec..844c4b27 100644 --- a/tests/templates/kuttl/shutdown/20-install-hdfs.yaml.j2 +++ b/tests/templates/kuttl/shutdown/20-install-hdfs.yaml.j2 @@ -14,6 +14,7 @@ spec: {% endif %} nameNodes: config: + gracefulShutdownTimeout: 1m listenerClass: "cluster-internal" logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} @@ -22,6 +23,7 @@ spec: replicas: 2 dataNodes: config: + gracefulShutdownTimeout: 1m listenerClass: "cluster-internal" logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} @@ -30,6 +32,7 @@ spec: replicas: 1 journalNodes: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/shutdown/30-assert.yaml b/tests/templates/kuttl/shutdown/30-assert.yaml index cae4a019..4331bc64 100644 --- a/tests/templates/kuttl/shutdown/30-assert.yaml +++ b/tests/templates/kuttl/shutdown/30-assert.yaml @@ -12,7 +12,7 @@ metadata: spec: template: spec: - terminationGracePeriodSeconds: 1200 + terminationGracePeriodSeconds: 60 status: readyReplicas: 2 replicas: 2 @@ -24,7 +24,7 @@ metadata: spec: template: spec: - terminationGracePeriodSeconds: 3600 + terminationGracePeriodSeconds: 120 status: readyReplicas: 2 replicas: 2 @@ -36,7 +36,7 @@ metadata: spec: template: spec: - terminationGracePeriodSeconds: 300 + terminationGracePeriodSeconds: 60 status: readyReplicas: 2 replicas: 2 diff --git a/tests/templates/kuttl/shutdown/30-install-hbase.yaml.j2 b/tests/templates/kuttl/shutdown/30-install-hbase.yaml.j2 index 6b80fd09..2bfb30d3 100644 --- a/tests/templates/kuttl/shutdown/30-install-hbase.yaml.j2 +++ b/tests/templates/kuttl/shutdown/30-install-hbase.yaml.j2 @@ -21,6 +21,7 @@ spec: {% endif %} masters: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -32,6 +33,7 @@ spec: replicas: 2 regionServers: config: + gracefulShutdownTimeout: 2m # one minute for the region mover logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} regionMover: @@ -47,6 +49,7 @@ spec: replicas: 2 restServers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/shutdown/50-assert.yaml b/tests/templates/kuttl/shutdown/50-assert.yaml index 127864db..7ca054c0 100644 --- a/tests/templates/kuttl/shutdown/50-assert.yaml +++ b/tests/templates/kuttl/shutdown/50-assert.yaml @@ -1,4 +1,11 @@ --- +# This test works as follows: +# - given +# - an HBase cluster with two region servers (0 and 1) +# - create a table + column familiy with 15 regions +# - where region server 0 has some regions assigned to it +# - restart server 0 (the region mover is triggerred by the shutdown) +# - assert that server 1 now hosts all 15 regions apiVersion: kuttl.dev/v1beta1 kind: TestAssert metadata: diff --git a/tests/test-definition.yaml b/tests/test-definition.yaml index 14376f53..4095c20a 100644 --- a/tests/test-definition.yaml +++ b/tests/test-definition.yaml @@ -2,10 +2,11 @@ dimensions: - name: hbase values: - #- 2.6.0 - #- 2.4.18 + # - 2.6.0 + # - 2.4.18 # To use a custom image, add a comma and the full name after the product version - - 2.6.0,razvan:hbase-2.6.0 + - 2.6.0,docker.stackable.tech/razvan/hbase-2.6.0 + - 2.4.18,docker.stackable.tech/razvan/hbase-2.4.18 # - 2.4.18,docker.stackable.tech/sandbox/hbase:2.4.18-stackable0.0.0-dev - name: hbase-opa values: From c2c92c5a72b01d9c87534b65c6e9cba8ae40e430 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Fri, 18 Oct 2024 11:07:47 +0200 Subject: [PATCH 20/51] update docs --- .../hbase/pages/usage-guide/operations/graceful-shutdown.adoc | 2 ++ 1 file changed, 2 insertions(+) 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 4b3471c2..095d2c80 100644 --- a/docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc +++ b/docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc @@ -50,6 +50,8 @@ spec: NOTE: There is no need to explicitly specify a timeout for the region movement. The operator will compute an appropriate timeout that cannot exceed the `gracefulShutdownTimeout` for region servers. +IMPORTANT: The ZooKeeper connection must be available during the time the region mover is running for the graceful shutdown process to succeed. + == RestServers As a default, RestServers have `5 minutes` to shut down gracefully. From 8d7265edca5efc2736df95634b1d53b1537a4b7d Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Fri, 18 Oct 2024 13:29:57 +0300 Subject: [PATCH 21/51] Update rust/crd/src/lib.rs Co-authored-by: Nick <10092581+NickLarsenNZ@users.noreply.github.com> --- rust/crd/src/lib.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/rust/crd/src/lib.rs b/rust/crd/src/lib.rs index 7d7d37c4..3dd9f496 100644 --- a/rust/crd/src/lib.rs +++ b/rust/crd/src/lib.rs @@ -86,13 +86,11 @@ pub const METRICS_PORT: u16 = 9100; pub const JVM_HEAP_FACTOR: f32 = 0.8; const DEFAULT_MASTER_GRACEFUL_SHUTDOWN_TIMEOUT: Duration = Duration::from_minutes_unchecked(20); -// The following three values should be kept in sync so that -// DEFAULT_REGION_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT = DEFAULT_REGION_MOVER_TIMEOUT + DEFAULT_REGION_MOVER_DELTA_TO_SHUTDOWN -const DEFAULT_REGION_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT: Duration = - Duration::from_minutes_unchecked(60); -// This should always be slightly less than the above -const DEFAULT_REGION_MOVER_TIMEOUT: Duration = Duration::from_minutes_unchecked(59); +const DEFAULT_REGION_MOVER_TIMEOUT: Duration = Duration::from_minutes_unchecked(59); const DEFAULT_REGION_MOVER_DELTA_TO_SHUTDOWN: Duration = Duration::from_minutes_unchecked(1); +const DEFAULT_REGION_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT: Duration = DEFAULT_REGION_MOVER_TIMEOUT + DEFAULT_REGION_MOVER_DELTA_TO_SHUTDOWN; + + const DEFAULT_REST_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT: Duration = Duration::from_minutes_unchecked(5); #[derive(Snafu, Debug)] From 28a1395d48f89eb25f779938e39ead7471588af0 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Fri, 18 Oct 2024 12:42:55 +0200 Subject: [PATCH 22/51] fix const arithmetic --- Cargo.lock | 1 + Cargo.toml | 1 + rust/crd/Cargo.toml | 1 + rust/crd/src/lib.rs | 12 +++++++----- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 527ef6c1..873d83d5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2150,6 +2150,7 @@ name = "stackable-hbase-crd" version = "0.0.0-dev" dependencies = [ "indoc", + "lazy_static", "product-config", "rstest", "serde", diff --git a/Cargo.toml b/Cargo.toml index c149c408..6ecca5f5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,6 +27,7 @@ product-config = { git = "https://github.com/stackabletech/product-config.git", strum = { version = "0.26", features = ["derive"] } tokio = { version = "1.40", features = ["full"] } tracing = "0.1" +lazy_static = "1.5" #[patch."https://github.com/stackabletech/operator-rs.git"] #stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "main" } diff --git a/rust/crd/Cargo.toml b/rust/crd/Cargo.toml index 8fec0dba..008adbf0 100644 --- a/rust/crd/Cargo.toml +++ b/rust/crd/Cargo.toml @@ -17,6 +17,7 @@ snafu.workspace = true stackable-operator.workspace = true strum.workspace = true tracing.workspace = true +lazy_static.workspace = true [dev-dependencies] rstest.workspace = true diff --git a/rust/crd/src/lib.rs b/rust/crd/src/lib.rs index 3dd9f496..6ae9276d 100644 --- a/rust/crd/src/lib.rs +++ b/rust/crd/src/lib.rs @@ -1,3 +1,4 @@ +use lazy_static::lazy_static; use product_config::types::PropertyNameKind; use security::AuthenticationConfig; use serde::{Deserialize, Serialize}; @@ -86,12 +87,13 @@ pub const METRICS_PORT: u16 = 9100; pub const JVM_HEAP_FACTOR: f32 = 0.8; const DEFAULT_MASTER_GRACEFUL_SHUTDOWN_TIMEOUT: Duration = Duration::from_minutes_unchecked(20); -const DEFAULT_REGION_MOVER_TIMEOUT: Duration = Duration::from_minutes_unchecked(59); +const DEFAULT_REGION_MOVER_TIMEOUT: Duration = Duration::from_minutes_unchecked(59); const DEFAULT_REGION_MOVER_DELTA_TO_SHUTDOWN: Duration = Duration::from_minutes_unchecked(1); -const DEFAULT_REGION_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT: Duration = DEFAULT_REGION_MOVER_TIMEOUT + DEFAULT_REGION_MOVER_DELTA_TO_SHUTDOWN; - - const DEFAULT_REST_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT: Duration = Duration::from_minutes_unchecked(5); +lazy_static! { + static ref DEFAULT_REGION_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT: Duration = + DEFAULT_REGION_MOVER_TIMEOUT + DEFAULT_REGION_MOVER_DELTA_TO_SHUTDOWN; +} #[derive(Snafu, Debug)] pub enum Error { @@ -315,7 +317,7 @@ fn default_regionserver_config( &HbaseRole::RegionServer, hdfs_discovery_cm_name, ), - graceful_shutdown_timeout: Some(DEFAULT_REGION_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT), + graceful_shutdown_timeout: Some(*DEFAULT_REGION_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT), region_mover: Some(RegionMover::default()), } } From f059e7f9ec6ef3fbf429ffcd6aa73ae37c2beaa1 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Fri, 18 Oct 2024 14:38:23 +0200 Subject: [PATCH 23/51] switch to LazyLock --- Cargo.lock | 1 - Cargo.toml | 1 - rust/crd/Cargo.toml | 1 - rust/crd/src/lib.rs | 8 +++----- 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 873d83d5..527ef6c1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2150,7 +2150,6 @@ name = "stackable-hbase-crd" version = "0.0.0-dev" dependencies = [ "indoc", - "lazy_static", "product-config", "rstest", "serde", diff --git a/Cargo.toml b/Cargo.toml index 6ecca5f5..c149c408 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,6 @@ product-config = { git = "https://github.com/stackabletech/product-config.git", strum = { version = "0.26", features = ["derive"] } tokio = { version = "1.40", features = ["full"] } tracing = "0.1" -lazy_static = "1.5" #[patch."https://github.com/stackabletech/operator-rs.git"] #stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "main" } diff --git a/rust/crd/Cargo.toml b/rust/crd/Cargo.toml index 008adbf0..8fec0dba 100644 --- a/rust/crd/Cargo.toml +++ b/rust/crd/Cargo.toml @@ -17,7 +17,6 @@ snafu.workspace = true stackable-operator.workspace = true strum.workspace = true tracing.workspace = true -lazy_static.workspace = true [dev-dependencies] rstest.workspace = true diff --git a/rust/crd/src/lib.rs b/rust/crd/src/lib.rs index 6ae9276d..bcaccad1 100644 --- a/rust/crd/src/lib.rs +++ b/rust/crd/src/lib.rs @@ -1,4 +1,3 @@ -use lazy_static::lazy_static; use product_config::types::PropertyNameKind; use security::AuthenticationConfig; use serde::{Deserialize, Serialize}; @@ -30,6 +29,7 @@ use stackable_operator::{ }; use std::collections::BTreeMap; use std::collections::HashMap; +use std::sync::LazyLock; use strum::{Display, EnumIter, EnumString}; use crate::affinity::get_affinity; @@ -90,10 +90,8 @@ const DEFAULT_MASTER_GRACEFUL_SHUTDOWN_TIMEOUT: Duration = Duration::from_minute const DEFAULT_REGION_MOVER_TIMEOUT: Duration = Duration::from_minutes_unchecked(59); const DEFAULT_REGION_MOVER_DELTA_TO_SHUTDOWN: Duration = Duration::from_minutes_unchecked(1); const DEFAULT_REST_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT: Duration = Duration::from_minutes_unchecked(5); -lazy_static! { - static ref DEFAULT_REGION_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT: Duration = - DEFAULT_REGION_MOVER_TIMEOUT + DEFAULT_REGION_MOVER_DELTA_TO_SHUTDOWN; -} +static DEFAULT_REGION_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT: LazyLock = + LazyLock::new(|| DEFAULT_REGION_MOVER_TIMEOUT + DEFAULT_REGION_MOVER_DELTA_TO_SHUTDOWN); #[derive(Snafu, Debug)] pub enum Error { From 67f3f1b73f127f923b8abb7f0e981c24fa4c54a4 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Fri, 18 Oct 2024 15:48:16 +0200 Subject: [PATCH 24/51] configure gracefulShutdownTimeout in (almost) all tests --- .../kuttl/cluster-operation/01-install-zookeeper.yaml.j2 | 1 + .../kuttl/cluster-operation/02-install-hdfs.yaml.j2 | 3 +++ .../kuttl/cluster-operation/03-install-hbase.yaml.j2 | 3 +++ .../kuttl/cluster-operation/10-pause-hbase.yaml.j2 | 3 +++ .../templates/kuttl/cluster-operation/20-stop-hbase.yaml.j2 | 3 +++ .../kuttl/cluster-operation/30-restart-hbase.yaml.j2 | 3 +++ tests/templates/kuttl/kerberos/10-install-zk.yaml.j2 | 1 + tests/templates/kuttl/kerberos/11-install-hdfs.yaml.j2 | 3 +++ tests/templates/kuttl/kerberos/30-install-hbase.yaml.j2 | 3 +++ tests/templates/kuttl/logging/02-install-zookeeper.yaml.j2 | 1 + tests/templates/kuttl/logging/03-install-hdfs.yaml.j2 | 3 +++ tests/templates/kuttl/logging/05-install-hbase.yaml.j2 | 6 ++++++ tests/templates/kuttl/omid/10-install-zookeeper.yaml.j2 | 1 + tests/templates/kuttl/omid/20-install-hdfs.yaml.j2 | 3 +++ tests/templates/kuttl/omid/30-assert.yaml | 6 +++--- tests/templates/kuttl/omid/30-install-hbase.yaml.j2 | 3 +++ tests/templates/kuttl/opa/10-install-zk.yaml.j2 | 1 + tests/templates/kuttl/opa/11-install-opa.yaml.j2 | 2 ++ tests/templates/kuttl/opa/16-install-hdfs.yaml.j2 | 3 +++ tests/templates/kuttl/opa/30-install-hbase.yaml.j2 | 3 +++ .../kuttl/orphaned_resources/01-install-zookeeper.yaml.j2 | 1 + .../kuttl/orphaned_resources/02-install-hdfs.yaml.j2 | 3 +++ .../kuttl/orphaned_resources/03-install-hbase.yaml.j2 | 3 +++ .../templates/kuttl/overrides/10-install-zookeeper.yaml.j2 | 1 + tests/templates/kuttl/overrides/20-install-hdfs.yaml.j2 | 3 +++ tests/templates/kuttl/overrides/30-install-hbase.yaml.j2 | 3 +++ .../templates/kuttl/profiling/01-install-zookeeper.yaml.j2 | 1 + tests/templates/kuttl/profiling/02-install-hdfs.yaml.j2 | 3 +++ tests/templates/kuttl/profiling/03-install-hbase.yaml.j2 | 3 +++ .../templates/kuttl/resources/10-install-zookeeper.yaml.j2 | 1 + tests/templates/kuttl/resources/20-install-hdfs.yaml.j2 | 3 +++ tests/templates/kuttl/resources/30-install-hbase.yaml.j2 | 3 +++ tests/templates/kuttl/smoke/10-install-zookeeper.yaml.j2 | 1 + tests/templates/kuttl/smoke/20-install-hdfs.yaml.j2 | 3 +++ .../kuttl/snapshot-export/11-install-zookeeper.yaml.j2 | 1 + .../templates/kuttl/snapshot-export/12-install-hdfs.yaml.j2 | 3 +++ .../kuttl/snapshot-export/20-install-hbase.yaml.j2 | 3 +++ tests/test-definition.yaml | 6 ++++-- 38 files changed, 95 insertions(+), 5 deletions(-) diff --git a/tests/templates/kuttl/cluster-operation/01-install-zookeeper.yaml.j2 b/tests/templates/kuttl/cluster-operation/01-install-zookeeper.yaml.j2 index cdfc8dbf..0a331d50 100644 --- a/tests/templates/kuttl/cluster-operation/01-install-zookeeper.yaml.j2 +++ b/tests/templates/kuttl/cluster-operation/01-install-zookeeper.yaml.j2 @@ -13,6 +13,7 @@ spec: {% endif %} servers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/cluster-operation/02-install-hdfs.yaml.j2 b/tests/templates/kuttl/cluster-operation/02-install-hdfs.yaml.j2 index 0bd3bb65..8a9a4bc0 100644 --- a/tests/templates/kuttl/cluster-operation/02-install-hdfs.yaml.j2 +++ b/tests/templates/kuttl/cluster-operation/02-install-hdfs.yaml.j2 @@ -14,6 +14,7 @@ spec: {% endif %} nameNodes: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -21,6 +22,7 @@ spec: replicas: 2 dataNodes: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -28,6 +30,7 @@ spec: replicas: 1 journalNodes: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/cluster-operation/03-install-hbase.yaml.j2 b/tests/templates/kuttl/cluster-operation/03-install-hbase.yaml.j2 index f68aee37..4732f740 100644 --- a/tests/templates/kuttl/cluster-operation/03-install-hbase.yaml.j2 +++ b/tests/templates/kuttl/cluster-operation/03-install-hbase.yaml.j2 @@ -26,6 +26,7 @@ spec: {% endif %} masters: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -33,6 +34,7 @@ spec: replicas: 1 regionServers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -40,6 +42,7 @@ spec: replicas: 1 restServers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/cluster-operation/10-pause-hbase.yaml.j2 b/tests/templates/kuttl/cluster-operation/10-pause-hbase.yaml.j2 index b0862dae..ffc8c7c0 100644 --- a/tests/templates/kuttl/cluster-operation/10-pause-hbase.yaml.j2 +++ b/tests/templates/kuttl/cluster-operation/10-pause-hbase.yaml.j2 @@ -29,6 +29,7 @@ spec: reconciliationPaused: true masters: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -36,6 +37,7 @@ spec: replicas: 1 regionServers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -43,6 +45,7 @@ spec: replicas: 1 restServers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/cluster-operation/20-stop-hbase.yaml.j2 b/tests/templates/kuttl/cluster-operation/20-stop-hbase.yaml.j2 index 80acdb16..0f4c5665 100644 --- a/tests/templates/kuttl/cluster-operation/20-stop-hbase.yaml.j2 +++ b/tests/templates/kuttl/cluster-operation/20-stop-hbase.yaml.j2 @@ -29,6 +29,7 @@ spec: reconciliationPaused: false masters: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -36,6 +37,7 @@ spec: replicas: 1 regionServers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -43,6 +45,7 @@ spec: replicas: 1 restServers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/cluster-operation/30-restart-hbase.yaml.j2 b/tests/templates/kuttl/cluster-operation/30-restart-hbase.yaml.j2 index c507e82e..388110b2 100644 --- a/tests/templates/kuttl/cluster-operation/30-restart-hbase.yaml.j2 +++ b/tests/templates/kuttl/cluster-operation/30-restart-hbase.yaml.j2 @@ -29,6 +29,7 @@ spec: reconciliationPaused: false masters: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -36,6 +37,7 @@ spec: replicas: 1 regionServers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -43,6 +45,7 @@ spec: replicas: 1 restServers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/kerberos/10-install-zk.yaml.j2 b/tests/templates/kuttl/kerberos/10-install-zk.yaml.j2 index 58440246..01330ba4 100644 --- a/tests/templates/kuttl/kerberos/10-install-zk.yaml.j2 +++ b/tests/templates/kuttl/kerberos/10-install-zk.yaml.j2 @@ -14,6 +14,7 @@ spec: {% endif %} servers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/kerberos/11-install-hdfs.yaml.j2 b/tests/templates/kuttl/kerberos/11-install-hdfs.yaml.j2 index 4808e11d..305043bf 100644 --- a/tests/templates/kuttl/kerberos/11-install-hdfs.yaml.j2 +++ b/tests/templates/kuttl/kerberos/11-install-hdfs.yaml.j2 @@ -32,6 +32,7 @@ commands: {% endif %} nameNodes: config: + gracefulShutdownTimeout: 1m listenerClass: {{ test_scenario['values']['listener-class'] }} logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} @@ -44,6 +45,7 @@ commands: replicas: 2 dataNodes: config: + gracefulShutdownTimeout: 1m listenerClass: {{ test_scenario['values']['listener-class'] }} logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} @@ -53,6 +55,7 @@ commands: replicas: 2 journalNodes: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} configOverrides: *configOverrides diff --git a/tests/templates/kuttl/kerberos/30-install-hbase.yaml.j2 b/tests/templates/kuttl/kerberos/30-install-hbase.yaml.j2 index bc85ef68..0676ed86 100644 --- a/tests/templates/kuttl/kerberos/30-install-hbase.yaml.j2 +++ b/tests/templates/kuttl/kerberos/30-install-hbase.yaml.j2 @@ -38,6 +38,7 @@ commands: {% endif %} masters: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -45,6 +46,7 @@ commands: replicas: 2 regionServers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -52,6 +54,7 @@ commands: replicas: 2 restServers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/logging/02-install-zookeeper.yaml.j2 b/tests/templates/kuttl/logging/02-install-zookeeper.yaml.j2 index cdfc8dbf..0a331d50 100644 --- a/tests/templates/kuttl/logging/02-install-zookeeper.yaml.j2 +++ b/tests/templates/kuttl/logging/02-install-zookeeper.yaml.j2 @@ -13,6 +13,7 @@ spec: {% endif %} servers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/logging/03-install-hdfs.yaml.j2 b/tests/templates/kuttl/logging/03-install-hdfs.yaml.j2 index 0bd3bb65..8a9a4bc0 100644 --- a/tests/templates/kuttl/logging/03-install-hdfs.yaml.j2 +++ b/tests/templates/kuttl/logging/03-install-hdfs.yaml.j2 @@ -14,6 +14,7 @@ spec: {% endif %} nameNodes: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -21,6 +22,7 @@ spec: replicas: 2 dataNodes: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -28,6 +30,7 @@ spec: replicas: 1 journalNodes: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/logging/05-install-hbase.yaml.j2 b/tests/templates/kuttl/logging/05-install-hbase.yaml.j2 index 2010483f..d12115f8 100644 --- a/tests/templates/kuttl/logging/05-install-hbase.yaml.j2 +++ b/tests/templates/kuttl/logging/05-install-hbase.yaml.j2 @@ -39,6 +39,8 @@ spec: zookeeperConfigMapName: test-znode vectorAggregatorConfigMapName: hbase-vector-aggregator-discovery masters: + config: + gracefulShutdownTimeout: 1m roleGroups: automatic-log-config: replicas: 1 @@ -83,6 +85,8 @@ spec: custom: configMap: hbase-log-config regionServers: + config: + gracefulShutdownTimeout: 1m roleGroups: automatic-log-config: replicas: 1 @@ -116,6 +120,8 @@ spec: custom: configMap: hbase-log-config restServers: + config: + gracefulShutdownTimeout: 1m roleGroups: automatic-log-config: replicas: 1 diff --git a/tests/templates/kuttl/omid/10-install-zookeeper.yaml.j2 b/tests/templates/kuttl/omid/10-install-zookeeper.yaml.j2 index ddff0254..33da088d 100644 --- a/tests/templates/kuttl/omid/10-install-zookeeper.yaml.j2 +++ b/tests/templates/kuttl/omid/10-install-zookeeper.yaml.j2 @@ -19,6 +19,7 @@ spec: {% endif %} servers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/omid/20-install-hdfs.yaml.j2 b/tests/templates/kuttl/omid/20-install-hdfs.yaml.j2 index 2e0c6c7b..80b12980 100644 --- a/tests/templates/kuttl/omid/20-install-hdfs.yaml.j2 +++ b/tests/templates/kuttl/omid/20-install-hdfs.yaml.j2 @@ -19,6 +19,7 @@ spec: {% endif %} nameNodes: config: + gracefulShutdownTimeout: 1m listenerClass: cluster-internal logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} @@ -27,6 +28,7 @@ spec: replicas: 2 dataNodes: config: + gracefulShutdownTimeout: 1m listenerClass: cluster-internal logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} @@ -35,6 +37,7 @@ spec: replicas: 1 journalNodes: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/omid/30-assert.yaml b/tests/templates/kuttl/omid/30-assert.yaml index 9943096c..2f715985 100644 --- a/tests/templates/kuttl/omid/30-assert.yaml +++ b/tests/templates/kuttl/omid/30-assert.yaml @@ -12,7 +12,7 @@ metadata: spec: template: spec: - terminationGracePeriodSeconds: 1200 + terminationGracePeriodSeconds: 60 status: readyReplicas: 2 replicas: 2 @@ -24,7 +24,7 @@ metadata: spec: template: spec: - terminationGracePeriodSeconds: 3600 + terminationGracePeriodSeconds: 60 status: readyReplicas: 1 replicas: 1 @@ -36,7 +36,7 @@ metadata: spec: template: spec: - terminationGracePeriodSeconds: 300 + terminationGracePeriodSeconds: 60 status: readyReplicas: 1 replicas: 1 diff --git a/tests/templates/kuttl/omid/30-install-hbase.yaml.j2 b/tests/templates/kuttl/omid/30-install-hbase.yaml.j2 index 21b484aa..da39bab6 100644 --- a/tests/templates/kuttl/omid/30-install-hbase.yaml.j2 +++ b/tests/templates/kuttl/omid/30-install-hbase.yaml.j2 @@ -21,6 +21,7 @@ spec: {% endif %} masters: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -28,6 +29,7 @@ spec: replicas: 2 regionServers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -35,6 +37,7 @@ spec: replicas: 1 restServers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/opa/10-install-zk.yaml.j2 b/tests/templates/kuttl/opa/10-install-zk.yaml.j2 index 7bb5607e..2d229e93 100644 --- a/tests/templates/kuttl/opa/10-install-zk.yaml.j2 +++ b/tests/templates/kuttl/opa/10-install-zk.yaml.j2 @@ -13,6 +13,7 @@ spec: {% endif %} servers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/opa/11-install-opa.yaml.j2 b/tests/templates/kuttl/opa/11-install-opa.yaml.j2 index 1e2aadc5..cedb6b98 100644 --- a/tests/templates/kuttl/opa/11-install-opa.yaml.j2 +++ b/tests/templates/kuttl/opa/11-install-opa.yaml.j2 @@ -8,5 +8,7 @@ spec: productVersion: 0.61.0 pullPolicy: IfNotPresent servers: + config: + gracefulShutdownTimeout: 1m roleGroups: default: {} diff --git a/tests/templates/kuttl/opa/16-install-hdfs.yaml.j2 b/tests/templates/kuttl/opa/16-install-hdfs.yaml.j2 index 2332a1ba..f3e11338 100644 --- a/tests/templates/kuttl/opa/16-install-hdfs.yaml.j2 +++ b/tests/templates/kuttl/opa/16-install-hdfs.yaml.j2 @@ -35,6 +35,7 @@ commands: {% endif %} nameNodes: config: + gracefulShutdownTimeout: 1m listenerClass: 'cluster-internal' logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} @@ -58,6 +59,7 @@ commands: replicas: 2 dataNodes: config: + gracefulShutdownTimeout: 1m listenerClass: 'cluster-internal' logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} @@ -67,6 +69,7 @@ commands: replicas: 1 journalNodes: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} configOverrides: *configOverrides diff --git a/tests/templates/kuttl/opa/30-install-hbase.yaml.j2 b/tests/templates/kuttl/opa/30-install-hbase.yaml.j2 index e71f6109..92fda28c 100644 --- a/tests/templates/kuttl/opa/30-install-hbase.yaml.j2 +++ b/tests/templates/kuttl/opa/30-install-hbase.yaml.j2 @@ -65,6 +65,7 @@ commands: {% endif %} masters: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -79,6 +80,7 @@ commands: configMap: hbase-log-config regionServers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -93,6 +95,7 @@ commands: configMap: hbase-log-config restServers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/orphaned_resources/01-install-zookeeper.yaml.j2 b/tests/templates/kuttl/orphaned_resources/01-install-zookeeper.yaml.j2 index cdfc8dbf..0a331d50 100644 --- a/tests/templates/kuttl/orphaned_resources/01-install-zookeeper.yaml.j2 +++ b/tests/templates/kuttl/orphaned_resources/01-install-zookeeper.yaml.j2 @@ -13,6 +13,7 @@ spec: {% endif %} servers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/orphaned_resources/02-install-hdfs.yaml.j2 b/tests/templates/kuttl/orphaned_resources/02-install-hdfs.yaml.j2 index 0bd3bb65..8a9a4bc0 100644 --- a/tests/templates/kuttl/orphaned_resources/02-install-hdfs.yaml.j2 +++ b/tests/templates/kuttl/orphaned_resources/02-install-hdfs.yaml.j2 @@ -14,6 +14,7 @@ spec: {% endif %} nameNodes: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -21,6 +22,7 @@ spec: replicas: 2 dataNodes: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -28,6 +30,7 @@ spec: replicas: 1 journalNodes: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/orphaned_resources/03-install-hbase.yaml.j2 b/tests/templates/kuttl/orphaned_resources/03-install-hbase.yaml.j2 index 08d33e65..bd1c04d5 100644 --- a/tests/templates/kuttl/orphaned_resources/03-install-hbase.yaml.j2 +++ b/tests/templates/kuttl/orphaned_resources/03-install-hbase.yaml.j2 @@ -20,6 +20,7 @@ spec: {% endif %} masters: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -27,6 +28,7 @@ spec: replicas: 1 regionServers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -34,6 +36,7 @@ spec: replicas: 1 restServers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/overrides/10-install-zookeeper.yaml.j2 b/tests/templates/kuttl/overrides/10-install-zookeeper.yaml.j2 index cdfc8dbf..0a331d50 100644 --- a/tests/templates/kuttl/overrides/10-install-zookeeper.yaml.j2 +++ b/tests/templates/kuttl/overrides/10-install-zookeeper.yaml.j2 @@ -13,6 +13,7 @@ spec: {% endif %} servers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/overrides/20-install-hdfs.yaml.j2 b/tests/templates/kuttl/overrides/20-install-hdfs.yaml.j2 index 0bd3bb65..8a9a4bc0 100644 --- a/tests/templates/kuttl/overrides/20-install-hdfs.yaml.j2 +++ b/tests/templates/kuttl/overrides/20-install-hdfs.yaml.j2 @@ -14,6 +14,7 @@ spec: {% endif %} nameNodes: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -21,6 +22,7 @@ spec: replicas: 2 dataNodes: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -28,6 +30,7 @@ spec: replicas: 1 journalNodes: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/overrides/30-install-hbase.yaml.j2 b/tests/templates/kuttl/overrides/30-install-hbase.yaml.j2 index 61d99a2c..e3dd8ff9 100644 --- a/tests/templates/kuttl/overrides/30-install-hbase.yaml.j2 +++ b/tests/templates/kuttl/overrides/30-install-hbase.yaml.j2 @@ -23,6 +23,7 @@ spec: TEST_VAR_FROM_MASTER: MASTER TEST_VAR: MASTER config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -36,6 +37,7 @@ spec: TEST_VAR_FROM_RS: REGIONSERVER TEST_VAR: REGIONSERVER config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -54,6 +56,7 @@ spec: TEST_VAR_FROM_REST: RESTSERVER TEST_VAR: RESTSERVER config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/profiling/01-install-zookeeper.yaml.j2 b/tests/templates/kuttl/profiling/01-install-zookeeper.yaml.j2 index cdfc8dbf..0a331d50 100644 --- a/tests/templates/kuttl/profiling/01-install-zookeeper.yaml.j2 +++ b/tests/templates/kuttl/profiling/01-install-zookeeper.yaml.j2 @@ -13,6 +13,7 @@ spec: {% endif %} servers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/profiling/02-install-hdfs.yaml.j2 b/tests/templates/kuttl/profiling/02-install-hdfs.yaml.j2 index 7d2b795b..f9194a60 100644 --- a/tests/templates/kuttl/profiling/02-install-hdfs.yaml.j2 +++ b/tests/templates/kuttl/profiling/02-install-hdfs.yaml.j2 @@ -15,6 +15,7 @@ spec: {% endif %} nameNodes: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -22,6 +23,7 @@ spec: replicas: 2 dataNodes: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -29,6 +31,7 @@ spec: replicas: 1 journalNodes: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/profiling/03-install-hbase.yaml.j2 b/tests/templates/kuttl/profiling/03-install-hbase.yaml.j2 index 74038173..f8c40ed2 100644 --- a/tests/templates/kuttl/profiling/03-install-hbase.yaml.j2 +++ b/tests/templates/kuttl/profiling/03-install-hbase.yaml.j2 @@ -20,6 +20,7 @@ spec: {% endif %} masters: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -27,6 +28,7 @@ spec: replicas: 1 regionServers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -34,6 +36,7 @@ spec: replicas: 1 restServers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/resources/10-install-zookeeper.yaml.j2 b/tests/templates/kuttl/resources/10-install-zookeeper.yaml.j2 index cdfc8dbf..0a331d50 100644 --- a/tests/templates/kuttl/resources/10-install-zookeeper.yaml.j2 +++ b/tests/templates/kuttl/resources/10-install-zookeeper.yaml.j2 @@ -13,6 +13,7 @@ spec: {% endif %} servers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/resources/20-install-hdfs.yaml.j2 b/tests/templates/kuttl/resources/20-install-hdfs.yaml.j2 index 0bd3bb65..8a9a4bc0 100644 --- a/tests/templates/kuttl/resources/20-install-hdfs.yaml.j2 +++ b/tests/templates/kuttl/resources/20-install-hdfs.yaml.j2 @@ -14,6 +14,7 @@ spec: {% endif %} nameNodes: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -21,6 +22,7 @@ spec: replicas: 2 dataNodes: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -28,6 +30,7 @@ spec: replicas: 1 journalNodes: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/resources/30-install-hbase.yaml.j2 b/tests/templates/kuttl/resources/30-install-hbase.yaml.j2 index a4aecf82..89fb0bc6 100644 --- a/tests/templates/kuttl/resources/30-install-hbase.yaml.j2 +++ b/tests/templates/kuttl/resources/30-install-hbase.yaml.j2 @@ -20,6 +20,7 @@ spec: {% endif %} masters: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -27,6 +28,7 @@ spec: replicas: 1 regionServers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} resources: @@ -59,6 +61,7 @@ spec: cpu: 2100m restServers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/smoke/10-install-zookeeper.yaml.j2 b/tests/templates/kuttl/smoke/10-install-zookeeper.yaml.j2 index dc9baea2..0d86426b 100644 --- a/tests/templates/kuttl/smoke/10-install-zookeeper.yaml.j2 +++ b/tests/templates/kuttl/smoke/10-install-zookeeper.yaml.j2 @@ -14,6 +14,7 @@ spec: {% endif %} servers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/smoke/20-install-hdfs.yaml.j2 b/tests/templates/kuttl/smoke/20-install-hdfs.yaml.j2 index 48fafdc9..1d1b9af6 100644 --- a/tests/templates/kuttl/smoke/20-install-hdfs.yaml.j2 +++ b/tests/templates/kuttl/smoke/20-install-hdfs.yaml.j2 @@ -14,6 +14,7 @@ spec: {% endif %} nameNodes: config: + gracefulShutdownTimeout: 1m listenerClass: {{ test_scenario['values']['listener-class'] }} logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} @@ -22,6 +23,7 @@ spec: replicas: 2 dataNodes: config: + gracefulShutdownTimeout: 1m listenerClass: {{ test_scenario['values']['listener-class'] }} logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} @@ -30,6 +32,7 @@ spec: replicas: 1 journalNodes: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/snapshot-export/11-install-zookeeper.yaml.j2 b/tests/templates/kuttl/snapshot-export/11-install-zookeeper.yaml.j2 index caecd8b8..8917b85a 100644 --- a/tests/templates/kuttl/snapshot-export/11-install-zookeeper.yaml.j2 +++ b/tests/templates/kuttl/snapshot-export/11-install-zookeeper.yaml.j2 @@ -13,6 +13,7 @@ spec: {% endif %} servers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/snapshot-export/12-install-hdfs.yaml.j2 b/tests/templates/kuttl/snapshot-export/12-install-hdfs.yaml.j2 index 0bd3bb65..8a9a4bc0 100644 --- a/tests/templates/kuttl/snapshot-export/12-install-hdfs.yaml.j2 +++ b/tests/templates/kuttl/snapshot-export/12-install-hdfs.yaml.j2 @@ -14,6 +14,7 @@ spec: {% endif %} nameNodes: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -21,6 +22,7 @@ spec: replicas: 2 dataNodes: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -28,6 +30,7 @@ spec: replicas: 1 journalNodes: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/templates/kuttl/snapshot-export/20-install-hbase.yaml.j2 b/tests/templates/kuttl/snapshot-export/20-install-hbase.yaml.j2 index 66529561..bbbd0673 100644 --- a/tests/templates/kuttl/snapshot-export/20-install-hbase.yaml.j2 +++ b/tests/templates/kuttl/snapshot-export/20-install-hbase.yaml.j2 @@ -20,6 +20,7 @@ spec: {% endif %} masters: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -27,6 +28,7 @@ spec: replicas: 1 regionServers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -34,6 +36,7 @@ spec: replicas: 1 restServers: config: + gracefulShutdownTimeout: 1m logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: diff --git a/tests/test-definition.yaml b/tests/test-definition.yaml index 4095c20a..2e8f7525 100644 --- a/tests/test-definition.yaml +++ b/tests/test-definition.yaml @@ -10,13 +10,15 @@ dimensions: # - 2.4.18,docker.stackable.tech/sandbox/hbase:2.4.18-stackable0.0.0-dev - name: hbase-opa values: - - 2.6.0 + # - 2.6.0 # To use a custom image, add a comma and the full name after the product version # - 2.6.0,docker.stackable.tech/sandbox/hbase:2.6.0-stackable0.0.0-dev + - 2.6.0,docker.stackable.tech/razvan/hbase-2.6.0 - name: hbase-latest values: - - 2.6.0 + # - 2.6.0 # - 2.4.18,docker.stackable.tech/sandbox/hbase:2.4.18-stackable0.0.0-dev + - 2.6.0,docker.stackable.tech/razvan/hbase-2.6.0 - name: hdfs values: - 3.3.4 From 7e118ab65529531e68cc4091295d056047be98ca Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Mon, 21 Oct 2024 10:31:29 +0200 Subject: [PATCH 25/51] region mover args --- .../operations/graceful-shutdown.adoc | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) 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 095d2c80..8cb4ec83 100644 --- a/docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc +++ b/docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc @@ -48,6 +48,35 @@ spec: <3>: Enable or disable region confirmation on the present and target servers. Default is `true`. <4>: Extra options to pass to the region mover tool. +For a list of additional options accepted by the region mover use the `--help` option first: + +[source,bash] +---- +$ /stackable/hbase/bin/hbase org.apache.hadoop.hbase.util.RegionMover --help +usage: hbase org.apache.hadoop.hbase.util.RegionMover +Options: + -r,--regionserverhost region server | + -o,--operation Expected: load/unload/unload_from_rack/isolate_regions + -m,--maxthreads Define the maximum number of threads to use to unload and reload the regions + -i,--isolateRegionIds Comma separated list of Region IDs hash to isolate on a RegionServer and put region + server in draining mode. This option should only be used with '-o isolate_regions'. By + putting region server in decommission/draining mode, master can't assign any new region + on this server. If one or more regions are not found OR failed to isolate successfully, + utility will exist without putting RS in draining/decommission mode. Ex. + --isolateRegionIds id1,id2,id3 OR -i id1,id2,id3 + -x,--excludefile File with per line to exclude as unload targets; default excludes only + target host; useful for rack decommisioning. + -d,--designatedfile File with per line as unload targets;default is all online hosts + -f,--filename File to save regions list into unloading, or read from loading; default + /tmp/ + -n,--noack Turn on No-Ack mode(default: false) which won't check if region is online on target + RegionServer, hence best effort. This is more performant in unloading and loading but + might lead to region being unavailable for some time till master reassigns it in case the + move failed + -t,--timeout timeout in seconds after which the tool will exit irrespective of whether it finished or + not;default Integer.MAX_VALUE +---- + NOTE: There is no need to explicitly specify a timeout for the region movement. The operator will compute an appropriate timeout that cannot exceed the `gracefulShutdownTimeout` for region servers. IMPORTANT: The ZooKeeper connection must be available during the time the region mover is running for the graceful shutdown process to succeed. From f9a769b65d78b7658e44579f28a4fdf6a1539446 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Wed, 23 Oct 2024 12:12:57 +0300 Subject: [PATCH 26/51] Update CHANGELOG.md Co-authored-by: Sebastian Bernauer --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fd653fb..cdc62671 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ - Reduce CRD size from `1.4MB` to `96KB` by accepting arbitrary YAML input instead of the underlying schema for the following fields ([#548]): - `podOverrides` - `affinity` -- Optionally move regions to other pods before shutting down a region server ([#570]). +- Support moving regions to other Pods during graceful shutdown of region servers ([#570]). ### Fixed From 420ba3635a9c1a0cdc6c0ad083686fadf738cbc9 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Thu, 24 Oct 2024 17:57:05 +0300 Subject: [PATCH 27/51] Update rust/crd/src/lib.rs Co-authored-by: Siegfried Weber --- rust/crd/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/crd/src/lib.rs b/rust/crd/src/lib.rs index bcaccad1..3988a6c2 100644 --- a/rust/crd/src/lib.rs +++ b/rust/crd/src/lib.rs @@ -1141,7 +1141,7 @@ impl AnyServiceConfig { let timeout = config .graceful_shutdown_timeout .map(|d| { - if d.as_secs() < DEFAULT_REGION_MOVER_DELTA_TO_SHUTDOWN.as_secs() { + if d.as_secs() <= DEFAULT_REGION_MOVER_DELTA_TO_SHUTDOWN.as_secs() { d.as_secs() } else { d.as_secs() - DEFAULT_REGION_MOVER_DELTA_TO_SHUTDOWN.as_secs() From 2b0d63bc8671969c87ee919a083aec3027b594a5 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Thu, 24 Oct 2024 17:57:19 +0300 Subject: [PATCH 28/51] Update rust/crd/src/lib.rs Co-authored-by: Siegfried Weber --- rust/crd/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/crd/src/lib.rs b/rust/crd/src/lib.rs index 3988a6c2..0fa602ee 100644 --- a/rust/crd/src/lib.rs +++ b/rust/crd/src/lib.rs @@ -1128,7 +1128,7 @@ impl AnyServiceConfig { } /// Returns command line arguments to pass on to the region mover tool. - /// The follwing arguments are excluded because they are already part of the + /// The following arguments are excluded because they are already part of the /// hbase-entrypoint.sh script. /// The most important argument, '--regionserverhost' can only be computed on the Pod /// because it contains the pod's hostname. From 5d5d5e91954c66f20841196d3e141af41cdcf467 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Thu, 24 Oct 2024 17:58:08 +0300 Subject: [PATCH 29/51] Update rust/crd/src/lib.rs Co-authored-by: Siegfried Weber --- rust/crd/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/crd/src/lib.rs b/rust/crd/src/lib.rs index 0fa602ee..d8f89c8a 100644 --- a/rust/crd/src/lib.rs +++ b/rust/crd/src/lib.rs @@ -1053,7 +1053,7 @@ impl HbaseCluster { match role { HbaseRole::Master => HBASE_MASTER_PORT, HbaseRole::RegionServer => HBASE_REGIONSERVER_PORT, - _ => HBASE_REST_PORT, + HbaseRole::RestServer => HBASE_REST_PORT, } } From 228ad4fe5fc651b251918fa2db477b331a589cbc Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Thu, 24 Oct 2024 18:00:30 +0300 Subject: [PATCH 30/51] Update docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc Co-authored-by: Siegfried Weber --- .../hbase/pages/usage-guide/operations/graceful-shutdown.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 8cb4ec83..9fa1b47b 100644 --- a/docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc +++ b/docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc @@ -28,7 +28,7 @@ In contrast to the Master servers, they will, however, acknowledge the graceful The operator allows for finer control over the shutdown process of region servers. For each region server pod, the region mover tool may be invoked before terminating the region server's pod. -The affected regions are transferred to other pods thus ensuring that the data is not lost. +The affected regions are transferred to other pods thus ensuring that the data is still available. Here is a an example: From 039c22a27010c7159e2ddf44007380764974bcd4 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Thu, 24 Oct 2024 18:00:45 +0300 Subject: [PATCH 31/51] Update docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc Co-authored-by: Siegfried Weber --- .../hbase/pages/usage-guide/operations/graceful-shutdown.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 9fa1b47b..c94ed5c8 100644 --- a/docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc +++ b/docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc @@ -30,7 +30,7 @@ The operator allows for finer control over the shutdown process of region server For each region server pod, the region mover tool may be invoked before terminating the region server's pod. The affected regions are transferred to other pods thus ensuring that the data is still available. -Here is a an example: +Here is an example: [source,yaml] ---- From 60b9dc841e2f95f97a9b719ca002d460a8bf8f64 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Thu, 24 Oct 2024 18:00:59 +0300 Subject: [PATCH 32/51] Update docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc Co-authored-by: Siegfried Weber --- .../hbase/pages/usage-guide/operations/graceful-shutdown.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 c94ed5c8..22608acb 100644 --- a/docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc +++ b/docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc @@ -37,7 +37,7 @@ Here is an example: spec: regionServers: config: - regionMover + regionMover: runBeforeShutdown: true # <1> maxThreads: 5 # <2> ack: false # <3> From fd8331e0d844d9847cc4b67388d8d0ac2dec889d Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Thu, 24 Oct 2024 18:01:36 +0300 Subject: [PATCH 33/51] Update docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc Co-authored-by: Siegfried Weber --- .../hbase/pages/usage-guide/operations/graceful-shutdown.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 22608acb..d9c2b9c2 100644 --- a/docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc +++ b/docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc @@ -50,7 +50,7 @@ spec: For a list of additional options accepted by the region mover use the `--help` option first: -[source,bash] +[source] ---- $ /stackable/hbase/bin/hbase org.apache.hadoop.hbase.util.RegionMover --help usage: hbase org.apache.hadoop.hbase.util.RegionMover From 5378f11ea515e7631bcb1b0cd68deeedeffff8f3 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Thu, 24 Oct 2024 18:23:38 +0300 Subject: [PATCH 34/51] Update rust/crd/src/lib.rs Co-authored-by: Siegfried Weber --- rust/crd/src/lib.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/rust/crd/src/lib.rs b/rust/crd/src/lib.rs index d8f89c8a..d168c32a 100644 --- a/rust/crd/src/lib.rs +++ b/rust/crd/src/lib.rs @@ -95,9 +95,6 @@ static DEFAULT_REGION_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT: LazyLock = #[derive(Snafu, Debug)] pub enum Error { - #[snafu(display("expected role [{expected}] but got role [{got}]"))] - ExpectedRole { expected: String, got: String }, - #[snafu(display("the role [{role}] is invalid and does not exist in HBase"))] InvalidRole { source: strum::ParseError, From 6f087dbc584f3ef7a95c107c93ecc7fb8144f225 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Fri, 25 Oct 2024 12:36:32 +0200 Subject: [PATCH 35/51] note on constant paths and the entrypoint script --- rust/crd/src/lib.rs | 2 ++ rust/operator-binary/src/hbase_controller.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/rust/crd/src/lib.rs b/rust/crd/src/lib.rs index d168c32a..76d1cf0f 100644 --- a/rust/crd/src/lib.rs +++ b/rust/crd/src/lib.rs @@ -40,6 +40,8 @@ pub mod security; pub const APP_NAME: &str = "hbase"; +// This constant is hard coded in hbase-entrypoint.sh +// You need to change it there too. pub const CONFIG_DIR_NAME: &str = "/stackable/conf"; pub const TLS_STORE_DIR: &str = "/stackable/tls"; diff --git a/rust/operator-binary/src/hbase_controller.rs b/rust/operator-binary/src/hbase_controller.rs index d9c6e565..6c051f08 100644 --- a/rust/operator-binary/src/hbase_controller.rs +++ b/rust/operator-binary/src/hbase_controller.rs @@ -89,6 +89,8 @@ pub const MAX_HBASE_LOG_FILES_SIZE: MemoryQuantity = MemoryQuantity { unit: BinaryMultiple::Mebi, }; +// These constants are hard coded in hbase-entrypoint.sh +// You need to change them there too. const HDFS_DISCOVERY_TMP_DIR: &str = "/stackable/tmp/hdfs"; const HBASE_CONFIG_TMP_DIR: &str = "/stackable/tmp/hbase"; const HBASE_LOG_CONFIG_TMP_DIR: &str = "/stackable/tmp/log_config"; From 0f32e59e386a515379240cdf142ed36c4bbea122 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Fri, 25 Oct 2024 12:55:23 +0200 Subject: [PATCH 36/51] remove unnecessary configOverrides --- .../kuttl/shutdown/30-install-hbase.yaml.j2 | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/tests/templates/kuttl/shutdown/30-install-hbase.yaml.j2 b/tests/templates/kuttl/shutdown/30-install-hbase.yaml.j2 index 2bfb30d3..fd580ebc 100644 --- a/tests/templates/kuttl/shutdown/30-install-hbase.yaml.j2 +++ b/tests/templates/kuttl/shutdown/30-install-hbase.yaml.j2 @@ -26,10 +26,6 @@ spec: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: default: - configOverrides: - hbase-site.xml: - phoenix.log.saltBuckets: "2" - hbase.regionserver.wal.codec: "org.apache.hadoop.hbase.regionserver.wal.IndexedWALEditCodec" replicas: 2 regionServers: config: @@ -42,10 +38,6 @@ spec: maxThreads: 1 roleGroups: default: - configOverrides: - hbase-site.xml: - phoenix.log.saltBuckets: "2" - hbase.regionserver.wal.codec: "org.apache.hadoop.hbase.regionserver.wal.IndexedWALEditCodec" replicas: 2 restServers: config: @@ -54,8 +46,4 @@ spec: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: default: - configOverrides: - hbase-site.xml: - phoenix.log.saltBuckets: "2" - hbase.regionserver.wal.codec: "org.apache.hadoop.hbase.regionserver.wal.IndexedWALEditCodec" replicas: 2 From 109e87765a5af3c9cd68944a390d5833a1e2fbe0 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Fri, 25 Oct 2024 17:15:52 +0200 Subject: [PATCH 37/51] wip: use Fragment for the RegionMover The crd generation panics --- rust/crd/src/lib.rs | 73 +++++++++++++++++++++++++++------------------ 1 file changed, 44 insertions(+), 29 deletions(-) diff --git a/rust/crd/src/lib.rs b/rust/crd/src/lib.rs index 76d1cf0f..44b9c07b 100644 --- a/rust/crd/src/lib.rs +++ b/rust/crd/src/lib.rs @@ -106,9 +106,6 @@ pub enum Error { #[snafu(display("the HBase role [{role}] is missing from spec"))] MissingHbaseRole { role: String }, - #[snafu(display("the HBase role group [{role_group}] is missing from spec"))] - MissingHbaseRoleGroup { role_group: String }, - #[snafu(display("fragment validation failure"))] FragmentValidationFailure { source: ValidationError }, @@ -315,7 +312,7 @@ fn default_regionserver_config( hdfs_discovery_cm_name, ), graceful_shutdown_timeout: Some(*DEFAULT_REGION_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT), - region_mover: Some(RegionMover::default()), + region_mover: RegionMoverFragment::default(), } } @@ -512,44 +509,56 @@ impl Configuration for HbaseConfigFragment { } } -#[derive(Clone, Debug, JsonSchema, PartialEq, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] +#[derive(Fragment, Clone, Debug, JsonSchema, PartialEq, Serialize, Deserialize)] +#[fragment_attrs( + derive( + Clone, + Debug, + Default, + Deserialize, + Merge, + JsonSchema, + PartialEq, + Serialize + ), + serde(rename_all = "camelCase") +)] pub struct RegionMover { /// Move local regions to other servers before terminating a region server's pod. - run_before_shutdown: bool, + run_before_shutdown: Option, /// Maximum number of threads to use for moving regions. - max_threads: u16, + max_threads: Option, /// 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. - ack: bool, + ack: Option, /// Additional options to pass to the region mover. #[serde(default)] - extra_opts: Vec, + extra_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, } +impl Atomic for RegionMoverExtraCliOpts {} + impl Default for RegionMover { fn default() -> Self { Self { - run_before_shutdown: false, - max_threads: 1, - ack: true, - extra_opts: vec![], + run_before_shutdown: Some(false), + max_threads: Some(1), + ack: Some(true), + extra_opts: None, } } } -impl Atomic for RegionMover {} - -impl Merge for RegionMover { - fn merge(&mut self, other: &Self) { - self.run_before_shutdown = other.run_before_shutdown; - self.max_threads = other.max_threads; - self.ack = other.ack; - self.extra_opts.extend(other.extra_opts.clone()); - } -} #[derive(Clone, Debug, Default, Fragment, JsonSchema, PartialEq)] #[fragment_attrs( @@ -1136,7 +1145,8 @@ impl AnyServiceConfig { pub fn region_mover_args(&self) -> String { match self { AnyServiceConfig::RegionServer(config) => { - if config.region_mover.run_before_shutdown { + // TODO: is unwrap_or() the correct way to do it ? (same below) + if config.region_mover.run_before_shutdown.unwrap_or(false) { let timeout = config .graceful_shutdown_timeout .map(|d| { @@ -1149,11 +1159,11 @@ impl AnyServiceConfig { .unwrap_or(DEFAULT_REGION_MOVER_TIMEOUT.as_secs()); let mut command = vec![ "--maxthreads".to_string(), - config.region_mover.max_threads.to_string(), + config.region_mover.max_threads.unwrap_or(1).to_string(), "--timeout".to_string(), timeout.to_string(), ]; - if !config.region_mover.ack { + if !config.region_mover.ack.unwrap_or(true) { command.push("--noack".to_string()); } @@ -1162,7 +1172,8 @@ impl AnyServiceConfig { .region_mover .extra_opts .iter() - .map(|s| escape(std::borrow::Cow::Borrowed(s)).to_string()), + .flat_map(|o| o.cli_opts.clone()) + .map(|s| escape(std::borrow::Cow::Borrowed(&s)).to_string()), ); command.join(" ") } else { @@ -1175,7 +1186,9 @@ impl AnyServiceConfig { pub fn run_region_mover(&self) -> bool { match self { - AnyServiceConfig::RegionServer(config) => config.region_mover.run_before_shutdown, + AnyServiceConfig::RegionServer(config) => { + config.region_mover.run_before_shutdown.unwrap_or(false) + } _ => false, } } @@ -1225,6 +1238,8 @@ spec: config: logging: enableVectorAgent: False + regionMover: + runBeforeShutdown: false roleGroups: default: replicas: 1 From 05f43037c3c5a00a900d57622eded1dc8dae32b0 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Fri, 25 Oct 2024 21:01:27 +0200 Subject: [PATCH 38/51] fix crd generation --- deploy/helm/hbase-operator/crds/crds.yaml | 28 +++++++++++-------- .../operations/graceful-shutdown.adoc | 2 +- rust/crd/src/lib.rs | 17 +++++------ 3 files changed, 26 insertions(+), 21 deletions(-) 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(" ") From 19fed55e414a207e8b72b89ee58d4ef42f2b2231 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Mon, 28 Oct 2024 08:58:17 +0100 Subject: [PATCH 39/51] test: fail if the regionmover fails (only with 2.6) --- tests/templates/kuttl/shutdown/30-install-hbase.yaml.j2 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/templates/kuttl/shutdown/30-install-hbase.yaml.j2 b/tests/templates/kuttl/shutdown/30-install-hbase.yaml.j2 index fd580ebc..0e721643 100644 --- a/tests/templates/kuttl/shutdown/30-install-hbase.yaml.j2 +++ b/tests/templates/kuttl/shutdown/30-install-hbase.yaml.j2 @@ -27,6 +27,14 @@ spec: roleGroups: default: replicas: 2 + configOverrides: + hbase-site.xml: + # Prevent the master from re-assigning the region when the region server is + # gone. Otherwise, the test case would not fail if the region mover fails. The + # default retainment wait period is larger than the test step timeout. This + # works only for HBase 2.6 (https://issues.apache.org/jira/browse/HBASE-27551). + hbase.master.scp.retain.assignment: "true" + hbase.master.scp.retain.assignment.force: "true" regionServers: config: gracefulShutdownTimeout: 2m # one minute for the region mover From 8a8d26a0f4941cf1d910115e9315fe467254f2c9 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Mon, 28 Oct 2024 14:09:02 +0100 Subject: [PATCH 40/51] refactor to reduce (some) duplication --- rust/crd/src/lib.rs | 349 +++++++++++++++++++++----------------------- 1 file changed, 170 insertions(+), 179 deletions(-) diff --git a/rust/crd/src/lib.rs b/rust/crd/src/lib.rs index b1614cd3..493aa964 100644 --- a/rust/crd/src/lib.rs +++ b/rust/crd/src/lib.rs @@ -114,6 +114,9 @@ pub enum Error { #[snafu(display("object defines no regionserver role"))] NoRegionServerRole, + + #[snafu(display("incompatible merge types"))] + IncompatibleMergeTypes, } /// An HBase cluster stacklet. This resource is managed by the Stackable operator for Apache HBase. @@ -285,80 +288,106 @@ impl HbaseRole { } } -fn default_regionserver_config( - cluster_name: &str, - hdfs_discovery_cm_name: &str, -) -> RegionServerConfigFragment { - let resources = ResourcesFragment { - cpu: CpuLimitsFragment { - min: Some(Quantity("250m".to_owned())), - max: Some(Quantity("1".to_owned())), +fn default_resources(role: &HbaseRole) -> ResourcesFragment { + match role { + HbaseRole::RegionServer => ResourcesFragment { + cpu: CpuLimitsFragment { + min: Some(Quantity("250m".to_owned())), + max: Some(Quantity("1".to_owned())), + }, + memory: MemoryLimitsFragment { + limit: Some(Quantity("1Gi".to_owned())), + runtime_limits: NoRuntimeLimitsFragment {}, + }, + storage: HbaseStorageConfigFragment {}, }, - memory: MemoryLimitsFragment { - limit: Some(Quantity("1Gi".to_owned())), - runtime_limits: NoRuntimeLimitsFragment {}, + HbaseRole::RestServer => ResourcesFragment { + cpu: CpuLimitsFragment { + min: Some(Quantity("100m".to_owned())), + max: Some(Quantity("400m".to_owned())), + }, + memory: MemoryLimitsFragment { + limit: Some(Quantity("512Mi".to_owned())), + runtime_limits: NoRuntimeLimitsFragment {}, + }, + storage: HbaseStorageConfigFragment {}, + }, + HbaseRole::Master => ResourcesFragment { + cpu: CpuLimitsFragment { + min: Some(Quantity("250m".to_owned())), + max: Some(Quantity("1".to_owned())), + }, + memory: MemoryLimitsFragment { + limit: Some(Quantity("1Gi".to_owned())), + runtime_limits: NoRuntimeLimitsFragment {}, + }, + storage: HbaseStorageConfigFragment {}, }, - storage: HbaseStorageConfigFragment {}, - }; - - RegionServerConfigFragment { - hbase_rootdir: None, - hbase_opts: None, - resources, - logging: product_logging::spec::default_logging(), - affinity: get_affinity( - cluster_name, - &HbaseRole::RegionServer, - hdfs_discovery_cm_name, - ), - graceful_shutdown_timeout: Some(*DEFAULT_REGION_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT), - region_mover: RegionMoverFragment::default(), } } -fn default_rest_config(cluster_name: &str, hdfs_discovery_cm_name: &str) -> HbaseConfigFragment { - let resources = ResourcesFragment { - cpu: CpuLimitsFragment { - min: Some(Quantity("100m".to_owned())), - max: Some(Quantity("400m".to_owned())), - }, - memory: MemoryLimitsFragment { - limit: Some(Quantity("512Mi".to_owned())), - runtime_limits: NoRuntimeLimitsFragment {}, - }, - storage: HbaseStorageConfigFragment {}, - }; - - HbaseConfigFragment { - hbase_rootdir: None, - hbase_opts: None, - resources, - logging: product_logging::spec::default_logging(), - affinity: get_affinity(cluster_name, &HbaseRole::RestServer, hdfs_discovery_cm_name), - graceful_shutdown_timeout: Some(DEFAULT_REST_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT), - } +#[derive(Debug, Clone)] +enum AnyConfigFragment { + RegionServer(RegionServerConfigFragment), + RestServer(HbaseConfigFragment), + Master(HbaseConfigFragment), } -fn default_master_config(cluster_name: &str, hdfs_discovery_cm_name: &str) -> HbaseConfigFragment { - let resources = ResourcesFragment { - cpu: CpuLimitsFragment { - min: Some(Quantity("250m".to_owned())), - max: Some(Quantity("1".to_owned())), - }, - memory: MemoryLimitsFragment { - limit: Some(Quantity("1Gi".to_owned())), - runtime_limits: NoRuntimeLimitsFragment {}, - }, - storage: HbaseStorageConfigFragment {}, - }; +impl AnyConfigFragment { + fn merge(self, other: &AnyConfigFragment) -> Result { + match (self, other) { + (AnyConfigFragment::RegionServer(mut me), AnyConfigFragment::RegionServer(you)) => { + me.merge(you); + Ok(AnyConfigFragment::RegionServer(me.clone())) + } + (AnyConfigFragment::RestServer(mut me), AnyConfigFragment::RestServer(you)) => { + me.merge(you); + Ok(AnyConfigFragment::RestServer(me.clone())) + } + (AnyConfigFragment::Master(mut me), AnyConfigFragment::Master(you)) => { + me.merge(you); + Ok(AnyConfigFragment::Master(me.clone())) + } + (_, _) => Err(Error::IncompatibleMergeTypes), + } + } - HbaseConfigFragment { - hbase_rootdir: None, - hbase_opts: None, - resources, - logging: product_logging::spec::default_logging(), - affinity: get_affinity(cluster_name, &HbaseRole::Master, hdfs_discovery_cm_name), - graceful_shutdown_timeout: Some(DEFAULT_MASTER_GRACEFUL_SHUTDOWN_TIMEOUT), + fn default_for( + role: &HbaseRole, + cluster_name: &str, + hdfs_discovery_cm_name: &str, + ) -> AnyConfigFragment { + match role { + HbaseRole::RegionServer => { + AnyConfigFragment::RegionServer(RegionServerConfigFragment { + hbase_rootdir: None, + hbase_opts: None, + resources: default_resources(role), + logging: product_logging::spec::default_logging(), + affinity: get_affinity(cluster_name, role, hdfs_discovery_cm_name), + graceful_shutdown_timeout: Some( + *DEFAULT_REGION_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT, + ), + region_mover: RegionMoverFragment::default(), + }) + } + HbaseRole::RestServer => AnyConfigFragment::RestServer(HbaseConfigFragment { + hbase_rootdir: None, + hbase_opts: None, + resources: default_resources(role), + logging: product_logging::spec::default_logging(), + affinity: get_affinity(cluster_name, role, hdfs_discovery_cm_name), + graceful_shutdown_timeout: Some(DEFAULT_REST_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT), + }), + HbaseRole::Master => AnyConfigFragment::Master(HbaseConfigFragment { + hbase_rootdir: None, + hbase_opts: None, + resources: default_resources(role), + logging: product_logging::spec::default_logging(), + affinity: get_affinity(cluster_name, role, hdfs_discovery_cm_name), + graceful_shutdown_timeout: Some(DEFAULT_MASTER_GRACEFUL_SHUTDOWN_TIMEOUT), + }), + } } } @@ -702,136 +731,98 @@ impl HbaseCluster { role_group: &str, hdfs_discovery_cm_name: &str, ) -> Result { - match role { - HbaseRole::Master => { - let config = self.merged_master_config(role_group, hdfs_discovery_cm_name)?; - Ok(AnyServiceConfig::Master(config)) - } - HbaseRole::RegionServer => { - let config = self.merged_regionserver_config(role_group, hdfs_discovery_cm_name)?; - Ok(AnyServiceConfig::RegionServer(config)) - } - HbaseRole::RestServer => { - let config = self.merged_rest_config(role_group, hdfs_discovery_cm_name)?; - Ok(AnyServiceConfig::RestServer(config)) - } - } - } - - fn merged_regionserver_config( - &self, - role_group: &str, - hdfs_discovery_cm_name: &str, - ) -> Result { - let role = HbaseRole::RegionServer; - // Initialize the result with all default values as baseline - let conf_defaults = default_regionserver_config(&self.name_any(), hdfs_discovery_cm_name); - - let role = self - .spec - .region_servers - .clone() - .context(MissingHbaseRoleSnafu { - role: role.to_string(), - })?; - - // Retrieve role resource config - let mut conf_role = role.config.config.to_owned(); - - // Retrieve rolegroup specific resource config - let mut conf_rolegroup = role - .role_groups - .get(role_group) - .map(|rg| rg.config.config.clone()) - .unwrap_or_default(); - - // Merge more specific configs into default config - // Hierarchy is: - // 1. RoleGroup - // 2. Role - // 3. Default - conf_role.merge(&conf_defaults); - conf_rolegroup.merge(&conf_role); + let defaults = + AnyConfigFragment::default_for(role, &self.name_any(), hdfs_discovery_cm_name); - tracing::debug!("Merged config: {:?}", conf_rolegroup); - fragment::validate(conf_rolegroup).context(FragmentValidationFailureSnafu) - } - - fn merged_rest_config( - &self, - role_group: &str, - hdfs_discovery_cm_name: &str, - ) -> Result { - let role = HbaseRole::RestServer; + let (mut role_config, mut role_group_config) = match role { + HbaseRole::RegionServer => { + let role = self + .spec + .region_servers + .clone() + .context(MissingHbaseRoleSnafu { + role: role.to_string(), + })?; - // Initialize the result with all default values as baseline - let conf_defaults = default_rest_config(&self.name_any(), hdfs_discovery_cm_name); - - let role = self - .spec - .rest_servers - .clone() - .context(MissingHbaseRoleSnafu { - role: role.to_string(), - })?; - - // Retrieve role resource config - let mut conf_role = role.config.config.to_owned(); - - // Retrieve rolegroup specific resource config - let mut conf_rolegroup = role - .role_groups - .get(role_group) - .map(|rg| rg.config.config.clone()) - .unwrap_or_default(); + let role_config = role.config.config.to_owned(); + let role_group_config = role + .role_groups + .get(role_group) + .map(|rg| rg.config.config.clone()) + .unwrap_or_default(); - // Merge more specific configs into default config - // Hierarchy is: - // 1. RoleGroup - // 2. Role - // 3. Default - conf_role.merge(&conf_defaults); - conf_rolegroup.merge(&conf_role); + ( + AnyConfigFragment::RegionServer(role_config), + AnyConfigFragment::RegionServer(role_group_config), + ) + } + HbaseRole::RestServer => { + let role = self + .spec + .rest_servers + .clone() + .context(MissingHbaseRoleSnafu { + role: role.to_string(), + })?; - tracing::debug!("Merged config: {:?}", conf_rolegroup); - fragment::validate(conf_rolegroup).context(FragmentValidationFailureSnafu) - } + let role_config = role.config.config.to_owned(); - fn merged_master_config( - &self, - role_group: &str, - hdfs_discovery_cm_name: &str, - ) -> Result { - let role = HbaseRole::Master; + let role_group_config = role + .role_groups + .get(role_group) + .map(|rg| rg.config.config.clone()) + .unwrap_or_default(); - // Initialize the result with all default values as baseline - let conf_defaults = default_master_config(&self.name_any(), hdfs_discovery_cm_name); + // Retrieve role resource config + ( + AnyConfigFragment::RestServer(role_config), + AnyConfigFragment::RestServer(role_group_config), + ) + } + HbaseRole::Master => { + let role = self.spec.masters.clone().context(MissingHbaseRoleSnafu { + role: role.to_string(), + })?; - let role = self.spec.masters.clone().context(MissingHbaseRoleSnafu { - role: role.to_string(), - })?; + let role_config = role.config.config.to_owned(); - // Retrieve role resource config - let mut conf_role = role.config.config.to_owned(); + // Retrieve rolegroup specific resource config + let role_group_config = role + .role_groups + .get(role_group) + .map(|rg| rg.config.config.clone()) + .unwrap_or_default(); - // Retrieve rolegroup specific resource config - let mut conf_rolegroup = role - .role_groups - .get(role_group) - .map(|rg| rg.config.config.clone()) - .unwrap_or_default(); + // Retrieve role resource config + ( + AnyConfigFragment::Master(role_config), + AnyConfigFragment::Master(role_group_config), + ) + } + }; // Merge more specific configs into default config // Hierarchy is: // 1. RoleGroup // 2. Role // 3. Default - conf_role.merge(&conf_defaults); - conf_rolegroup.merge(&conf_role); + role_config = role_config.merge(&defaults)?; + role_group_config = role_group_config.merge(&role_config)?; - tracing::debug!("Merged config: {:?}", conf_rolegroup); - fragment::validate(conf_rolegroup).context(FragmentValidationFailureSnafu) + tracing::debug!("Merged config: {:?}", role_group_config); + + Ok(match role_group_config { + AnyConfigFragment::RegionServer(conf) => AnyServiceConfig::RegionServer( + fragment::validate(conf).context(FragmentValidationFailureSnafu)?, + ), + AnyConfigFragment::RestServer(conf) => AnyServiceConfig::RestServer( + fragment::validate(conf).context(FragmentValidationFailureSnafu)?, + ), + AnyConfigFragment::Master(conf) => AnyServiceConfig::Master( + fragment::validate(conf).context(FragmentValidationFailureSnafu)?, + ), + }) } // The result type is only defined once, there is no value in extracting it into a type definition. From e0aaa2746ec1a2bc720571b270b60c6f75aa9918 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Mon, 28 Oct 2024 14:17:40 +0100 Subject: [PATCH 41/51] tests: use dev images --- tests/test-definition.yaml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/test-definition.yaml b/tests/test-definition.yaml index 2e8f7525..1e681f79 100644 --- a/tests/test-definition.yaml +++ b/tests/test-definition.yaml @@ -2,23 +2,19 @@ dimensions: - name: hbase values: - # - 2.6.0 - # - 2.4.18 + - 2.6.0 + - 2.4.18 # To use a custom image, add a comma and the full name after the product version - - 2.6.0,docker.stackable.tech/razvan/hbase-2.6.0 - - 2.4.18,docker.stackable.tech/razvan/hbase-2.4.18 # - 2.4.18,docker.stackable.tech/sandbox/hbase:2.4.18-stackable0.0.0-dev - name: hbase-opa values: - # - 2.6.0 + - 2.6.0 # To use a custom image, add a comma and the full name after the product version # - 2.6.0,docker.stackable.tech/sandbox/hbase:2.6.0-stackable0.0.0-dev - - 2.6.0,docker.stackable.tech/razvan/hbase-2.6.0 - name: hbase-latest values: - # - 2.6.0 + - 2.6.0 # - 2.4.18,docker.stackable.tech/sandbox/hbase:2.4.18-stackable0.0.0-dev - - 2.6.0,docker.stackable.tech/razvan/hbase-2.6.0 - name: hdfs values: - 3.3.4 From eb52267426011901fa456a906c7491138947f0aa Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Tue, 29 Oct 2024 10:33:27 +0100 Subject: [PATCH 42/51] feat: remove hard-coded cluster.local from the domain name --- rust/operator-binary/src/hbase_controller.rs | 34 ++++++++++++++------ 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/rust/operator-binary/src/hbase_controller.rs b/rust/operator-binary/src/hbase_controller.rs index 6c051f08..39719270 100644 --- a/rust/operator-binary/src/hbase_controller.rs +++ b/rust/operator-binary/src/hbase_controller.rs @@ -438,6 +438,7 @@ pub async fn reconcile_hbase( )?; let rg_statefulset = build_rolegroup_statefulset( hbase, + &client.kubernetes_cluster_info, &hbase_role, &rolegroup, rolegroup_config, @@ -764,6 +765,7 @@ fn build_rolegroup_service( /// The [`Pod`](`stackable_operator::k8s_openapi::api::core::v1::Pod`)s are accessible through the corresponding [`Service`] (from [`build_rolegroup_service`]). fn build_rolegroup_statefulset( hbase: &HbaseCluster, + cluster_info: &KubernetesClusterInfo, hbase_role: &HbaseRole, rolegroup_ref: &RoleGroupRef, rolegroup_config: &HashMap>, @@ -858,15 +860,7 @@ fn build_rolegroup_statefulset( .command(vec!["/stackable/hbase/bin/hbase-entrypoint.sh".to_string()]) .args(vec![ hbase_role.cli_role_name(), - format!( - "{}.{}.svc.cluster.local", - rolegroup_ref.object_name(), - hbase - .metadata - .namespace - .clone() - .context(ObjectHasNoNamespaceSnafu)? - ), + hbase_service_domain_name(hbase, rolegroup_ref, cluster_info)?, hbase.service_port(hbase_role).to_string(), ]) .add_env_vars(merged_env) @@ -1159,6 +1153,28 @@ fn validate_cr(hbase: &HbaseCluster) -> Result<()> { Ok(()) } +/// Build the domain name of an HBase service pod. +/// The hbase-entrypoint.sh script uses this to build the fully qualified name of a pod +/// by appending it to the `HOSTNAME` environment variable. +/// This name is required by the RegionMover to function properly. +fn hbase_service_domain_name( + hbase: &HbaseCluster, + rolegroup_ref: &RoleGroupRef, + cluster_info: &KubernetesClusterInfo, +) -> Result { + let hbase_cluster_name = rolegroup_ref.object_name(); + let pod_namespace = hbase + .metadata + .namespace + .clone() + .context(ObjectHasNoNamespaceSnafu)?; + let cluster_domain = &cluster_info.cluster_domain; + + Ok(format!( + "{hbase_cluster_name}.{pod_namespace}.svc.{cluster_domain}" + )) +} + #[cfg(test)] mod test { use rstest::rstest; From d6d5fe4c2452ab003c1eb79ff3808e6929cbf75e Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Wed, 30 Oct 2024 12:35:07 +0100 Subject: [PATCH 43/51] fix: RegionMover fields should not be Optional --- rust/crd/src/lib.rs | 116 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 90 insertions(+), 26 deletions(-) diff --git a/rust/crd/src/lib.rs b/rust/crd/src/lib.rs index 493aa964..77eef1d2 100644 --- a/rust/crd/src/lib.rs +++ b/rust/crd/src/lib.rs @@ -368,7 +368,12 @@ impl AnyConfigFragment { graceful_shutdown_timeout: Some( *DEFAULT_REGION_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT, ), - region_mover: RegionMoverFragment::default(), + region_mover: RegionMoverFragment { + run_before_shutdown: Some(false), + max_threads: Some(1), + ack: Some(true), + cli_opts: None, + }, }) } HbaseRole::RestServer => AnyConfigFragment::RestServer(HbaseConfigFragment { @@ -554,14 +559,14 @@ impl Configuration for HbaseConfigFragment { )] pub struct RegionMover { /// Move local regions to other servers before terminating a region server's pod. - run_before_shutdown: Option, + run_before_shutdown: bool, /// Maximum number of threads to use for moving regions. - max_threads: Option, + max_threads: u16, /// 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. - ack: Option, + ack: bool, #[fragment_attrs(serde(flatten))] cli_opts: Option, @@ -578,18 +583,7 @@ pub struct RegionMoverExtraCliOpts { impl Atomic for RegionMoverExtraCliOpts {} -impl Default for RegionMover { - fn default() -> Self { - Self { - run_before_shutdown: Some(false), - max_threads: Some(1), - ack: Some(true), - cli_opts: None, - } - } -} - -#[derive(Clone, Debug, Default, Fragment, JsonSchema, PartialEq)] +#[derive(Clone, Debug, Fragment, JsonSchema, PartialEq)] #[fragment_attrs( derive( Clone, @@ -637,8 +631,6 @@ impl Configuration for RegionServerConfigFragment { _role_name: &str, ) -> Result>, stackable_operator::product_config_utils::Error> { - // Maps env var name to env var object. This allows env_overrides to work - // as expected (i.e. users can override the env var value). let mut vars: BTreeMap> = BTreeMap::new(); vars.insert( @@ -1137,8 +1129,7 @@ impl AnyServiceConfig { pub fn region_mover_args(&self) -> String { match self { AnyServiceConfig::RegionServer(config) => { - // TODO: is unwrap_or() the correct way to do it ? (same below) - if config.region_mover.run_before_shutdown.unwrap_or(false) { + if config.region_mover.run_before_shutdown { let timeout = config .graceful_shutdown_timeout .map(|d| { @@ -1151,11 +1142,11 @@ impl AnyServiceConfig { .unwrap_or(DEFAULT_REGION_MOVER_TIMEOUT.as_secs()); let mut command = vec![ "--maxthreads".to_string(), - config.region_mover.max_threads.unwrap_or(1).to_string(), + config.region_mover.max_threads.to_string(), "--timeout".to_string(), timeout.to_string(), ]; - if !config.region_mover.ack.unwrap_or(true) { + if !config.region_mover.ack { command.push("--noack".to_string()); } @@ -1178,9 +1169,7 @@ impl AnyServiceConfig { pub fn run_region_mover(&self) -> bool { match self { - AnyServiceConfig::RegionServer(config) => { - config.region_mover.run_before_shutdown.unwrap_or(false) - } + AnyServiceConfig::RegionServer(config) => config.region_mover.run_before_shutdown, _ => false, } } @@ -1188,6 +1177,8 @@ impl AnyServiceConfig { #[cfg(test)] mod tests { + use rstest::rstest; + use std::collections::{BTreeMap, HashMap}; use indoc::indoc; @@ -1195,7 +1186,7 @@ mod tests { transform_all_roles_to_config, validate_all_roles_and_groups_config, }; - use crate::{merged_env, HbaseCluster, HbaseRole}; + use crate::{merged_env, AnyServiceConfig, HbaseCluster, HbaseRole, RegionMoverExtraCliOpts}; use product_config::{types::PropertyNameKind, ProductConfigManager}; @@ -1292,4 +1283,77 @@ spec: env_map.get("TEST_VAR_FROM_MRG") ); } + + #[rstest] + #[case("default", false, 1, vec![])] + #[case("groupRegionMover", true, 5, vec!["--some".to_string(), "extra".to_string()])] + pub fn test_region_mover_merge( + #[case] role_group_name: &str, + #[case] run_before_shutdown: bool, + #[case] max_threads: u16, + #[case] additional_mover_options: Vec, + ) { + let input = indoc! {r#" +--- +apiVersion: hbase.stackable.tech/v1alpha1 +kind: HbaseCluster +metadata: + name: test-hbase +spec: + image: + productVersion: 2.4.18 + clusterConfig: + hdfsConfigMapName: test-hdfs + zookeeperConfigMapName: test-znode + masters: + roleGroups: + default: + replicas: 1 + restServers: + roleGroups: + default: + replicas: 1 + regionServers: + config: + regionMover: + runBeforeShutdown: False + roleGroups: + default: + replicas: 1 + groupRegionMover: + replicas: 1 + config: + regionMover: + runBeforeShutdown: True + maxThreads: 5 + additionalMoverOptions: ["--some", "extra"] + "#}; + + let deserializer = serde_yaml::Deserializer::from_str(input); + let hbase: HbaseCluster = + serde_yaml::with::singleton_map_recursive::deserialize(deserializer).unwrap(); + + let hbase_role = HbaseRole::RegionServer; + let rolegroup = hbase.server_rolegroup_ref(hbase_role.to_string(), role_group_name); + + let merged_config = hbase + .merged_config( + &hbase_role, + &rolegroup.role_group, + &hbase.spec.cluster_config.hdfs_config_map_name, + ) + .unwrap(); + if let AnyServiceConfig::RegionServer(config) = merged_config { + assert_eq!(run_before_shutdown, config.region_mover.run_before_shutdown); + assert_eq!(max_threads, config.region_mover.max_threads); + assert_eq!( + Some(RegionMoverExtraCliOpts { + additional_mover_options + }), + config.region_mover.cli_opts + ); + } else { + panic!("this shouldn't happen"); + }; + } } From cb76f4ec15b8379cf626e2c2f1d6dafe5b5c75ec Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Wed, 15 Jan 2025 18:15:43 +0100 Subject: [PATCH 44/51] add STACKABLE_LOG_DIR env var --- rust/operator-binary/src/hbase_controller.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rust/operator-binary/src/hbase_controller.rs b/rust/operator-binary/src/hbase_controller.rs index 3adaa668..a4dc201f 100644 --- a/rust/operator-binary/src/hbase_controller.rs +++ b/rust/operator-binary/src/hbase_controller.rs @@ -858,6 +858,11 @@ fn build_rolegroup_statefulset( value: Some(merged_config.run_region_mover().to_string()), ..EnvVar::default() }, + EnvVar { + name: "STACKABLE_LOG_DIR".to_string(), + value: Some(STACKABLE_LOG_DIR.to_string()), + ..EnvVar::default() + }, ]); let mut hbase_container = ContainerBuilder::new("hbase").expect("ContainerBuilder not created"); From e86b446e8d15c4a82a31e270b177c8da561ab6f3 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Fri, 17 Jan 2025 12:12:15 +0100 Subject: [PATCH 45/51] ref introduce const CONTAINERDEBUG_LOG_DIRECTORY --- rust/operator-binary/src/hbase_controller.rs | 4 ++-- rust/operator-binary/src/product_logging.rs | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/rust/operator-binary/src/hbase_controller.rs b/rust/operator-binary/src/hbase_controller.rs index a4dc201f..84d99b63 100644 --- a/rust/operator-binary/src/hbase_controller.rs +++ b/rust/operator-binary/src/hbase_controller.rs @@ -68,7 +68,7 @@ use stackable_hbase_crd::{ METRICS_PORT, SSL_CLIENT_XML, SSL_SERVER_XML, }; -use crate::product_logging::STACKABLE_LOG_DIR; +use crate::product_logging::{CONTAINERDEBUG_LOG_DIRECTORY, STACKABLE_LOG_DIR}; use crate::security::opa::HbaseOpaConfig; use crate::{ discovery::build_discovery_configmap, @@ -878,7 +878,7 @@ fn build_rolegroup_statefulset( // Needed for the `containerdebug` process to log it's tracing information to. .add_env_var( "CONTAINERDEBUG_LOG_DIRECTORY", - format!("{STACKABLE_LOG_DIR}/containerdebug"), + &*CONTAINERDEBUG_LOG_DIRECTORY, ) .add_volume_mount("hbase-config", HBASE_CONFIG_TMP_DIR) .context(AddVolumeMountSnafu)? diff --git a/rust/operator-binary/src/product_logging.rs b/rust/operator-binary/src/product_logging.rs index 3fd7b07a..39b411fe 100644 --- a/rust/operator-binary/src/product_logging.rs +++ b/rust/operator-binary/src/product_logging.rs @@ -49,6 +49,8 @@ const HBASE_LOG4J2_FILE: &str = "hbase.log4j2.xml"; pub const LOG4J_CONFIG_FILE: &str = "log4j.properties"; pub const LOG4J2_CONFIG_FILE: &str = "log4j2.properties"; pub const STACKABLE_LOG_DIR: &str = "/stackable/log"; +pub static CONTAINERDEBUG_LOG_DIRECTORY: std::sync::LazyLock = + std::sync::LazyLock::new(|| format!("{STACKABLE_LOG_DIR}/containerdebug")); /// Return the address of the Vector aggregator if the corresponding ConfigMap name is given in the /// cluster spec From ab00b89ed0a42da64306f1ce7ef3285452c2d34d Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Fri, 31 Jan 2025 16:16:15 +0100 Subject: [PATCH 46/51] make shutdown test more resilient --- .../kuttl/shutdown/30-install-hbase.yaml.j2 | 4 ++++ tests/templates/kuttl/shutdown/create_regions.sh | 16 ++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/tests/templates/kuttl/shutdown/30-install-hbase.yaml.j2 b/tests/templates/kuttl/shutdown/30-install-hbase.yaml.j2 index 0e721643..22b041c5 100644 --- a/tests/templates/kuttl/shutdown/30-install-hbase.yaml.j2 +++ b/tests/templates/kuttl/shutdown/30-install-hbase.yaml.j2 @@ -29,6 +29,10 @@ spec: replicas: 2 configOverrides: hbase-site.xml: + # The Hbase master will take 10 minutes to observe a region server as "crashed" + # This gives the region mover enoug time to run and ensures that masters do not interfere. + zookeeper.session.timeout: "600000" + # Prevent the master from re-assigning the region when the region server is # gone. Otherwise, the test case would not fail if the region mover fails. The # default retainment wait period is larger than the test step timeout. This diff --git a/tests/templates/kuttl/shutdown/create_regions.sh b/tests/templates/kuttl/shutdown/create_regions.sh index fef16b9a..122fce27 100755 --- a/tests/templates/kuttl/shutdown/create_regions.sh +++ b/tests/templates/kuttl/shutdown/create_regions.sh @@ -3,12 +3,20 @@ # Create a table with 15 regions and count the number of regions on server 0. # It should be more than 0. # -set -euo 'pipefail' set -x -echo "balance_switch false" | /stackable/hbase/bin/hbase shell --noninteractive - -echo "create 't1', 'f1', {NUMREGIONS => 15, SPLITALGO => 'HexStringSplit'}" | /stackable/hbase/bin/hbase shell --noninteractive +# We need to check if t1 exists first before creating the table. +# The table might already be there if in a previous run, the final test +# for regions on server 0 fails. +# This can happen if Hbase didn't get to assign anything there yet and +# so kuttl re-runs this test step. +T1_EXISTS=$(echo "list" | /stackable/hbase/bin/hbase shell --noninteractive | grep -c t1) +if [ "$T1_EXISTS" == "0" ]; then + /stackable/hbase/bin/hbase shell --noninteractive <<'EOF' +balance_switch false; +create 't1', 'f1', {NUMREGIONS => 15, SPLITALGO => 'HexStringSplit'}; +EOF +fi REGION_COUNT_ON_0=$(echo "list_regions 't1'" | /stackable/hbase/bin/hbase shell --noninteractive | grep -c test-hbase-regionserver-default-0) From 6cbe265c7038ae2d96bfd5bd1a34beed85a21c58 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Mon, 3 Feb 2025 17:28:08 +0100 Subject: [PATCH 47/51] tmp test def --- tests/test-definition.yaml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/test-definition.yaml b/tests/test-definition.yaml index 8b8821d0..906facdc 100644 --- a/tests/test-definition.yaml +++ b/tests/test-definition.yaml @@ -2,20 +2,23 @@ dimensions: - name: hbase values: - - 2.6.0 - - 2.4.18 + # - 2.6.0 + # - 2.4.18 # To use a custom image, add a comma and the full name after the product version # - 2.6.0,oci.stackable.tech/sandbox/hbase:2.6.0-stackable0.0.0-dev # - 2.4.18,oci.stackable.tech/sandbox/hbase:2.4.18-stackable0.0.0-dev + - 2.6.0,docker.stackable.tech/sandbox/hbase:2.6.0-pr974 - name: hbase-opa values: - - 2.6.0 + # - 2.6.0 # To use a custom image, add a comma and the full name after the product version # - 2.6.0,oci.stackable.tech/sandbox/hbase:2.6.0-stackable0.0.0-dev + - 2.6.0,docker.stackable.tech/sandbox/hbase:2.6.0-pr974 - name: hbase-latest values: - - 2.6.0 + # - 2.6.0 # - 2.4.18,oci.stackable.tech/sandbox/hbase:2.4.18-stackable0.0.0-dev + - 2.6.0,docker.stackable.tech/sandbox/hbase:2.6.0-pr974 - name: hdfs values: - 3.3.4 From 7c9a5bd04d55c5a7fe9d4436d606a0e2ef5d6887 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Tue, 4 Feb 2025 11:50:22 +0100 Subject: [PATCH 48/51] update rustfmt --- .github/workflows/pr_pre-commit.yaml | 2 +- .pre-commit-config.yaml | 11 +++++---- rust/crd/src/affinity.rs | 8 +++---- rust/crd/src/lib.rs | 22 ++++++++--------- rust/crd/src/security.rs | 6 +++-- rust/operator-binary/src/hbase_controller.rs | 25 +++++++++++--------- rust/operator-binary/src/main.rs | 3 ++- rust/operator-binary/src/product_logging.rs | 5 ++-- rust/operator-binary/src/security/opa.rs | 3 +-- 9 files changed, 47 insertions(+), 38 deletions(-) diff --git a/.github/workflows/pr_pre-commit.yaml b/.github/workflows/pr_pre-commit.yaml index ec55fe78..bdc3ddfd 100644 --- a/.github/workflows/pr_pre-commit.yaml +++ b/.github/workflows/pr_pre-commit.yaml @@ -6,7 +6,7 @@ on: env: CARGO_TERM_COLOR: always - RUST_TOOLCHAIN_VERSION: "1.82.0" + RUST_TOOLCHAIN_VERSION: "nightly-2025-01-15" HADOLINT_VERSION: "v2.12.0" PYTHON_VERSION: "3.12" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a36fdcb7..c5bd8ad1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,10 +17,6 @@ repos: - repo: https://github.com/doublify/pre-commit-rust rev: eeee35a89e69d5772bdee97db1a6a898467b686e # 1.0 hooks: - - id: fmt - # Pinning to a specific rustc version, so that we get consistent formatting - entry: RUSTUP_TOOLCHAIN=nightly-2025-01-15 cargo fmt - args: ["--all", "--", "--check"] - id: clippy args: ["--all-targets", "--", "-D", "warnings"] @@ -78,3 +74,10 @@ repos: entry: cargo test stages: [pre-commit, pre-merge-commit, manual] pass_filenames: false + + - id: cargo-rustfmt + name: cargo-rustfmt + language: system + entry: cargo +nightly-2025-01-15 fmt --all -- --check + stages: [pre-commit] + pass_filenames: false diff --git a/rust/crd/src/affinity.rs b/rust/crd/src/affinity.rs index 12d86a9e..9edc1548 100644 --- a/rust/crd/src/affinity.rs +++ b/rust/crd/src/affinity.rs @@ -77,12 +77,9 @@ pub fn get_affinity( #[cfg(test)] mod tests { - use super::*; - - use rstest::rstest; use std::collections::BTreeMap; - use crate::HbaseCluster; + use rstest::rstest; use stackable_operator::{ commons::affinity::StackableAffinity, k8s_openapi::{ @@ -93,6 +90,9 @@ mod tests { }, }; + use super::*; + use crate::HbaseCluster; + #[rstest] #[case(HbaseRole::Master)] #[case(HbaseRole::RegionServer)] diff --git a/rust/crd/src/lib.rs b/rust/crd/src/lib.rs index 884809ee..e69f45b7 100644 --- a/rust/crd/src/lib.rs +++ b/rust/crd/src/lib.rs @@ -1,10 +1,10 @@ +use std::collections::{BTreeMap, HashMap}; + use product_config::types::PropertyNameKind; use security::AuthenticationConfig; use serde::{Deserialize, Serialize}; use shell_escape::escape; use snafu::{OptionExt, ResultExt, Snafu}; -use stackable_operator::k8s_openapi::api::core::v1::PodTemplateSpec; -use stackable_operator::schemars::{self, JsonSchema}; use stackable_operator::{ commons::{ affinity::StackableAffinity, @@ -19,20 +19,22 @@ use stackable_operator::{ fragment::{self, Fragment, ValidationError}, merge::{Atomic, Merge}, }, - k8s_openapi::{api::core::v1::EnvVar, apimachinery::pkg::api::resource::Quantity, DeepMerge}, + k8s_openapi::{ + api::core::v1::{EnvVar, PodTemplateSpec}, + apimachinery::pkg::api::resource::Quantity, + DeepMerge, + }, kube::{runtime::reflector::ObjectRef, CustomResource, ResourceExt}, product_config_utils::Configuration, product_logging::{self, spec::Logging}, role_utils::{GenericRoleConfig, JavaCommonConfig, Role, RoleGroupRef}, + schemars::{self, JsonSchema}, status::condition::{ClusterCondition, HasStatusCondition}, time::Duration, }; -use std::collections::BTreeMap; -use std::collections::HashMap; use strum::{Display, EnumIter, EnumString}; -use crate::affinity::get_affinity; -use crate::security::AuthorizationConfig; +use crate::{affinity::get_affinity, security::AuthorizationConfig}; pub mod affinity; pub mod security; @@ -1242,19 +1244,17 @@ impl AnyServiceConfig { #[cfg(test)] mod tests { - use rstest::rstest; - use std::collections::{BTreeMap, HashMap}; use indoc::indoc; + use product_config::{types::PropertyNameKind, ProductConfigManager}; + use rstest::rstest; use stackable_operator::product_config_utils::{ transform_all_roles_to_config, validate_all_roles_and_groups_config, }; use crate::{merged_env, AnyServiceConfig, HbaseCluster, HbaseRole, RegionMoverExtraCliOpts}; - use product_config::{types::PropertyNameKind, ProductConfigManager}; - #[test] pub fn test_env_overrides() { let input = indoc! {r#" diff --git a/rust/crd/src/security.rs b/rust/crd/src/security.rs index 1b2001bc..85919efe 100644 --- a/rust/crd/src/security.rs +++ b/rust/crd/src/security.rs @@ -1,6 +1,8 @@ use serde::{Deserialize, Serialize}; -use stackable_operator::commons::opa::OpaConfig; -use stackable_operator::schemars::{self, JsonSchema}; +use stackable_operator::{ + commons::opa::OpaConfig, + schemars::{self, JsonSchema}, +}; #[derive(Clone, Debug, Deserialize, Eq, Hash, JsonSchema, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] diff --git a/rust/operator-binary/src/hbase_controller.rs b/rust/operator-binary/src/hbase_controller.rs index c19c9b07..2dccf9ae 100644 --- a/rust/operator-binary/src/hbase_controller.rs +++ b/rust/operator-binary/src/hbase_controller.rs @@ -13,6 +13,11 @@ use product_config::{ ProductConfigManager, }; use snafu::{OptionExt, ResultExt, Snafu}; +use stackable_hbase_crd::{ + merged_env, AnyServiceConfig, Container, HbaseCluster, HbaseClusterStatus, HbaseRole, APP_NAME, + HBASE_ENV_SH, HBASE_REST_PORT_NAME_HTTP, HBASE_REST_PORT_NAME_HTTPS, HBASE_SITE_XML, + JVM_SECURITY_PROPERTIES_FILE, SSL_CLIENT_XML, SSL_SERVER_XML, +}; use stackable_operator::{ builder::{ self, @@ -62,25 +67,23 @@ use stackable_operator::{ }; use strum::{EnumDiscriminants, IntoStaticStr, ParseError}; -use crate::product_logging::{CONTAINERDEBUG_LOG_DIRECTORY, STACKABLE_LOG_DIR}; -use crate::security::opa::HbaseOpaConfig; -use stackable_hbase_crd::{ - merged_env, AnyServiceConfig, Container, HbaseCluster, HbaseClusterStatus, HbaseRole, APP_NAME, - HBASE_ENV_SH, HBASE_REST_PORT_NAME_HTTP, HBASE_REST_PORT_NAME_HTTPS, HBASE_SITE_XML, - JVM_SECURITY_PROPERTIES_FILE, SSL_CLIENT_XML, SSL_SERVER_XML, -}; - -use crate::config::jvm::construct_hbase_heapsize_env; -use crate::config::jvm::{construct_global_jvm_args, construct_role_specific_non_heap_jvm_args}; use crate::{ + config::jvm::{ + construct_global_jvm_args, construct_hbase_heapsize_env, + construct_role_specific_non_heap_jvm_args, + }, discovery::build_discovery_configmap, kerberos::{ self, add_kerberos_pod_config, kerberos_config_properties, kerberos_ssl_client_settings, kerberos_ssl_server_settings, }, operations::{graceful_shutdown::add_graceful_shutdown_config, pdb::add_pdbs}, - product_logging::{extend_role_group_config_map, resolve_vector_aggregator_address}, + product_logging::{ + extend_role_group_config_map, resolve_vector_aggregator_address, + CONTAINERDEBUG_LOG_DIRECTORY, STACKABLE_LOG_DIR, + }, security, + security::opa::HbaseOpaConfig, zookeeper::{self, ZookeeperConnectionInformation}, OPERATOR_NAME, }; diff --git a/rust/operator-binary/src/main.rs b/rust/operator-binary/src/main.rs index 71bd8c33..d5446e88 100644 --- a/rust/operator-binary/src/main.rs +++ b/rust/operator-binary/src/main.rs @@ -1,3 +1,5 @@ +use std::sync::Arc; + use clap::Parser; use futures::StreamExt; use hbase_controller::FULL_HBASE_CONTROLLER_NAME; @@ -15,7 +17,6 @@ use stackable_operator::{ logging::controller::report_controller_reconciled, CustomResourceExt, }; -use std::sync::Arc; mod config; mod discovery; diff --git a/rust/operator-binary/src/product_logging.rs b/rust/operator-binary/src/product_logging.rs index 39b411fe..d86f2bab 100644 --- a/rust/operator-binary/src/product_logging.rs +++ b/rust/operator-binary/src/product_logging.rs @@ -1,6 +1,5 @@ use snafu::{OptionExt, ResultExt, Snafu}; use stackable_hbase_crd::{Container, HbaseCluster}; -use stackable_operator::product_logging::spec::AutomaticContainerLogConfig; use stackable_operator::{ builder::configmap::ConfigMapBuilder, client::Client, @@ -9,7 +8,9 @@ use stackable_operator::{ memory::BinaryMultiple, product_logging::{ self, - spec::{ContainerLogConfig, ContainerLogConfigChoice, Logging}, + spec::{ + AutomaticContainerLogConfig, ContainerLogConfig, ContainerLogConfigChoice, Logging, + }, }, role_utils::RoleGroupRef, }; diff --git a/rust/operator-binary/src/security/opa.rs b/rust/operator-binary/src/security/opa.rs index b4545b6b..07c56113 100644 --- a/rust/operator-binary/src/security/opa.rs +++ b/rust/operator-binary/src/security/opa.rs @@ -1,6 +1,5 @@ use snafu::{ResultExt, Snafu}; -use stackable_hbase_crd::security::AuthorizationConfig; -use stackable_hbase_crd::HbaseCluster; +use stackable_hbase_crd::{security::AuthorizationConfig, HbaseCluster}; use stackable_operator::{client::Client, commons::opa::OpaApiVersion}; const DEFAULT_DRY_RUN: bool = false; From ace488a1125e85305d128c36d5fbcb2c2bd94ef1 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Wed, 5 Feb 2025 18:45:11 +0100 Subject: [PATCH 49/51] Update tests/templates/kuttl/shutdown/30-install-hbase.yaml.j2 Co-authored-by: Siegfried Weber --- tests/templates/kuttl/shutdown/30-install-hbase.yaml.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/templates/kuttl/shutdown/30-install-hbase.yaml.j2 b/tests/templates/kuttl/shutdown/30-install-hbase.yaml.j2 index 22b041c5..4ef58b80 100644 --- a/tests/templates/kuttl/shutdown/30-install-hbase.yaml.j2 +++ b/tests/templates/kuttl/shutdown/30-install-hbase.yaml.j2 @@ -30,7 +30,7 @@ spec: configOverrides: hbase-site.xml: # The Hbase master will take 10 minutes to observe a region server as "crashed" - # This gives the region mover enoug time to run and ensures that masters do not interfere. + # This gives the region mover enough time to run and ensures that masters do not interfere. zookeeper.session.timeout: "600000" # Prevent the master from re-assigning the region when the region server is From ca3f7341310d86c54d3e8fbef01734820b0c9ab9 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Wed, 5 Feb 2025 18:46:37 +0100 Subject: [PATCH 50/51] revert test definition --- tests/test-definition.yaml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/test-definition.yaml b/tests/test-definition.yaml index 906facdc..8b8821d0 100644 --- a/tests/test-definition.yaml +++ b/tests/test-definition.yaml @@ -2,23 +2,20 @@ dimensions: - name: hbase values: - # - 2.6.0 - # - 2.4.18 + - 2.6.0 + - 2.4.18 # To use a custom image, add a comma and the full name after the product version # - 2.6.0,oci.stackable.tech/sandbox/hbase:2.6.0-stackable0.0.0-dev # - 2.4.18,oci.stackable.tech/sandbox/hbase:2.4.18-stackable0.0.0-dev - - 2.6.0,docker.stackable.tech/sandbox/hbase:2.6.0-pr974 - name: hbase-opa values: - # - 2.6.0 + - 2.6.0 # To use a custom image, add a comma and the full name after the product version # - 2.6.0,oci.stackable.tech/sandbox/hbase:2.6.0-stackable0.0.0-dev - - 2.6.0,docker.stackable.tech/sandbox/hbase:2.6.0-pr974 - name: hbase-latest values: - # - 2.6.0 + - 2.6.0 # - 2.4.18,oci.stackable.tech/sandbox/hbase:2.4.18-stackable0.0.0-dev - - 2.6.0,docker.stackable.tech/sandbox/hbase:2.6.0-pr974 - name: hdfs values: - 3.3.4 From 76001c51802c42ef9b1603b28c06d2ea92b46029 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Wed, 5 Feb 2025 18:48:10 +0100 Subject: [PATCH 51/51] update changelog --- CHANGELOG.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5eadd1e7..446139d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,8 +16,10 @@ ### Changed +- Support moving regions to other Pods during graceful shutdown of region servers ([#570]). - Default to OCI for image metadata and product image selection ([#611]). +[#570]: https://github.com/stackabletech/hbase-operator/pull/570 [#598]: https://github.com/stackabletech/hbase-operator/pull/598 [#605]: https://github.com/stackabletech/hbase-operator/pull/605 [#611]: https://github.com/stackabletech/hbase-operator/pull/611 @@ -26,17 +28,12 @@ ## [24.11.1] - 2025-01-09 -### Changed - -- Support moving regions to other Pods during graceful shutdown of region servers ([#570]). - ### Fixed - BREAKING: Use distinct ServiceAccounts for the Stacklets, so that multiple Stacklets can be deployed in one namespace. Existing Stacklets will use the newly created ServiceAccounts after restart ([#594]). -[#570]: https://github.com/stackabletech/hbase-operator/pull/570 [#594]: https://github.com/stackabletech/hbase-operator/pull/594 ## [24.11.0] - 2024-11-18