Skip to content

Commit d9d1ba9

Browse files
authored
Merge pull request #648 from dolthub/format/bump-chunk-store-version-10
Bump CHUNK_STORE_VERSION 9 → 10 (guardrail for the Weibull chunker)
2 parents 179095c + 8072d78 commit d9d1ba9

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

src/chunk_store.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,14 @@ static int csReadManifest(ChunkStore *cs){
625625
magic = CS_READ_U32(aBuf + 0);
626626
version = CS_READ_U32(aBuf + 4);
627627
if( magic != CHUNK_STORE_MAGIC ) return SQLITE_NOTADB;
628-
if( version != CHUNK_STORE_VERSION ) return SQLITE_NOTADB;
628+
if( version != CHUNK_STORE_VERSION ){
629+
sqlite3_log(SQLITE_NOTADB,
630+
"doltlite: chunk store format version %u, expected %u "
631+
"(database written by an incompatible doltlite version; "
632+
"this build refuses to open it to prevent corruption)",
633+
version, CHUNK_STORE_VERSION);
634+
return SQLITE_NOTADB;
635+
}
629636

630637
cs->nChunks = (int)CS_READ_U32(aBuf + 28);
631638
cs->iIndexOffset = CS_READ_I64(aBuf + 32);

src/chunk_store.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include "prolly_hash.h"
2626

2727
#define CHUNK_STORE_MAGIC 0x444C5443 /* "DLTC" little-endian */
28-
#define CHUNK_STORE_VERSION 9
28+
#define CHUNK_STORE_VERSION 10
2929
#define CHUNK_MANIFEST_SIZE 168
3030
#define CHUNK_INDEX_ENTRY_SIZE 32 /* hash(20) + offset(8) + size(4) */
3131

0 commit comments

Comments
 (0)