Upgrade versions of vendored libs

This commit is contained in:
eleksir
2023-06-14 01:06:17 +03:00
parent 37898d3013
commit 747ff1454e
120 changed files with 5126 additions and 1245 deletions

View File

@@ -293,8 +293,8 @@ func (vs *versionSet) load(
}
vs.markFileNumUsed(vs.minUnflushedLogNum)
// Populate the fileBackingMap since we have finished version
// edit accumulation.
// Populate the fileBackingMap and the FileBacking for virtual sstables since
// we have finished version edit accumulation.
for _, s := range bve.AddedFileBacking {
vs.fileBackingMap[s.DiskFileNum] = s
}
@@ -490,6 +490,9 @@ func (vs *versionSet) logAndApply(
defer vs.mu.Lock()
var err error
if vs.opts.FormatMajorVersion < ExperimentalFormatVirtualSSTables && len(ve.CreatedBackingTables) > 0 {
return errors.AssertionFailedf("MANIFEST cannot contain virtual sstable records due to format major version")
}
newVersion, zombies, err = manifest.AccumulateIncompleteAndApplySingleVE(
ve, currentVersion, vs.cmp, vs.opts.Comparer.FormatKey,
vs.opts.FlushSplitBytes, vs.opts.Experimental.ReadCompactionRate,
@@ -516,7 +519,7 @@ func (vs *versionSet) logAndApply(
return errors.Wrap(err, "MANIFEST next record write failed")
}
// NB: Any error from this point on is considered fatal as we don't now if
// NB: Any error from this point on is considered fatal as we don't know if
// the MANIFEST write occurred or not. Trying to determine that is
// fraught. Instead we rely on the standard recovery mechanism run when a
// database is open. In particular, that mechanism generates a new MANIFEST
@@ -569,6 +572,14 @@ func (vs *versionSet) logAndApply(
for fileNum, size := range zombies {
vs.zombieTables[fileNum] = size
}
// Update the Deleted bools. We can't use the zombieTables struct for this
// as it works on FileBackings, not FileMetadatas.
for _, f := range ve.DeletedFiles {
f.Deleted = true
}
for i := range ve.NewFiles {
ve.NewFiles[i].Meta.Deleted = false
}
// Install the new version.
vs.append(newVersion)
@@ -688,7 +699,6 @@ func (vs *versionSet) createManifest(
Level: level,
Meta: meta,
})
// TODO(bananabrick): Test snapshot changes.
if _, ok := dedup[meta.FileBacking.DiskFileNum]; meta.Virtual && !ok {
dedup[meta.FileBacking.DiskFileNum] = struct{}{}
snapshot.CreatedBackingTables = append(