df $MOUNT || return 1
ost_last_id=`cat /proc/fs/lustre/obdfilter/*/last_id`
- osc_last_id=`cat /proc/fs/lustre/osc/*mds*/last_id`
-
+ mds_last_id=`cat /proc/fs/lustre/osc/*mds*/last_id`
+
echo "Ids after MDS<->OST synchonizing"
echo "--------------------------------"
echo "MDS last_id:"
- echo $osc_last_id
+ echo $mds_last_id
echo "OST last_id:"
echo $ost_last_id
- test "$ost_last_id" = "$osc_last_id" || {
- echo "OST and MDS last_id are different. OST did not remove orphans?"
- return 2
- }
+ local i=0
+ echo $ost_last_id | while read id; do
+ ost_ids[$i]=$id
+ ((i++))
+ done
+
+ i=0
+ echo $mds_last_id | while read id; do
+ mds_ids[$i]=$id
+ ((i++))
+ done
+
+ local arr_len=${#mds_ids[*]}
+ for ((i=0;i<$arr_len;i++)); do
+ mds_id=${mds_ids[i]}
+ ost_id=${ost_ids[i]}
+
+ test $mds_id -ge $ost_id || {
+ echo "MDS last id ($mds_id) is smaller than OST one ($ost_id)"
+ return 2
+ }
+ done
zconf_mount `hostname` $MOUNT2
return 0
df $MOUNT || return 1
- ost_last_id=`cat /proc/fs/lustre/obdfilter/*/last_id`
- osc_last_id=`cat /proc/fs/lustre/osc/*mds*/last_id`
-
- test "$ost_last_id" = "$osc_last_id" || {
- echo "OST and MDS last_id are different. OST did not remove orphans?"
- return 2
- }
-
zconf_mount `hostname` $MOUNT2
return 0
}