summaryrefslogtreecommitdiffstats
path: root/tests/bugs/shard/parallel-truncate-read.t
blob: 4de876f58f6a21c305822d774d13c141c3b07670 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash

#This test will crash if shard's LRU contains a shard's inode even after the
#inode is forgotten. Minimum time for crash to happen I saw was 180 seconds

. $(dirname $0)/../../include.rc

function keep_writing {
        cd $M0;
        while [ -f /tmp/parallel-truncate-read ]
        do
                dd if=/dev/zero of=file1 bs=1M count=16
        done
        cd
}

function keep_reading {
        cd $M0;
        while [ -f /tmp/parallel-truncate-read ]
        do
                cat file1 > /dev/null
        done
        cd
}

cleanup;

TEST touch /tmp/parallel-truncate-read
TEST glusterd
TEST pidof glusterd
TEST $CLI volume create $V0 replica 3 $H0:$B0/${V0}{0,1,2}
TEST $CLI volume set $V0 features.shard on
TEST $CLI volume set $V0 performance.quick-read off
TEST $CLI volume set $V0 performance.io-cache off
TEST $CLI volume set $V0 performance.stat-prefetch off
TEST $CLI volume set $V0 performance.read-ahead off
TEST $CLI volume start $V0

TEST $GFS --volfile-id=$V0 --volfile-server=$H0 $M0
keep_writing &
keep_reading &
sleep 180
TEST rm -f /tmp/parallel-truncate-read
wait
#test that the mount is operational
TEST stat $M0

cleanup;