Skip to content

Commit

Permalink
Merge pull request weaviate#4922 from weaviate/stable/v1.24
Browse files Browse the repository at this point in the history
Merge stable/v1.24 into stable/v1.25
  • Loading branch information
antas-marcin authored May 14, 2024
2 parents e248385 + 4fb8881 commit 0d52f16
Show file tree
Hide file tree
Showing 14 changed files with 833 additions and 190 deletions.
5 changes: 5 additions & 0 deletions adapters/repos/db/lsmkv/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,11 @@ func (b *Bucket) atomicallyAddDiskSegmentAndRemoveFlushing() error {
b.flushLock.Lock()
defer b.flushLock.Unlock()

if b.flushing.Size() == 0 {
b.flushing = nil
return nil
}

path := b.flushing.path
if err := b.disk.add(path + ".db"); err != nil {
return err
Expand Down
8 changes: 6 additions & 2 deletions adapters/repos/db/lsmkv/segment_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ func newSegmentGroup(logger logrus.FieldLogger, metrics *Metrics,
jointSegmentsIDs := strings.Split(jointSegments, "_")

if len(jointSegmentsIDs) != 2 {
return nil, fmt.Errorf("invalid compacted segment file name %q", entry.Name())
logger.WithField("action", "lsm_segment_init").
WithField("path", filepath.Join(sg.dir, entry.Name())).
Warn("ignored (partially written) LSM compacted segment generated with a version older than v1.24.0")

continue
}

leftSegmentFilename := fmt.Sprintf("segment-%s.db", jointSegmentsIDs[0])
Expand Down Expand Up @@ -220,7 +224,7 @@ func newSegmentGroup(logger logrus.FieldLogger, metrics *Metrics,
logger.WithField("action", "lsm_segment_init").
WithField("path", filepath.Join(sg.dir, entry.Name())).
WithField("wal_path", walFileName).
Info("Discarded (partially written) LSM segment, because an active WAL for " +
Info("discarded (partially written) LSM segment, because an active WAL for " +
"the same segment was found. A recovery from the WAL will follow.")

continue
Expand Down
Loading

0 comments on commit 0d52f16

Please sign in to comment.