def pre_upgrade_restart(self, env, upgrade_type=None): import params env.set_params(params) if params.version and check_stack_feature(StackFeature.ROLLING_UPGRADE, params.version): stack_select.select("kafka-broker", params.version) if params.version and check_stack_feature( StackFeature.CONFIG_VERSIONING, params.version): conf_select.select(params.stack_name, "kafka", params.version) # This is extremely important since it should only be called if crossing the HDP 2.3.4.0 boundary. if params.current_version and params.version and params.upgrade_direction: src_version = dst_version = None if params.upgrade_direction == Direction.UPGRADE: src_version = format_stack_version(params.current_version) dst_version = format_stack_version(params.version) else: # These represent the original values during the UPGRADE direction src_version = format_stack_version(params.version) dst_version = format_stack_version( params.downgrade_from_version) if not check_stack_feature( StackFeature.KAFKA_ACL_MIGRATION_SUPPORT, src_version) and check_stack_feature( StackFeature.KAFKA_ACL_MIGRATION_SUPPORT, dst_version): # Calling the acl migration script requires the configs to be present. self.configure(env, upgrade_type=upgrade_type) upgrade.run_migration(env, upgrade_type)
def pre_upgrade_restart(self, env, upgrade_type=None): import params env.set_params(params) if params.version and check_stack_feature(StackFeature.ROLLING_UPGRADE, params.version): stack_select.select("kafka-broker", params.version) if params.version and check_stack_feature(StackFeature.CONFIG_VERSIONING, params.version): conf_select.select(params.stack_name, "kafka", params.version) # This is extremely important since it should only be called if crossing the HDP 2.3.4.0 boundary. if params.current_version and params.version and params.upgrade_direction: src_version = dst_version = None if params.upgrade_direction == Direction.UPGRADE: src_version = format_stack_version(params.current_version) dst_version = format_stack_version(params.version) else: # These represent the original values during the UPGRADE direction src_version = format_stack_version(params.version) dst_version = format_stack_version(params.downgrade_from_version) # TODO: How to handle the case of crossing stack version boundary in a stack agnostic way? if compare_versions(src_version, '2.3.4.0') < 0 and compare_versions(dst_version, '2.3.4.0') >= 0: # Calling the acl migration script requires the configs to be present. self.configure(env, upgrade_type=upgrade_type) upgrade.run_migration(env, upgrade_type)
def pre_upgrade_restart(self, env, upgrade_type=None): import params env.set_params(params) if params.version and compare_versions( format_stack_version(params.version), '4.1.0.0') >= 0: stack_select.select_packages(params.version) # This is extremely important since it should only be called if crossing the IOP 4.2 boundary. # This is extremely important since it should only be called if crossing the HDP 2.3.4.0 boundary. if params.version and params.upgrade_direction: src_version = dst_version = None if params.upgrade_direction == Direction.UPGRADE: src_version = upgrade_summary.get_source_version( "KAFKA", default_version=params.version) dst_version = upgrade_summary.get_target_version( "KAFKA", default_version=params.version) else: # These represent the original values during the UPGRADE direction src_version = upgrade_summary.get_target_version( "KAFKA", default_version=params.version) dst_version = upgrade_summary.get_source_version( "KAFKA", default_version=params.version) if compare_versions(src_version, '4.2.0.0') < 0 and compare_versions( dst_version, '4.2.0.0') >= 0: # Upgrade from IOP 4.1 to 4.2, Calling the acl migration script requires the configs to be present. self.configure(env, upgrade_type=upgrade_type) upgrade.run_migration(env, upgrade_type)
def pre_upgrade_restart(self, env, upgrade_type=None): import params env.set_params(params) # grab the current version of the component pre_upgrade_version = stack_select.get_role_component_current_stack_version( ) if params.version and check_stack_feature(StackFeature.ROLLING_UPGRADE, params.version): stack_select.select_packages(params.version) # This is extremely important since it should only be called if crossing the HDP 2.3.4.0 boundary. if params.version and params.upgrade_direction: src_version = dst_version = None if params.upgrade_direction == Direction.UPGRADE: src_version = upgrade_summary.get_source_version( "KAFKA", default_version=params.version) dst_version = upgrade_summary.get_target_version( "KAFKA", default_version=params.version) else: # These represent the original values during the UPGRADE direction src_version = upgrade_summary.get_target_version( "KAFKA", default_version=params.version) dst_version = upgrade_summary.get_source_version( "KAFKA", default_version=params.version) if not check_stack_feature( StackFeature.KAFKA_ACL_MIGRATION_SUPPORT, src_version) and check_stack_feature( StackFeature.KAFKA_ACL_MIGRATION_SUPPORT, dst_version): # Calling the acl migration script requires the configs to be present. self.configure(env, upgrade_type=upgrade_type) upgrade.run_migration(env, upgrade_type)
def pre_upgrade_restart(self, env, upgrade_type=None): import params env.set_params(params) if params.version and compare_versions( format_hdp_stack_version(params.version), '2.2.0.0') >= 0: conf_select.select(params.stack_name, "kafka", params.version) hdp_select.select("kafka-broker", params.version) # This is extremely important since it should only be called if crossing the HDP 2.3.4.0 boundary. if params.current_version and params.version and params.upgrade_direction: src_version = dst_version = None if params.upgrade_direction == Direction.UPGRADE: src_version = format_hdp_stack_version(params.current_version) dst_version = format_hdp_stack_version(params.version) else: # These represent the original values during the UPGRADE direction src_version = format_hdp_stack_version(params.version) dst_version = format_hdp_stack_version( params.downgrade_from_version) if compare_versions(src_version, '2.3.4.0') < 0 and compare_versions( dst_version, '2.3.4.0') >= 0: # Calling the acl migration script requires the configs to be present. self.configure(env) upgrade.run_migration(env, upgrade_type)
def pre_upgrade_restart(self, env, upgrade_type=None): import params env.set_params(params) if params.version and compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0: hdp_select.select("kafka-broker", params.version) if params.version and compare_versions(format_hdp_stack_version(params.version), '2.3.0.0') >= 0: conf_select.select(params.stack_name, "kafka", params.version) # This is extremely important since it should only be called if crossing the HDP 2.3.4.0 boundary. if params.current_version and params.version and params.upgrade_direction: src_version = dst_version = None if params.upgrade_direction == Direction.UPGRADE: src_version = format_hdp_stack_version(params.current_version) dst_version = format_hdp_stack_version(params.version) else: # These represent the original values during the UPGRADE direction src_version = format_hdp_stack_version(params.version) dst_version = format_hdp_stack_version(params.downgrade_from_version) if compare_versions(src_version, '2.3.4.0') < 0 and compare_versions(dst_version, '2.3.4.0') >= 0: # Calling the acl migration script requires the configs to be present. self.configure(env, upgrade_type=upgrade_type) upgrade.run_migration(env, upgrade_type)