Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #303 from tmenjo/md-is-sparse-object
sheep: Only ledger and inode objects keep sparse when "dog node md plug"
- Loading branch information
Showing
4 changed files
with
127 additions
and
1 deletion.
There are no files selected for viewing
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
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,57 @@ | ||
#!/bin/bash | ||
|
||
# Test md plug and sparse object | ||
|
||
. ./common | ||
|
||
MD=true | ||
|
||
_need_to_be_root | ||
|
||
if [ "$STORE" != "/tmp/sheepdog/114" ]; then | ||
_notrun "This test cannot be run when WD is manually set" | ||
fi | ||
|
||
function _listFiles | ||
{ | ||
for i in "$@" ; do | ||
stat -c "%n %b %B %s" "$i"/* |\ | ||
awk '{print $1,$2*$3,$4;}' |\ | ||
sort |\ | ||
_filter_store | ||
done | ||
} | ||
|
||
function setUp | ||
{ | ||
_make_device 0 $((256*1024**2)) | ||
_make_device 1 $((256*1024**2)) | ||
_make_device 2 $((256*1024**2)) | ||
MD_STORE=",$STORE/1" | ||
_start_sheep 0 | ||
_wait_for_sheep 1 | ||
_cluster_format -c 1 | ||
} | ||
|
||
function testPlugAndSparse | ||
{ | ||
setUp | ||
|
||
$DOG node md info | _filter_store | ||
|
||
for ((i=0; i<10; ++i)) ; do | ||
$DOG vdi create -P "v$i" 8M | ||
done | ||
|
||
_listFiles "$STORE"/1 | ||
|
||
$DOG node md plug -f "$STORE"/2 | ||
_wait_for_sheep_recovery 0 | ||
|
||
$DOG node md info | _filter_store | ||
_listFiles "$STORE"/{1,2} | ||
|
||
_cleanup | ||
} | ||
|
||
testPlugAndSparse |
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,67 @@ | ||
QA output created by 114 | ||
using backend plain store | ||
Id Size Used Avail Use% Path | ||
0 229 MB 0.0 MB 229 MB 0% STORE/1 | ||
STORE/1/0070839000000000 4194304 4194304 | ||
STORE/1/0070839000000001 4194304 4194304 | ||
STORE/1/0070854300000000 4194304 4194304 | ||
STORE/1/0070854300000001 4194304 4194304 | ||
STORE/1/0070912800000000 4194304 4194304 | ||
STORE/1/0070912800000001 4194304 4194304 | ||
STORE/1/007092db00000000 4194304 4194304 | ||
STORE/1/007092db00000001 4194304 4194304 | ||
STORE/1/0070948e00000000 4194304 4194304 | ||
STORE/1/0070948e00000001 4194304 4194304 | ||
STORE/1/0070964100000000 4194304 4194304 | ||
STORE/1/0070964100000001 4194304 4194304 | ||
STORE/1/007097f400000000 4194304 4194304 | ||
STORE/1/007097f400000001 4194304 4194304 | ||
STORE/1/007099a700000000 4194304 4194304 | ||
STORE/1/007099a700000001 4194304 4194304 | ||
STORE/1/00709b5a00000000 4194304 4194304 | ||
STORE/1/00709b5a00000001 4194304 4194304 | ||
STORE/1/00709d0d00000000 4194304 4194304 | ||
STORE/1/00709d0d00000001 4194304 4194304 | ||
STORE/1/8070839000000000 6144 12587576 | ||
STORE/1/8070854300000000 6144 12587576 | ||
STORE/1/8070912800000000 6144 12587576 | ||
STORE/1/807092db00000000 6144 12587576 | ||
STORE/1/8070948e00000000 6144 12587576 | ||
STORE/1/8070964100000000 6144 12587576 | ||
STORE/1/807097f400000000 6144 12587576 | ||
STORE/1/807099a700000000 6144 12587576 | ||
STORE/1/80709b5a00000000 6144 12587576 | ||
STORE/1/80709d0d00000000 6144 12587576 | ||
Id Size Used Avail Use% Path | ||
0 229 MB 76 MB 153 MB 33% STORE/1 | ||
1 229 MB 4.0 MB 225 MB 1% STORE/2 | ||
STORE/1/0070839000000000 4194304 4194304 | ||
STORE/1/0070839000000001 4194304 4194304 | ||
STORE/1/0070854300000000 4194304 4194304 | ||
STORE/1/0070854300000001 4194304 4194304 | ||
STORE/1/0070912800000000 4194304 4194304 | ||
STORE/1/0070912800000001 4194304 4194304 | ||
STORE/1/007092db00000000 4194304 4194304 | ||
STORE/1/007092db00000001 4194304 4194304 | ||
STORE/1/0070948e00000000 4194304 4194304 | ||
STORE/1/0070948e00000001 4194304 4194304 | ||
STORE/1/0070964100000000 4194304 4194304 | ||
STORE/1/0070964100000001 4194304 4194304 | ||
STORE/1/007097f400000000 4194304 4194304 | ||
STORE/1/007097f400000001 4194304 4194304 | ||
STORE/1/007099a700000000 4194304 4194304 | ||
STORE/1/007099a700000001 4194304 4194304 | ||
STORE/1/00709b5a00000001 4194304 4194304 | ||
STORE/1/00709d0d00000000 4194304 4194304 | ||
STORE/1/00709d0d00000001 4194304 4194304 | ||
STORE/1/8070839000000000 6144 12587576 | ||
STORE/1/8070854300000000 6144 12587576 | ||
STORE/1/8070912800000000 6144 12587576 | ||
STORE/1/807092db00000000 6144 12587576 | ||
STORE/1/8070964100000000 6144 12587576 | ||
STORE/1/807097f400000000 6144 12587576 | ||
STORE/1/807099a700000000 6144 12587576 | ||
STORE/1/80709b5a00000000 6144 12587576 | ||
STORE/1/80709d0d00000000 6144 12587576 | ||
STORE/2/00709b5a00000000 4194304 4194304 | ||
STORE/2/8070948e00000000 8192 12587576 |
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 |
---|---|---|
|
@@ -121,3 +121,4 @@ | |
111 auto quick dog | ||
112 auto dog | ||
113 auto dog | ||
114 auto quick dog md |