Skip to content

Commit 07df053

Browse files
authored
fix(tsi1/partition/test): fix data races in test code (#57) (#25338) … (#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 <13472206+philjb@users.noreply.github.com> (cherry picked from commit 5c9e45f) (cherry picked from commit b88e74e) closes #25342
1 parent cc9bd41 commit 07df053

File tree

3 files changed

+82
-75
lines changed

3 files changed

+82
-75
lines changed

tsdb/index/tsi1/index.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,8 @@ func (i *Index) Open() (rErr error) {
269269
i.partitions = make([]*Partition, i.PartitionN)
270270
for j := 0; j < len(i.partitions); j++ {
271271
p := NewPartition(i.sfile, filepath.Join(i.path, fmt.Sprint(j)))
272-
p.MaxLogFileSize = i.maxLogFileSize
273-
p.MaxLogFileAge = i.maxLogFileAge
272+
p.maxLogFileSize = i.maxLogFileSize
273+
p.maxLogFileAge = i.maxLogFileAge
274274
p.nosync = i.disableFsync
275275
p.logbufferSize = i.logfileBufferSize
276276
p.logger = i.logger.With(zap.String("tsi1_partition", fmt.Sprint(j+1)))

0 commit comments

Comments
 (0)