Skip to content
Merged
Changes from 2 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
16 changes: 14 additions & 2 deletions tsdb/shard.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,11 +460,23 @@ func (s *Shard) ready() error {

// LastModified returns the time when this shard was last modified.
func (s *Shard) LastModified() time.Time {
engine, err := s.Engine()
t, err := s.LastModifiedOrErr()
if err != nil {
return time.Time{}
}
return engine.LastModified()

return t
}

// LastModifiedOrErr returns the time when this shard was last modified or an error.
// See: https://github.com/influxdata/plutonium/pull/4275#discussion_r2214077374
// Previously we would throw away any error from Shard.LastModified
func (s *Shard) LastModifiedOrErr() (time.Time, error) {
engine, err := s.Engine()
if err != nil {
return time.Time{}, err
}
return engine.LastModified(), nil
}

// Index returns a reference to the underlying index. It returns an error if
Expand Down