Skip to content

Commit

Permalink
chore: warn with older partially written compacted segments
Browse files Browse the repository at this point in the history
Signed-off-by: Jeronimo <jeronimo.irazabal@gmail.com>
  • Loading branch information
jeroiraz committed May 13, 2024
1 parent 51dcc38 commit 030fb30
Showing 1 changed file with 6 additions and 2 deletions.
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

0 comments on commit 030fb30

Please sign in to comment.