Skip to content

Commit

Permalink
db: fix nil map error when ingest-splitting during flushable ingests
Browse files Browse the repository at this point in the history
  • Loading branch information
itsbilal committed Mar 22, 2024
1 parent fd5dc14 commit b3c1664
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion compaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -1467,6 +1467,11 @@ func (d *DB) runIngestFlush(c *compaction) (*manifest.VersionEdit, error) {
suggestSplit := d.opts.Experimental.IngestSplit != nil && d.opts.Experimental.IngestSplit() &&
d.FormatMajorVersion() >= FormatVirtualSSTables

if suggestSplit || ingestFlushable.exciseSpan.Valid() {
// We could add deleted files to ve.
ve.DeletedFiles = make(map[manifest.DeletedFileEntry]*manifest.FileMetadata)
}

replacedFiles := make(map[base.FileNum][]newFileEntry)
for _, file := range ingestFlushable.files {
// This file fits perfectly within the excise span, so we can slot it at L6.
Expand All @@ -1483,7 +1488,6 @@ func (d *DB) runIngestFlush(c *compaction) (*manifest.VersionEdit, error) {
}

if ingestFlushable.exciseSpan.Valid() {
ve.DeletedFiles = map[manifest.DeletedFileEntry]*manifest.FileMetadata{}
// Iterate through all levels and find files that intersect with exciseSpan.
for level = range c.version.Levels {
overlaps := c.version.Overlaps(level, base.UserKeyBoundsEndExclusive(ingestFlushable.exciseSpan.Start, ingestFlushable.exciseSpan.End))
Expand Down

0 comments on commit b3c1664

Please sign in to comment.