[server] Always check CDB schema.

This commit is contained in:
Ciprian Dorin Craciun 2022-09-11 13:38:02 +03:00
parent c2189cc03f
commit c841cc9127

View file

@ -1386,16 +1386,6 @@ func main_0 () (error) {
} }
} }
if _schemaVersion, _error := _cdbReader.GetWithCdbHash ([]byte (NamespaceSchemaVersion)); _error == nil {
if _schemaVersion == nil {
AbortError (nil, "[09316866] [cdb.....] missing archive schema version!")
} else if string (_schemaVersion) != CurrentSchemaVersion {
AbortError (nil, "[e6482cf7] [cdb.....] invalid archive schema version!")
}
} else {
AbortError (_error, "[87cae197] [cdb.....] failed opening archive!")
}
} }
@ -1407,6 +1397,23 @@ func main_0 () (error) {
if _schemaVersion, _error := _cdbReader.GetWithCdbHash ([]byte (NamespaceSchemaVersion)); _error == nil {
if _schemaVersion == nil {
AbortError (nil, "[09316866] [cdb.....] missing archive schema version!")
} else if string (_schemaVersion) != CurrentSchemaVersion {
AbortError (nil, "[e6482cf7] [cdb.....] invalid archive schema version!")
}
} else {
AbortError (_error, "[87cae197] [cdb.....] failed opening archive!")
}
var _cachedReferences map[string][2]uint64 var _cachedReferences map[string][2]uint64
if _indexPaths { if _indexPaths {
_cachedReferences = make (map[string][2]uint64, 128 * 1024) _cachedReferences = make (map[string][2]uint64, 128 * 1024)