Unable to set custom 'dev_loss_tmo' value in RHEL7

本文解析了Red Hat Enterprise Linux 7.2中dm-multipath的dev_loss_tmo参数设置问题,详细介绍了如何通过调整no_path_retry和polling_interval值来有效控制路径丢失超时时间,确保系统稳定性和性能。

 

https://access.redhat.com/solutions/2487951

 SOLUTION 已验证 - 已更新 2017年五月4日19:30 - 

English 

环境

  • Red Hat Enterprise Linux 7.2

问题

  • The value of dev_loss_tmo is set to 20 but still getting the 50 in the output of below command:

    Raw

    $ less /etc/multipath.conf
    [...]
    defaults {
            user_friendly_names     yes
            fast_io_fail_tmo        10
            dev_loss_tmo            20   ###
    }
    [...]
    
    $ for f in /sys/class/fc_remote_ports/rport-*/dev_loss_tmo; do d=$(dirname $f); echo $(basename $d):$(cat $d/node_name):$(cat $f); done
    rport-7:0-2:0x50020e8020144afa:50   <---
    rport-7:0-3:0x50020e8020144af2:50   <---
    rport-8:0-2:0x50020e8020144afb:50   <---
    rport-8:0-3:0x50020e8020144af3:50   <---
    
  • How is the value of dev_loss_tmo calculated in RHEL 7 ?

决议

  • For dm-multipath to allow setting dev_loss_tmo of 20, set the no_path_retry to 10 and polling_interval value to 2:

    Raw

    defaults {
                user_friendly_names     yes
                fast_io_fail_tmo        10
                dev_loss_tmo            20
                polling_interval        2   ###
    }
    devices {
            device {
                    vendor                  "HITACHI"
                    product                 "DF.*"
                    path_grouping_policy    multibus
                    path_checker            tur
                    features                "1 queue_if_no_path"
                    no_path_retry           10    ###
                 }
     }
    
  • Then reload the multipathd service:

    Raw

    $ systemctl reload multipathd
    

根源

  • device-mapper-multipath in RHEL7 refuses to delete the paths sooner than no_path_retry value. This is because once those paths are gone, no retries could be done on affected paths. So, with above new changes, the minimum allowed value of the dev_loss_tmo calculated as below:

    Raw

    Minimum allowed 'dev_loss_tmo' by dm-multipath =  'no_path_retry' * 'polling_interval'   <----- Minimum value of the 'dev_loss_tmo'
