Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoucheng361 committed Jan 20, 2025
1 parent 5a46dad commit 205c69c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
30 changes: 15 additions & 15 deletions .github/scripts/command/load_dump.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/bin/bash -ex
source .github/scripts/common/common.sh

[[ -z "$META" ]] && META=sqlite3
Expand Down Expand Up @@ -30,30 +30,30 @@ python3 -c "import xattr" || sudo pip install xattr

test_dump_load_big_dir(){
prepare_test
./juicefs format $META_URL myjfs
./juicefs mount -d $META_URL /jfs
count=11000
./juicefs format $META_URL myjfs --enable-acl
./juicefs mount -d $META_URL /jfs
count=110
mkdir /jfs/test
touch /jfs/file
for i in $(seq 1 $count); do
mkdir /jfs/test/dir$i
echo "hello" > /jfs/test/dir$i/hello.txt
ln -s /jfs/test/dir$i/hello.txt /jfs/test/dir$i/hello_link.txt
ln /jfs/test/dir$i/hello.txt /jfs/test/dir$i/hello_hardlink.txt
xattr -w user.test $i /jfs/test/dir$i/hello.txt
./juicefs quota set $META_URL --path /test/dir$i --inodes 1000 --capacity 1
setfacl -m u:root:rwx /jfs/test/dir$i
# ln /jfs/test/dir$i/hello.txt /jfs/test/dir$i/hello_hardlink.txt
# xattr -w user.test $i /jfs/test/dir$i/hello.txt
# ./juicefs quota set $META_URL --path /test/dir$i --inodes 1000 --capacity 1
# setfacl -m u:root:rwx /jfs/test/dir$i
done
./juicefs dump $META_URL dump.json $(get_dump_option)
if [[ "$BINARY" == "true" ]]; then
symlinks=$(./juicefs load dump.json --binary --stat | grep symlink | awk -F"|" '{print $2}')
xattrs=$(./juicefs load dump.json --binary --stat | grep xattr | awk -F"|" '{print $2}')
quota=$(./juicefs load dump.json --binary --stat | grep quota | awk -F"|" '{print $2}')
acl=$(./juicefs load dump.json --binary --stat | grep acl | awk -F"|" '{print $2}')
# symlinks=$(./juicefs load dump.json --binary --stat | grep symlink | awk -F"|" '{print $2}')
# xattrs=$(./juicefs load dump.json --binary --stat | grep xattr | awk -F"|" '{print $2}')
# quota=$(./juicefs load dump.json --binary --stat | grep quota | awk -F"|" '{print $2}')
# acl=$(./juicefs load dump.json --binary --stat | grep acl | awk -F"|" '{print $2}')
[[ "$symlinks" -eq "$count" ]] || (echo "symlinks($symlinks) should be $count" && exit 1)
[[ "$xattrs" -eq "$count" ]] || (echo "xattrs($xattrs) should be $count" && exit 1)
[[ "$quota" -eq "$count" ]] || (echo "quota($quota) should be $count" && exit 1)
[[ "$acl" -eq "$count" ]] || (echo "acl($acl) should be $count" && exit 1)
# [[ "$xattrs" -eq "$count" ]] || (echo "xattrs($xattrs) should be $count" && exit 1)
# [[ "$quota" -eq "$count" ]] || (echo "quota($quota) should be $count" && exit 1)
# [[ "$acl" -eq "$count" ]] || (echo "acl($acl) should be $count" && exit 1)
fi
umount_jfs /jfs $META_URL
python3 .github/scripts/flush_meta.py $META_URL
Expand Down
4 changes: 2 additions & 2 deletions pkg/meta/redis_bak.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ import (
)

var (
redisBatchSize = 10000
redisPipeLimit = 1000
redisBatchSize = 100
redisPipeLimit = 10
)

func (m *redisMeta) dump(ctx Context, opt *DumpOption, ch chan<- *dumpedResult) error {
Expand Down

0 comments on commit 205c69c

Please sign in to comment.