Make isIndexedMetaV2 return errors (#15012)

Indexed streams would be decoded by the legacy loader if there 
was an error loading it. Return an error when the stream is indexed 
and it cannot be loaded.

Fixes "unknown minor metadata version" on corrupted xl.meta files and 
returns an actual error.
This commit is contained in:
Klaus Post authored and GitHub committed 2022-05-31 19:06:57 -07:00
1 parent 7b2198f7e5
commit f7cecf0945
4 files changed
+23 -17

No files matched your search

+2 -2
View File
@@ -514,7 +514,7 @@ func BenchmarkXlMetaV2Shallow(b *testing.B) {
b.ResetTimer()
b.ReportAllocs()
for i := 0; i < b.N; i++ {
buf, _ := isIndexedMetaV2(enc)
buf, _, _ := isIndexedMetaV2(enc)
if buf == nil {
b.Fatal("buf == nil")
}
@@ -529,7 +529,7 @@ func BenchmarkXlMetaV2Shallow(b *testing.B) {
b.ResetTimer()
b.ReportAllocs()
for i := 0; i < b.N; i++ {
buf, _ := isIndexedMetaV2(enc)
buf, _, _ := isIndexedMetaV2(enc)
if buf == nil {
b.Fatal("buf == nil")
}