There may be some async LFSCK updates in processing when the
test scripts check the reparation result. So make the scripts
to wait/retry until the async updates has been done or timeout.
Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I71a1986de432631ec7158a7e90797c46ae672812
Reviewed-on: http://review.whamcloud.com/11590
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
echo "Inject failure stub to simulate dangling referenced MDT-object"
#define OBD_FAIL_LFSCK_DANGLING 0x1610
do_facet ost1 $LCTL set_param fail_loc=0x1610
echo "Inject failure stub to simulate dangling referenced MDT-object"
#define OBD_FAIL_LFSCK_DANGLING 0x1610
do_facet ost1 $LCTL set_param fail_loc=0x1610
- createmany -o $DIR/$tdir/f $((count + 32))
+ createmany -o $DIR/$tdir/f $((count + 31))
+ touch $DIR/$tdir/guard
do_facet ost1 $LCTL set_param fail_loc=0
start_full_debug_logging
do_facet ost1 $LCTL set_param fail_loc=0
start_full_debug_logging
[ $repaired -ge 32 ] ||
error "(4) Fail to repair dangling reference: $repaired"
[ $repaired -ge 32 ] ||
error "(4) Fail to repair dangling reference: $repaired"
- echo "'ls' should fail because it will not repair dangling by default"
- ls -ail $DIR/$tdir > /dev/null 2>&1 && error "(5) ls should fail."
+ echo "'stat' should fail because of not repair dangling by default"
+ stat $DIR/$tdir/guard > /dev/null 2>&1 && error "(5) stat should fail"
echo "Trigger layout LFSCK to repair dangling reference"
$START_LAYOUT -r -c || error "(6) Fail to start LFSCK for layout!"
echo "Trigger layout LFSCK to repair dangling reference"
$START_LAYOUT -r -c || error "(6) Fail to start LFSCK for layout!"
error "(7) unexpected status"
}
error "(7) unexpected status"
}
+ # There may be some async LFSCK updates in processing, wait for
+ # a while until the target reparation has been done. LU-4970.
+
+ echo "'stat' should success after layout LFSCK repairing"
+ wait_update_facet client "stat $DIR/$tdir/guard |
+ awk '/Size/ { print \\\$2 }'" "0" 6 || {
+ stat $DIR/$tdir/guard
+ $SHOW_LAYOUT
+ error "(8) unexpected size"
+ }
+
repaired=$($SHOW_LAYOUT |
awk '/^repaired_dangling/ { print $2 }')
[ $repaired -ge 32 ] ||
repaired=$($SHOW_LAYOUT |
awk '/^repaired_dangling/ { print $2 }')
[ $repaired -ge 32 ] ||
- error "(8) Fail to repair dangling reference: $repaired"
+ error "(9) Fail to repair dangling reference: $repaired"
- echo "'ls' should success after layout LFSCK repairing"
- ls -ail $DIR/$tdir > /dev/null || error "(9) ls should success."
stop_full_debug_logging
}
run_test 14 "LFSCK can repair MDT-object with dangling reference"
stop_full_debug_logging
}
run_test 14 "LFSCK can repair MDT-object with dangling reference"