-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This test checks issues found during development of the new write approach. The idea is to test the client behavior when many small (1 byte long) random writes are being handled in parallel (10 mounts).
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
tests/test_suites/ShortSystemTests/test_ec_small_parallel_writing.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
if is_windows_system; then | ||
timeout_set 5 minutes | ||
else | ||
timeout_set 3 minutes | ||
fi | ||
|
||
|
||
CHUNKSERVERS=4 \ | ||
MOUNTS=10 \ | ||
MOUNT_EXTRA_CONFIG="sfscachemode=NEVER" \ | ||
MASTER_CUSTOM_GOALS="10 ec_3_1: \$ec(3,1)" \ | ||
USE_RAMDISK=YES \ | ||
setup_local_empty_saunafs info | ||
|
||
# Create an empty file on the SaunaFS filesystem with ec_3_1 goal | ||
file="${info[mount0]}/file" | ||
touch "$file" | ||
saunafs setgoal ec_3_1 "$file" | ||
|
||
# Create a temporary file with 25 megabytes of generated data | ||
tmpf=$RAMDISK_DIR/tmpf | ||
FILE_SIZE=64K file-generate "$tmpf" | ||
|
||
# Run 10 tasks, each of them will copy every tenth kilobyte from the temporary file to the file | ||
# on SaunaFS using 5 concurrent writers and a dedicated mountpoint | ||
for i in {0..9}; do | ||
( | ||
file="${info[mount${i}]}/file" | ||
seq $i 10 $((64*1024-1)) | shuf | expect_success xargs -P5 -IXX \ | ||
dd if="$tmpf" of="$file" bs=1 count=1 seek=XX skip=XX conv=notrunc 2>/dev/null | ||
) & | ||
done | ||
wait | ||
|
||
# Validate the result | ||
MESSAGE="Data is corrupted after writing" expect_success file-validate "$file" | ||
|
||
# Validate the parity part | ||
csid=$(find_first_chunkserver_with_chunks_matching 'chunk_ec2_1_of_3*') | ||
saunafs_chunkserver_daemon $csid stop | ||
|
||
MESSAGE="Parity is corrupted after writing" expect_success file-validate "$file" |