Skip to content

Commit

Permalink
fix(tsi1/partition/test): fix data races in test code (#57) (#25338) … (
Browse files Browse the repository at this point in the history
#25352)

* fix(tsi1/partition/test): fix data races in test code (#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 authored Sep 17, 2024
1 parent cc9bd41 commit 07df053
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 75 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
Loading

0 comments on commit 07df053

Please sign in to comment.