Skip to content

Commit

Permalink
meta/redis: use TxPipelined() instead of Pipelined() (#4264)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtnk2005 authored and SandyXSD committed Feb 3, 2024
1 parent adaa733 commit c4d5270
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/meta/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -2101,7 +2101,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 @@ -2261,7 +2261,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 @@ -2456,7 +2456,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 @@ -2562,7 +2562,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

0 comments on commit c4d5270

Please sign in to comment.