Skip to content

Commit

Permalink
fix(tsi1/partition/test): fix data races in test code (return error i…
Browse files Browse the repository at this point in the history
…nstead of panic when type of time != float #57)

fix(tsi1/partition/test): fix data races in test code

This PR is like #24613 but solves it with a setter method for MaxLogFileSize which allows unexporting that value and MaxLogFileAge. There are actually two places locks were needed in test code. The behavior of production code is unchanged.

(cherry picked from commit f0235c4daf4b97769db932f7346c1d3aecf57f8f)

feat: modify error handling to be more idiomatic
closes #24042

fix: errors.Join() filters nil errors
closes #25341 ---------

Co-authored-by: Phil Bracikowski [email protected]
(cherry picked from commit 5c9e45f) (cherry picked from commit b88e74e)

closes #25342
  • Loading branch information
devanbenz committed Sep 17, 2024
1 parent 90cce80 commit 7c652cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tsdb/index/tsi1/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ func (i *Index) Open() (rErr error) {
i.partitions = make([]*Partition, i.PartitionN)
for j := 0; j < len(i.partitions); j++ {
p := NewPartition(i.sfile, filepath.Join(i.path, fmt.Sprint(j)))
p.MaxLogFileSize = i.maxLogFileSize
p.MaxLogFileAge = i.maxLogFileAge
p.maxLogFileSize = i.maxLogFileSize
p.maxLogFileAge = i.maxLogFileAge
p.nosync = i.disableFsync
p.logbufferSize = i.logfileBufferSize
p.logger = i.logger.With(zap.String("tsi1_partition", fmt.Sprint(j+1)))
Expand Down

0 comments on commit 7c652cd

Please sign in to comment.