juicedata / juicefs

JuiceFS is a distributed POSIX file system built on top of Redis and S3.
https://juicefs.com
Apache License 2.0
10.06k stars 888 forks source link

When using tikv as metadata store, the test xattr test_empty_value returns EIO #4960

Closed YunhuiChen closed 1 week ago

YunhuiChen commented 1 week ago

What happened: ___ test_empty_value[file name (path)] ____

subject = (PurePosixPath('/juicefs2/tmpybquuyf4/xattr-nfxsb134.test'), False)

def test_empty_value(subject):
    item, nofollow = subject
  xattr.set(item, USER_ATTR, EMPTY_VAL, nofollow=nofollow)

E OSError: [Errno 5] Input/output error

tests/test_xattr.py:229: OSError

juicefs.log: 2024/06/21 10:01:45.919662 juicefs[3305612] : error: can not set nil value goroutine 208 [running]: runtime/debug.Stack() /usr/local/go/src/runtime/debug/stack.go:24 +0x5e github.com/juicedata/juicefs/pkg/meta.errno({0x3807440, 0x4f4fb90}) /root/chenyunhui/juicefs/pkg/meta/utils.go:122 +0xad github.com/juicedata/juicefs/pkg/meta.(kvMeta).doSetXattr(0xc001d9fc08?, {0x1e759b3?, 0x3843980?}, 0x6?, {0xc0027bdb10, 0x9}, {0xc000c33f12, 0x0, 0x46}, 0x0) /root/chenyunhui/juicefs/pkg/meta/tkv.go:2729 +0x1ad github.com/juicedata/juicefs/pkg/meta.(baseMeta).SetXattr(0xc000748000, {0x3842eb8, 0xc001ed7ea0}, 0x418, {0xc0027bdb10, 0x9}, {0xc000c33f12, 0x0, 0x46}, 0x0) /root/chenyunhui/juicefs/pkg/meta/base.go:1780 +0x18b github.com/juicedata/juicefs/pkg/vfs.(VFS).SetXattr(0xc001ebe270, {0x3843980?, 0xc001ed7ea0}, 0x10?, {0xc0027bdb10, 0x9}, {0xc000c33f12, 0x0, 0x46}, 0x0) /root/chenyunhui/juicefs/pkg/vfs/vfs.go:936 +0x2f0 github.com/juicedata/juicefs/pkg/fuse.(fileSystem).SetXAttr(0xc000e01260, 0xc000c33f08?, 0xc000c33ed8, {0xc0027bdb10, 0x9}, {0xc000c33f12, 0x0, 0x46}) /root/chenyunhui/juicefs/pkg/fuse/fuse.go:212 +0xe5 github.com/hanwen/go-fuse/v2/fuse.doSetXAttr(0xc001cb2f20, 0xc000c33d40) /root/go/pkg/mod/github.com/juicedata/go-fuse/v2@v2.1.1-0.20230726081302-124dbfa991d7/fuse/opcode.go:410 +0xee github.com/hanwen/go-fuse/v2/fuse.init.0.func1(0xc000c33d40?, 0x25f61e5?) /root/go/pkg/mod/github.com/juicedata/go-fuse/v2@v2.1.1-0.20230726081302-124dbfa991d7/fuse/opcode.go:754 +0x49 github.com/hanwen/go-fuse/v2/fuse.(*Server).handleRequest(0xc001cb2f20, 0xc000c33d40) /root/go/pkg/mod/github.com/juicedata/go-fuse/v2@v2.1.1-0.20230726081302-124dbfa991d7/fuse/server.go:492 +0x23c

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?

Environment:

YunhuiChen commented 1 week ago

root@chaos-k8s-001:/juicefs2# xattr -w user.attr "" mc [Errno 5] Input/output error: b'mc'

SandyXSD commented 1 week ago

tikv 不支持空 value,这个测试需要跳过。