Afr中4种触发自修复的过程

Afr(Auto File Replication) 由于其有副本, 使得自修复(Self Heal)的特性得以实现。 self heal以下简称SH。副本数为n

 

 

1. afr_lookup触发

 

在afr模块中的调用先后关系是 afr_lookup -> n次 afr_lookup_cbk -> afr_lookup_done -> afr_lookup_perform_self_heal ->  afr_lookup_set_self_heal_params ->  afr_can_self_heal_proceed? -> afr_launch_self_heal. 

 

2. opendir 触发

 

afr_opendir -> n次 afr_opendir_cbk -> afr_examine_dir -> 2*n(?) 次 afr_examine_dir_readdir_cbk -> __checksums_differ? ->  afr_launch_self_heal. 

 

3. 发现stale subvolume时,且data_self_heal设置为open

 

afr_open_ftruncate_cbk / afr_open_cbk -> afr_open_only_data_self_heal (priv->data_self_heal)? 只有在这个data_self_heal设置为open时,才返回true. ->  afr_perform_data_self_heal -> afr_launch_self_heal.

 

4. 发现subvolume came online 时

 

在afr_open_fd_fix函数中,会比较当前subvolume与之前subvolume的个数,如果发现新增subvolume,就启动自修复

 

 

                if (fd_ctx->up_count < priv->up_count) {
                        need_self_heal = _gf_true;
                        fd_ctx->up_count   = priv->up_count;
                        fd_ctx->down_count = priv->down_count;
                }
....
        if (need_self_heal)
                afr_trigger_open_fd_self_heal (frame, this);
....
 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值