#define OBD_FAIL_OST_WR_ATTR_DELAY 0x250
#define OBD_FAIL_OST_RESTART_IO 0x251
#define OBD_FAIL_OST_OPCODE 0x253
+#define OBD_FAIL_OST_DELORPHAN_DELAY 0x254
#define OBD_FAIL_LDLM 0x300
#define OBD_FAIL_LDLM_NAMESPACE_NEW 0x301
(oa->o_flags & OBD_FL_DELORPHAN)) {
exp->exp_filter_data.fed_lastid_gen = ofd->ofd_lastid_gen;
+ CFS_FAIL_TIMEOUT(OBD_FAIL_OST_DELORPHAN_DELAY, cfs_fail_val);
/* destroy orphans */
if (lustre_msg_get_conn_cnt(tgt_ses_req(tsi)->rq_reqmsg) <
exp->exp_conn_cnt) {
CERROR("%s: dropping old orphan cleanup request\n",
ofd_name(ofd));
- GOTO(out_nolock, rc = 0);
+ GOTO(out_nolock, rc = -ESTALE);
}
/* This causes inflight precreates to abort and drop lock */
oseq->os_destroys_in_progress = 1;
exp->exp_conn_cnt) {
CERROR("%s: dropping old precreate request\n",
ofd_name(ofd));
- GOTO(out, rc = 0);
+ GOTO(out, rc = -ESTALE);
}
/* only precreate if seq is 0, IDIF or normal and also o_id
* must be specfied */
}
run_test 144b "orphan cleanup shouldn't be blocked for no objects+failover situation"
+test_144c() {
+ [ "$PARALLEL" == "yes" ] && skip "skip parallel run"
+ remote_mds_nodsh && skip "remote MDS with nodsh"
+ remote_ost_nodsh && skip "remote OST with nodsh"
+ (( OST1_VERSION >= $(version_code 2.15.59.53) )) ||
+ skip "need OSS >= v2_15_59.53 for reconnect fix"
+ local rc
+
+ #increase a precreation window
+ mkdir_on_mdt0 $DIR/$tdir
+ $LFS setstripe -c 1 -i 0 $DIR/$tdir
+ createmany -o $DIR/$tdir/$tfile 9000
+
+ stop mds1
+#define OBD_FAIL_OST_DELORPHAN_DELAY 0x254
+ #delay delorphan request to reconnection 5seconds
+ do_facet ost1 $LCTL set_param fail_loc=0x0000254 fail_val=5
+
+ start mds1 $(mdsdevname 1) $MDS_MOUNT_OPTS || error "mds1 start fail"
+
+ wait_recovery_complete mds1 || error "MDS recovery not done"
+
+ sleep 1
+ #reconnect
+ do_facet mds1 $LCTL --device $FSNAME-OST0000-osc-MDT0000 recover
+
+ do_facet ost1 $LCTL set_param fail_loc=0 fail_val=0
+
+ #first and second orphan request delayed for 5seconds
+ sleep 12
+
+ local testid=${TESTNAME//_/ }
+
+ do_facet ost1 "dmesg | tac | sed '/$testid/,$ d'" |
+ grep "trust the OST"
+ rc=$?
+ if (( rc == 0 )); then
+ remount_facet mds1
+ error "LAST_ID synchronization failed"
+ else
+ return 0
+ fi
+}
+run_test 144c "reconnection during orphan cleanup shouldn't lose LAST_ID synchronization"
+
test_145() {
[ $MDSCOUNT -lt 3 ] && skip "needs >= 3 MDTs"
[ $(facet_active_host mds2) = $(facet_active_host mds3) ] &&