xfs/17[013]: fix intermittent failures when filesystem metadata gets large
authorDarrick J. Wong <djwong@kernel.org>
Wed, 16 Mar 2022 22:13:26 +0000 (15:13 -0700)
committerEryu Guan <guaneryu@gmail.com>
Sun, 10 Apr 2022 12:37:13 +0000 (20:37 +0800)
These tests check that the filestreams allocator never shares an AG
across multiple streams when there's plenty of space in the filesystem.
Recent increases in metadata overhead for newer features (e.g. bigger
logs due to reflink) can throw this off, so add another AG to the
formatted filesystem to encourage it to avoid the AG with the log.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/filestreams
tests/xfs/170
tests/xfs/170.out
tests/xfs/171
tests/xfs/171.out
tests/xfs/173
tests/xfs/173.out

index 8165effea3ac6838b1c999c8836cc1f4861a6eb3..62acb47cb695a247f2f70653cb5687d5df65ccb2 100644 (file)
@@ -80,7 +80,7 @@ _check_for_dupes()
 
 _test_streams() {
 
-       echo "# testing $* ...."
+       echo "# testing $* ...." | tee -a $seqres.full
        local agcount="$1"
        local agsize="$2" # in MB
        local stream_count="$3"
index 5e622d24966e812b10d3882026cac4f5592b84e4..b9ead341f3c820d9d65615a0a19310424872f962 100755 (executable)
@@ -25,11 +25,17 @@ _check_filestreams_support || _notrun "filestreams not available"
 # test small stream, multiple I/O per file, 30s timeout
 _set_stream_timeout_centisecs 3000
 
-# test streams does a mkfs and mount
-_test_streams 8 22 4 8 3 0 0
-_test_streams 8 22 4 8 3 1 0
-_test_streams 8 22 4 8 3 0 1
-_test_streams 8 22 4 8 3 1 1
+# This test checks that the filestreams allocator never allocates space in any
+# given AG into more than one stream when there's plenty of space on the
+# filesystem.  Newer feature sets (e.g. reflink) have increased the size of
+# the log for small filesystems, so we make sure there's one more AG than
+# filestreams to encourage the allocator to skip whichever AG owns the log.
+#
+# Exercise 9x 22MB AGs, 4 filestreams, 8 files per stream, and 3MB per file.
+_test_streams 9 22 4 8 3 0 0
+_test_streams 9 22 4 8 3 1 0
+_test_streams 9 22 4 8 3 0 1
+_test_streams 9 22 4 8 3 1 1
 
 status=0
 exit
index e71515e97513c6274fadb9ca6e7752dca22ee941..16dcb79515957b5980624cf5163ce1ae03f87ed9 100644 (file)
@@ -1,20 +1,20 @@
 QA output created by 170
-# testing 8 22 4 8 3 0 0 ....
+# testing 9 22 4 8 3 0 0 ....
 # streaming
 # sync AGs...
 # checking stream AGs...
 + passed, streams are in seperate AGs
-# testing 8 22 4 8 3 1 0 ....
+# testing 9 22 4 8 3 1 0 ....
 # streaming
 # sync AGs...
 # checking stream AGs...
 + passed, streams are in seperate AGs
-# testing 8 22 4 8 3 0 1 ....
+# testing 9 22 4 8 3 0 1 ....
 # streaming
 # sync AGs...
 # checking stream AGs...
 + passed, streams are in seperate AGs
-# testing 8 22 4 8 3 1 1 ....
+# testing 9 22 4 8 3 1 1 ....
 # streaming
 # sync AGs...
 # checking stream AGs...
index 4412fe2f310465f0fd8016d730dea1050ef26c29..f93b6011d72b4177b588c9866768c623cd0afc5e 100755 (executable)
@@ -29,10 +29,18 @@ _check_filestreams_support || _notrun "filestreams not available"
 # 100 = 78.1% full, should reliably succeed
 _set_stream_timeout_centisecs 12000
 
-_test_streams 64 16 8 100 1 1 0
-_test_streams 64 16 8 100 1 1 1
-_test_streams 64 16 8 100 1 0 0
-_test_streams 64 16 8 100 1 0 1
+# This test tries to get close to the exact point at which the filestreams
+# allocator will start to allocate space from some AG into more than one
+# stream.  Newer feature sets (e.g. reflink) have increased the size of the log
+# for small filesystems, so we make sure there's one more AG than filestreams
+# to encourage the allocator to skip whichever AG owns the log.
+#
+# This test exercises 64x 16MB AGs, 8 filestreams, 100 files per stream, and
+# 1MB per file.
+_test_streams 65 16 8 100 1 1 0
+_test_streams 65 16 8 100 1 1 1
+_test_streams 65 16 8 100 1 0 0
+_test_streams 65 16 8 100 1 0 1
 
 status=0
 exit
index 89407cb2d9c4ad21fdd9ca3e3d08b98f92911984..73f73c90c6fd5f2ddcdbca272bcc410c29b24bec 100644 (file)
@@ -1,20 +1,20 @@
 QA output created by 171
-# testing 64 16 8 100 1 1 0 ....
+# testing 65 16 8 100 1 1 0 ....
 # streaming
 # sync AGs...
 # checking stream AGs...
 + passed, streams are in seperate AGs
-# testing 64 16 8 100 1 1 1 ....
+# testing 65 16 8 100 1 1 1 ....
 # streaming
 # sync AGs...
 # checking stream AGs...
 + passed, streams are in seperate AGs
-# testing 64 16 8 100 1 0 0 ....
+# testing 65 16 8 100 1 0 0 ....
 # streaming
 # sync AGs...
 # checking stream AGs...
 + passed, streams are in seperate AGs
-# testing 64 16 8 100 1 0 1 ....
+# testing 65 16 8 100 1 0 1 ....
 # streaming
 # sync AGs...
 # checking stream AGs...
index bce6ac51b43910cf83b66f85bc1a09ed38dde328..6b18d9194e793ae3f7d2b7eb34227950fea51628 100755 (executable)
@@ -26,10 +26,18 @@ _check_filestreams_support || _notrun "filestreams not available"
 # be less than or equal to half the AG count so we don't run out of AGs.
 _set_stream_timeout_centisecs 12000
 
-_test_streams 64 16 33 8 2 1 1 fail
-_test_streams 64 16 32 8 2 0 1
-_test_streams 64 16 33 8 2 0 0 fail
-_test_streams 64 16 32 8 2 1 0
+# This test checks the exact point at which the filestreams allocator will
+# start to allocate space from some AG into more than one stream.  Newer
+# feature sets (e.g. reflink) have increased the size of the log for small
+# filesystems, so we make sure there's one more AG than filestreams to
+# encourage the allocator to skip whichever AG owns the log.
+#
+# Exercise 65x 16MB AGs, 32/33 filestreams, 8 files per stream, and 2MB per
+# file.
+_test_streams 65 16 34 8 2 1 1 fail
+_test_streams 65 16 32 8 2 0 1
+_test_streams 65 16 34 8 2 0 0 fail
+_test_streams 65 16 32 8 2 1 0
 
 status=0
 exit
index 21493057dcd2c747bfb0d2e9baf17840515a7480..705c352a2a766840f7f6f96a9300df3c793b7895 100644 (file)
@@ -1,20 +1,20 @@
 QA output created by 173
-# testing 64 16 33 8 2 1 1 fail ....
+# testing 65 16 34 8 2 1 1 fail ....
 # streaming
 # sync AGs...
 # checking stream AGs...
 + expected failure, matching AGs
-# testing 64 16 32 8 2 0 1 ....
+# testing 65 16 32 8 2 0 1 ....
 # streaming
 # sync AGs...
 # checking stream AGs...
 + passed, streams are in seperate AGs
-# testing 64 16 33 8 2 0 0 fail ....
+# testing 65 16 34 8 2 0 0 fail ....
 # streaming
 # sync AGs...
 # checking stream AGs...
 + expected failure, matching AGs
-# testing 64 16 32 8 2 1 0 ....
+# testing 65 16 32 8 2 1 0 ....
 # streaming
 # sync AGs...
 # checking stream AGs...