do not use dataDir to reference inline data use versionID (#11942)

versionID is the one that needs to be preserved and as
well as overwritten in case of replication, transition
etc - dataDir is an ephemeral entity that changes
during overwrites - make sure that versionID is used
to save the object content.

this would break things if you are already running
the latest master, please wipe your current content
and re-do your setup after this change.
This commit is contained in:
Harshavardhana
2021-04-01 13:09:23 -07:00
committed by GitHub
parent f966fbc4a3
commit 204c610d84
6 changed files with 69 additions and 116 deletions
+11 -1
View File
@@ -83,7 +83,17 @@ func getFileInfo(xlMetaBuf []byte, volume, path, versionID string, data bool) (F
if !data || err != nil {
return fi, err
}
fi.Data = xlMeta.data.find(fi.DataDir)
versionID := fi.VersionID
if versionID == "" {
versionID = nullVersionID
}
fi.Data = xlMeta.data.find(versionID)
if len(fi.Data) == 0 {
// PR #11758 used DataDir, preserve it
// for users who might have used master
// branch
fi.Data = xlMeta.data.find(fi.DataDir)
}
return fi, nil
}