Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meta/redis: use TxPipelined() instead of Pipelined() #4264

Merged
merged 1 commit into from
Dec 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions pkg/meta/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -2346,7 +2346,7 @@ func (m *redisMeta) CopyFileRange(ctx Context, fin Ino, offIn uint64, fout Ino,
vals = append(vals, val)
}

_, err = tx.Pipelined(ctx, func(pipe redis.Pipeliner) error {
_, err = tx.TxPipelined(ctx, func(pipe redis.Pipeliner) error {
coff := offIn / ChunkSize * ChunkSize
for _, sv := range vals {
// Add a zero chunk for hole
Expand Down Expand Up @@ -2464,7 +2464,7 @@ func (m *redisMeta) doSyncDirStat(ctx Context, ino Ino) (*dirStat, syscall.Errno
if n <= 0 {
return syscall.ENOENT
}
_, err = tx.Pipelined(ctx, func(pipe redis.Pipeliner) error {
_, err = tx.TxPipelined(ctx, func(pipe redis.Pipeliner) error {
pipe.HSet(ctx, m.dirDataLengthKey(), field, stat.length)
pipe.HSet(ctx, m.dirUsedSpaceKey(), field, stat.space)
pipe.HSet(ctx, m.dirUsedInodesKey(), field, stat.inodes)
Expand Down Expand Up @@ -2635,7 +2635,7 @@ func (m *redisMeta) cleanupZeroRef(key string) {
if v != 0 {
return syscall.EINVAL
}
_, err = tx.Pipelined(ctx, func(p redis.Pipeliner) error {
_, err = tx.TxPipelined(ctx, func(p redis.Pipeliner) error {
p.HDel(ctx, m.sliceRefs(), key)
return nil
})
Expand Down Expand Up @@ -2834,7 +2834,7 @@ func (r *redisMeta) doCleanupDelayedSlices(edge int64) (int, error) {
if len(ss) == 0 {
return fmt.Errorf("invalid value for delSlices %s: %v", key, buf)
}
_, e = tx.Pipelined(ctx, func(pipe redis.Pipeliner) error {
_, e = tx.TxPipelined(ctx, func(pipe redis.Pipeliner) error {
for _, s := range ss {
rs = append(rs, pipe.HIncrBy(ctx, r.sliceRefs(), r.sliceKey(s.Id, s.Size), -1))
}
Expand Down Expand Up @@ -2945,7 +2945,7 @@ func (m *redisMeta) compactChunk(inode Ino, indx uint32, force bool) {
}
}

_, err = tx.Pipelined(ctx, func(pipe redis.Pipeliner) error {
_, err = tx.TxPipelined(ctx, func(pipe redis.Pipeliner) error {
pipe.LTrim(ctx, key, int64(len(vals)), -1)
pipe.LPush(ctx, key, marshalSlice(pos, id, size, 0, size))
for i := skipped; i > 0; i-- {
Expand Down Expand Up @@ -3236,7 +3236,7 @@ func (m *redisMeta) scanTrashSlices(ctx Context, scan trashSliceScan) error {
return err
}
if clean {
_, err = tx.Pipelined(ctx, func(pipe redis.Pipeliner) error {
_, err = tx.TxPipelined(ctx, func(pipe redis.Pipeliner) error {
for _, s := range ss {
rs = append(rs, pipe.HIncrBy(ctx, m.sliceRefs(), m.sliceKey(s.Id, s.Size), -1))
}
Expand Down