test: inspect the persisted multiblock format identity

This commit is contained in:
pingqiu committed 2026-11-16 19:18:22 -08:00
1 parent 5951a0892d
commit b2794d7872
1 file changed
+6 -1
@@ -1,6 +1,7 @@
package storage
import (
"io"
"path/filepath"
"testing"
)
@@ -26,7 +27,11 @@ func TestMultiBlockRecordsRequireDistinctOnDiskImplVersion(t *testing.T) {
if header[16] != walEntryWriteBatch {
t.Fatalf("setup record type=%d, want batch", header[16])
}
if s.sb.ImplVersion == 1 {
disk, err := readSuperblock(io.NewSectionReader(s.fd, 0, superblockSize))
if err != nil {
t.Fatal(err)
}
if disk.ImplVersion == 1 {
t.Fatal("synced type0x04 multi-block record still advertises legacy impl version1; a pre-multiblock opener cannot reject the incompatible file by version")
}
}