Commit 110e0e1
authored
Migrate from lmdb-zero to heed (#3825)
* db: migrate from lmdb-zero to heed
* fix: check resizing operation and wait to avoid crash with multiple batches, fix exists check at batch
* build: fix missing deps at Cargo.lock
* lmdb: single environment, migrate existing databases with provided non-default environment name
* fix: revert chunk size to 128mb
* lmdb: ability to use multiple shared environments
* build: remove unused dependency
* fix: resize to have correct multiplier of the system page size
* lmdb: speed up prefix iter by storing keys
* lmdb: default env name
* lmdb: wait db resize before read, reduce timeout before resizing
* lmdb: use static reader for iterator, count existing batches for stable resize
* fix: check batches count on resize waiting
* lmdb: use separate databases instead of prefixes, use default db for values without prefixes, migrate old environment
* fix: pop pos key
* lmdb: count all open transactions to finish before resizing
* lmdb: immediate resize if there are no open transactions
* lmdb: remove env state when there are no more stores
* lmdb: use atomic for resize and resize checking flags
* lmdb: sleep 10ms when waiting all opened txs to be closed
* lmdb: use atomic open txs and stores count
* lmdb: use index to detect separator, ignore unknown db key to not have a panic
* lmdb: store max 10k keys in the iterator
* lmdb: check iter result on getting total
* lmdb: handle errors at iterator
* lmdb: handle an error when db with provided key not found
* lmdb: fix iterate over 10k keys
* lmdb: document migration resize safety
* lmdb: fix iter test
* lmdb: clear new db after unsuccessful migration, handle read error on migration to interrupt process
* store: bring back old key methods to reproduce data migration
* lmdb: return an error on unsuccessful migration
* lmdb: migration test, clean data after allocate test
* lmdb: info migration log
* fix: move iterator before handling an error to allow skip bad value
* lmdb: return an error if removal of old DB file failed after migration
* lmdb: lifetime for iterator, use write transaction at batch iterator
* lmdb: migration progress
* fix: tests
* lmdb: immediately set resizing flag, ignore resizing flag while there are more than 0 opened txs to avoid stuck, optimize tx counter for some operations
* lmdb: key for successful migration
* lmdb: fix put database creation at separate block to avoid lifetime issues when returning an error on migration1 parent 151e74c commit 110e0e1
29 files changed
Lines changed: 1654 additions & 744 deletions
File tree
- chain
- src
- txhashset
- tests
- p2p/src
- pool/tests
- servers
- src
- common
- grin
- src/bin
- cmd
- tui
- store
- src
- tests
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
154 | | - | |
| 153 | + | |
| 154 | + | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| 174 | + | |
174 | 175 | | |
175 | | - | |
| 176 | + | |
176 | 177 | | |
177 | 178 | | |
178 | 179 | | |
| |||
189 | 190 | | |
190 | 191 | | |
191 | 192 | | |
192 | | - | |
193 | | - | |
194 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
195 | 196 | | |
196 | 197 | | |
197 | 198 | | |
| |||
275 | 276 | | |
276 | 277 | | |
277 | 278 | | |
278 | | - | |
| 279 | + | |
279 | 280 | | |
280 | 281 | | |
281 | 282 | | |
| |||
314 | 315 | | |
315 | 316 | | |
316 | 317 | | |
317 | | - | |
| 318 | + | |
318 | 319 | | |
319 | 320 | | |
320 | 321 | | |
| |||
530 | 531 | | |
531 | 532 | | |
532 | 533 | | |
533 | | - | |
534 | | - | |
535 | | - | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
536 | 537 | | |
537 | 538 | | |
538 | 539 | | |
| |||
832 | 833 | | |
833 | 834 | | |
834 | 835 | | |
835 | | - | |
| 836 | + | |
836 | 837 | | |
837 | 838 | | |
838 | 839 | | |
| |||
846 | 847 | | |
847 | 848 | | |
848 | 849 | | |
849 | | - | |
| 850 | + | |
850 | 851 | | |
851 | 852 | | |
852 | 853 | | |
| |||
1015 | 1016 | | |
1016 | 1017 | | |
1017 | 1018 | | |
1018 | | - | |
| 1019 | + | |
1019 | 1020 | | |
1020 | 1021 | | |
1021 | 1022 | | |
| |||
1151 | 1152 | | |
1152 | 1153 | | |
1153 | 1154 | | |
1154 | | - | |
| 1155 | + | |
1155 | 1156 | | |
1156 | 1157 | | |
1157 | 1158 | | |
1158 | | - | |
| 1159 | + | |
1159 | 1160 | | |
1160 | 1161 | | |
1161 | 1162 | | |
| |||
1213 | 1214 | | |
1214 | 1215 | | |
1215 | 1216 | | |
1216 | | - | |
| 1217 | + | |
1217 | 1218 | | |
1218 | 1219 | | |
1219 | | - | |
| 1220 | + | |
1220 | 1221 | | |
1221 | 1222 | | |
1222 | 1223 | | |
| |||
1257 | 1258 | | |
1258 | 1259 | | |
1259 | 1260 | | |
1260 | | - | |
| 1261 | + | |
1261 | 1262 | | |
1262 | | - | |
| 1263 | + | |
1263 | 1264 | | |
1264 | 1265 | | |
1265 | 1266 | | |
| |||
1293 | 1294 | | |
1294 | 1295 | | |
1295 | 1296 | | |
1296 | | - | |
1297 | 1297 | | |
1298 | 1298 | | |
1299 | 1299 | | |
1300 | | - | |
1301 | | - | |
1302 | | - | |
1303 | | - | |
1304 | | - | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
1305 | 1308 | | |
1306 | 1309 | | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
1307 | 1315 | | |
1308 | 1316 | | |
1309 | 1317 | | |
| |||
1345 | 1353 | | |
1346 | 1354 | | |
1347 | 1355 | | |
1348 | | - | |
| 1356 | + | |
1349 | 1357 | | |
1350 | 1358 | | |
1351 | 1359 | | |
| |||
1361 | 1369 | | |
1362 | 1370 | | |
1363 | 1371 | | |
1364 | | - | |
| 1372 | + | |
1365 | 1373 | | |
1366 | 1374 | | |
1367 | 1375 | | |
1368 | | - | |
| 1376 | + | |
1369 | 1377 | | |
1370 | 1378 | | |
1371 | 1379 | | |
1372 | | - | |
| 1380 | + | |
1373 | 1381 | | |
1374 | 1382 | | |
1375 | 1383 | | |
| |||
0 commit comments