Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch lsm-metapage-fix Excluding Merge-Ins
This is equivalent to a diff from 38ec4141 to 2b5df3e8
2017-06-29
| ||
20:23 | Avoid reading or writing the 32 locking bytes at the end of the first meta-page of an LSM database. (check-in: 3ed6877f user: dan tags: trunk) | |
20:13 | Avoid reading or writing the 32 locking bytes at the end of the first meta-page of an LSM database. (Closed-Leaf check-in: 2b5df3e8 user: dan tags: lsm-metapage-fix) | |
19:08 | Fix issues in the POSIX and Win32 interfaces for lsm1. (check-in: 38ec4141 user: mistachkin tags: trunk) | |
17:27 | Edit comments in sqlite.h.in used for generating documentation, to improve the description of the new sqlite3_prepare_v3() interfaces, and other miscellaneous cleanup. No changes to executable code. (check-in: 284707a7 user: drh tags: trunk) | |
Changes to ext/lsm1/lsmInt.h.
︙ | |||
61 62 63 64 65 66 67 | 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | - - | #define LSM_DFLT_USE_LOG 1 /* Initial values for log file checksums. These are only used if the ** database file does not contain a valid checkpoint. */ #define LSM_CKSUM0_INIT 42 #define LSM_CKSUM1_INIT 42 |
︙ | |||
150 151 152 153 154 155 156 157 158 159 160 161 162 163 | 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | + + + + + + + + + | #define LSM_LOCK_WRITER 4 #define LSM_LOCK_WORKER 5 #define LSM_LOCK_CHECKPOINTER 6 #define LSM_LOCK_ROTRANS 7 #define LSM_LOCK_READER(i) ((i) + LSM_LOCK_ROTRANS + 1) #define LSM_LOCK_RWCLIENT(i) ((i) + LSM_LOCK_READER(LSM_LOCK_NREADER)) #define LSM_N_LOCK LSM_LOCK_RWCLIENT(LSM_LOCK_NRWCLIENT) /* ** Meta-page size and usable size. */ #define LSM_META_PAGE_SIZE 4096 #define LSM_META_RW_PAGE_SIZE (LSM_META_PAGE_SIZE - LSM_N_LOCK) /* ** Hard limit on the number of free-list entries that may be stored in ** a checkpoint (the remainder are stored as a system record in the LSM). ** See also LSM_CONFIG_MAX_FREELIST. */ #define LSM_MAX_FREELIST_ENTRIES 24 |
︙ |
Changes to ext/lsm1/lsm_ckpt.c.
︙ | |||
713 714 715 716 717 718 719 | 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 | - + + + | ** checkpoint. */ static int ckptChecksumOk(u32 *aCkpt){ u32 nCkpt = aCkpt[CKPT_HDR_NCKPT]; u32 cksum1; u32 cksum2; |
︙ | |||
866 867 868 869 870 871 872 | 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 | - + - + | int lsmCheckpointLoad(lsm_db *pDb, int *piRead){ int nRem = LSM_ATTEMPTS_BEFORE_PROTOCOL; ShmHeader *pShm = pDb->pShmhdr; while( (nRem--)>0 ){ int nInt; nInt = pShm->aSnap1[CKPT_HDR_NCKPT]; |
︙ | |||
1081 1082 1083 1084 1085 1086 1087 | 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 | - + | int rc; pSnap->iId++; rc = ckptExportSnapshot(pDb, bFlush, pSnap->iId, 1, &p, &n); if( rc!=LSM_OK ) return rc; assert( ckptChecksumOk((u32 *)p) ); |
︙ | |||
1116 1117 1118 1119 1120 1121 1122 | 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 | - + - + | rc = lsmFsMetaPageGet(pDb->pFS, 0, iMeta, &pPg); if( rc==LSM_OK ){ int nCkpt; int nData; u8 *aData; aData = lsmFsMetaPageData(pPg, &nData); |
︙ |
Changes to ext/lsm1/lsm_file.c.
︙ | |||
210 211 212 213 214 215 216 217 218 219 220 221 222 223 | 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | + | */ struct FileSystem { lsm_db *pDb; /* Database handle that owns this object */ lsm_env *pEnv; /* Environment pointer */ char *zDb; /* Database file name */ char *zLog; /* Database file name */ int nMetasize; /* Size of meta pages in bytes */ int nMetaRwSize; /* Read/written size of meta pages in bytes */ int nPagesize; /* Database page-size in bytes */ int nBlocksize; /* Database block-size in bytes */ /* r/w file descriptors for both files. */ LsmFile *pLsmFile; /* Used after lsm_close() to link into list */ lsm_file *fdDb; /* Database file */ lsm_file *fdLog; /* Log file */ |
︙ | |||
631 632 633 634 635 636 637 | 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 | - + + | pFS = (FileSystem *)lsmMallocZeroRc(pDb->pEnv, nByte, &rc); if( pFS ){ LsmFile *pLsmFile; pFS->zDb = (char *)&pFS[1]; pFS->zLog = &pFS->zDb[nDb+1]; pFS->nPagesize = LSM_DFLT_PAGE_SIZE; pFS->nBlocksize = LSM_DFLT_BLOCK_SIZE; |
︙ | |||
2267 2268 2269 2270 2271 2272 2273 | 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 | + - + + | i64 iOff = (iPg-1) * pFS->nMetasize; if( pFS->nMapLimit>0 ){ fsGrowMapping(pFS, 2*pFS->nMetasize, &rc); pPg->aData = (u8 *)(pFS->pMap) + iOff; }else{ pPg->aData = lsmMallocRc(pFS->pEnv, pFS->nMetasize, &rc); if( rc==LSM_OK && bWrite==0 ){ rc = lsmEnvRead( |
︙ | |||
2307 2308 2309 2310 2311 2312 2313 | 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 | - + - + | int rc = LSM_OK; if( pPg ){ FileSystem *pFS = pPg->pFS; if( pFS->nMapLimit==0 ){ if( pPg->bWrite ){ i64 iOff = (pPg->iPg==2 ? pFS->nMetasize : 0); |
︙ |