Commit
17a69cf25ed0991e04d85c259f4294dc59734e1e forced sync on every
target on a facet before it was failed, in order to fix failures in
recovery-small.sh test_105() due to initial client connect failing.
This was causing local-node testing to hang in replay-ost-single.sh
test_8b() because the client mountpoint was being sync'd and would
never finish due to a fail_loc preventing any RPCs from completing.
Syncing the targets before failover also defeats the purpose of many
recovery tests. Instead, recovery-small test_105 creates a file on
the to-be-failed OST and writes to it, to trigger the exp_need_sync
and commit the new client export, without incorrectly forcing every
OST to be sync'd for every test that is using facet_failover().
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ied5f2ecf1f6523d4163916b24e5c4281902d500c
Reviewed-on: http://review.whamcloud.com/3239
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Reviewed-by: Niu Yawei <niu@whamcloud.com>
local ir_state=$(check_cli_ir_state $rcli)
[ $ir_state = OFF ] || error "IR state must be OFF at $rcli"
+ # Since the client just mounted, its last_rcvd entry is not on disk.
+ # Send an RPC so exp_need_sync forces last_rcvd to commit this export
+ # so the client can reconnect during OST recovery (LU-924, LU-1582)
+ $SETSTRIPE -i 0 $DIR/$tfile
+ dd if=/dev/zero of=$DIR/$tfile bs=1M count=1 conv=sync
+
# make sure MGS's state is Partial
[ $(get_ir_status) = "partial" ] || error "MGS IR state must be partial"
echo "Failing $facet on node $host"
- # Make sure the client data is synced to disk. LU-924
- #
- # We don't write client data synchrnously (to avoid flooding sync writes
- # when there are many clients connecting), so if the server reboots before
- # the client data reachs disk, the client data will be lost and the client
- # will be evicted after recovery, which is not what we expected.
- do_facet $facet "sync; sync; sync"
-
local affected=$(affected_facets $facet)
shutdown_facet $facet