void evt_add_general_device_handler(struct ubus_app *app, struct blob_attr *msg) { char *dev_id=NULL, *dev_mac=NULL, *dev_ip=NULL, *dev_model=NULL, *network_mode=NULL; char *dev_category=NULL, *dev_alias=NULL, *dev_avatar = NULL; int storage_enable = 0; DEV_INFO *dev_info = NULL; MEDIACENTER_CTX *mediacenter_ctx = (MEDIACENTER_CTX*)get_top_ctx(); if (!mediacenter_ctx) { DBG_ERR("top ctx NULL\n"); return; } /* parse parameters */ if (!msg) { DBG_ERR("msg NULL\n"); goto out; } struct blobmsg ( blobmsg_string deviceId, blobmsg_string mac, blobmsg_string ipaddr, blobmsg_string model, blobmsg_string alias, blobmsg_string avatar, blobmsg_string category, blobmsg_string network_mode, blobmsg_int32 hub_storage_enabled ) (my_struct, msg, false); if (!my_struct.deviceId || !my_struct.ipaddr || !my_struct.mac || !my_struct.model || !my_struct.network_mode) { DBG_ERR("param error\n"); goto out; } dev_id = blobmsg_get_string(my_struct.deviceId); dev_mac = blobmsg_get_string(my_struct.mac); dev_ip = blobmsg_get_string(my_struct.ipaddr); dev_model = blobmsg_get_string(my_struct.model); network_mode = blobmsg_get_string(my_struct.network_mode); if(my_struct.category){ dev_category = blobmsg_get_string(my_struct.category); } if (my_struct.alias){ dev_alias = blobmsg_get_string(my_struct.alias); DBG_ERR("dev_alias:%s\n", dev_alias); } if (my_struct.avatar){ dev_avatar = blobmsg_get_string(my_struct.avatar); DBG_ERR("dev_avatar:%s\n", dev_avatar); } if(my_struct.hub_storage_enabled){ storage_enable = blobmsg_get_u32(my_struct.hub_storage_enabled); } #ifndef HARDDISK_STORAGE if (storage_enable == 0) { return; } #endif dev_info = dev_info_new(mediacenter_ctx, dev_id, dev_ip, dev_mac, dev_model, dev_category, dev_alias, dev_avatar, DEV_COMMON_CAM, storage_enable, msg); if (!dev_info) { DBG_ERR("dev_info_new failed, %s\n", dev_id); goto out; } #ifdef AI_ENHANCE /*if new dev, sync all familiar to uci config*/ Ai_Enhance_FamiliarNotifyConfig_Update(dev_info); #endif dev_info->top_ctx = mediacenter_ctx; dev_info->network_mode = (0 == strncmp("wired", network_mode, strlen("wired"))) ? 0 : 1; /* refresh all devices&#39; region info */ tapocare_update_region_info(mediacenter_ctx); uloop_timeout_set(&mediacenter_ctx->pSd->up_sd_usage_tmo, 10); dev_info->local_online = 1; dev_info->check_local_online.cb = check_general_local_online_cb; uloop_timeout_set(&dev_info->check_local_online, TIMEOUT_CHECK_LOCAL_ONLINE); dev_info->check_lonn_conn.cb = check_general_long_conn_cb; uloop_timeout_set(&dev_info->check_lonn_conn, 5000); out: return; }
09-18
void evt_device_list_general_handler(struct ubus_app *app, struct blob_attr *msg) { struct blob_attr *cur = NULL; int rem = 0; char *dev_id = NULL, *dev_mac = NULL, *dev_ip = NULL, *dev_model = NULL, *dev_category = NULL, *dev_alias = NULL, *dev_avatar = NULL; DEV_INFO *dev_info = NULL; MEDIACENTER_CTX *mediacenter_ctx = (MEDIACENTER_CTX*)get_top_ctx(); int general_camera = 0; int hub_storage_enable = -1; if (!mediacenter_ctx) { DBG_ERR("top ctx NULL\n"); return; } /* parse parameters */ if (!msg) { DBG_ERR("msg NULL\n"); goto out; } struct blobmsg ( blobmsg_array devices, ) (my_struct, msg, false); if (!my_struct.devices) { DBG_ERR("param error\n"); goto out; } blobmsg_for_each_attr(cur, my_struct.devices, rem) { if (cur) { struct blobmsg ( blobmsg_int32 general_camera, blobmsg_string deviceId, blobmsg_string mac, blobmsg_string ipaddr, blobmsg_string model, blobmsg_string alias, blobmsg_string category, blobmsg_string avatar, blobmsg_int32 storage_enable, blobmsg_int32 hub_bitmap, blobmsg_int32 ai_enhance_enable, blobmsg_int32 face_notification, blobmsg_int32 familiar_enable, blobmsg_int32 stranger_enable, blobmsg_int32 stranger_alarm_count, blobmsg_array face_id, ) (info, cur, false); if (!info.general_camera || !info.deviceId || !info.ipaddr || !info.model || !info.mac || !info.alias) { continue; } general_camera = blobmsg_get_u32(info.general_camera); if (0 == general_camera) { continue; } dev_id = blobmsg_get_string(info.deviceId); dev_mac = blobmsg_get_string(info.mac); dev_ip = blobmsg_get_string(info.ipaddr); dev_model = blobmsg_get_string(info.model); dev_alias = blobmsg_get_string(info.alias); if(info.category){ dev_category = blobmsg_get_string(info.category); } if(info.avatar){ dev_avatar = blobmsg_get_string(info.avatar); DBG_ERR("dev_avatar: %s\n", dev_avatar); } if (info.storage_enable){ hub_storage_enable = blobmsg_get_u32(info.storage_enable); DBG_ERR("hub_storage_enable:%d\n", hub_storage_enable); } if(hub_storage_enable == 0){ DBG_ERR("skip mac:[%s]\n", dev_mac); continue; } /* add device */ dev_info = dev_info_new(mediacenter_ctx, dev_id, dev_ip, dev_mac, dev_model, dev_category, dev_alias, dev_avatar, DEV_COMMON_CAM, hub_storage_enable, cur); if (!dev_info) { DBG_ERR("dev_info_new failed, %s\n", dev_id); continue; } #ifdef AI_ENHANCE if(info.hub_bitmap){ dev_info->hub_bitmap = blobmsg_get_u32(info.hub_bitmap); } if (info.ai_enhance_enable){ dev_info->ai_enhanced = blobmsg_get_u32(info.ai_enhance_enable); if(dev_info->ai_enhanced == 1) { Ai_Enhance_AlgoDev_Init(dev_info->dev_id, dev_info->dev_model, dev_info->dev_mac); } } if(info.face_notification){ dev_info->face_notification = blobmsg_get_u32(info.face_notification); } if(info.familiar_enable){ dev_info->familiar_enable = blobmsg_get_u32(info.familiar_enable); } if(info.stranger_enable){ dev_info->stranger_enable = blobmsg_get_u32(info.stranger_enable); } if(info.stranger_alarm_count){ dev_info->stranger_alarm_count = blobmsg_get_u32(info.stranger_alarm_count); } if(info.face_id){ memset(dev_info->FamiliarNotify_List, 0, sizeof(dev_info->FamiliarNotify_List)); struct blob_attr *pos = NULL; int rem2 = 0, index = 0; U64 tmp_face_id = 0; blobmsg_for_each_attr(pos, info.face_id, rem2) { if(pos) { tmp_face_id = strtoull(blobmsg_get_string(pos), NULL, 10); index = Ai_Enhance_GetIndex_From_Faceid(tmp_face_id); if(index >= 0 && index < FD_FACE_SUPPORT_NUM) { dev_info->FamiliarNotify_List[index] = tmp_face_id; } } } } else { if(info.familiar_enable) { memset(dev_info->FamiliarNotify_List, 0, sizeof(dev_info->FamiliarNotify_List)); } else { /*设备没配过人脸开关,默认生成所有熟人*/ Ai_Enhance_FamiliarNotifyConfig_Update(dev_info); } } #endif dev_info->top_ctx = mediacenter_ctx; dev_info->local_online = 1; dev_info->check_local_online.cb = check_general_local_online_cb; uloop_timeout_set(&dev_info->check_local_online, TIMEOUT_CHECK_LOCAL_ONLINE); dev_info->check_lonn_conn.cb = check_general_long_conn_cb; uloop_timeout_set(&dev_info->check_lonn_conn, 5000); } } /* refresh all devices&#39; region info */ tapocare_update_region_info(mediacenter_ctx); uloop_timeout_set(&mediacenter_ctx->pSd->up_sd_usage_tmo, 10); out: return; }
09-18
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值