Repository navigation
Commit f36ab45
committed
fix(store): normalize the Windows file-API path on every SQLite open
Root cause of the Cyrillic guard failure, found via the finalize diagnostics:
seal_existing rc=-1. The primary store open normalizes the path through
cbm_path_for_file_api (UTF-8 -> wide -> UTF-8, the form SQLite's Windows VFS
needs), but four maintenance opens passed the raw UTF-8 path:
cbm_store_seal_existing_path_for_replace (the one this path hits)
cbm_store_prepare_path_for_replace
cbm_store_backup_path (both source and staging)
cbm_store_dump_to_file
So a generation was WRITTEN through the normalized path and then could not be
RE-OPENED through the raw one. On the second index into a cache the seal step
failed, finalize returned PERSIST_FAILED, and the user was told "Check repo_path
exists and contains source files" about a repo that had just indexed cleanly
(nodes=12 edges=21 in the same worker log).
On POSIX cbm_path_for_file_api is a no-op memcpy, which is why the full 3-OS
ladder and every non-Windows test passed -- the defect is Windows-only and only
manifests on a path the raw UTF-8 -> SQLite open mishandles. It surfaced on the
Cyrillic case first because the guard indexes the same repo TWICE (once for the
count, once on retry), making it the first case to re-open an existing
generation; the earlier ASCII/latin1 cases index into fresh caches.
All four now use cbm_path_for_file_api exactly as the primary open does. Also
upgrades dump_to_file from sqlite3_open to sqlite3_open_v2 with explicit flags.
The finalize.prepare_failed / rename_failed diagnostics from the previous commit
stay: a silent PERSIST_FAILED that blamed the repo cost a day of remote bisection
and must never be silent again.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>1 parent 601dcbf commit f36ab45
1 file changed
Lines changed: 29 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1215 | 1215 | | |
1216 | 1216 | | |
1217 | 1217 | | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
1218 | 1222 | | |
1219 | | - | |
| 1223 | + | |
1220 | 1224 | | |
1221 | 1225 | | |
1222 | 1226 | | |
| |||
1237 | 1241 | | |
1238 | 1242 | | |
1239 | 1243 | | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
1240 | 1250 | | |
1241 | 1251 | | |
1242 | | - | |
| 1252 | + | |
1243 | 1253 | | |
1244 | 1254 | | |
1245 | 1255 | | |
1246 | 1256 | | |
1247 | 1257 | | |
1248 | | - | |
| 1258 | + | |
1249 | 1259 | | |
1250 | 1260 | | |
1251 | 1261 | | |
| |||
1354 | 1364 | | |
1355 | 1365 | | |
1356 | 1366 | | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
1357 | 1376 | | |
1358 | | - | |
| 1377 | + | |
1359 | 1378 | | |
1360 | 1379 | | |
1361 | 1380 | | |
| |||
1427 | 1446 | | |
1428 | 1447 | | |
1429 | 1448 | | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
1430 | 1454 | | |
1431 | | - | |
| 1455 | + | |
1432 | 1456 | | |
1433 | 1457 | | |
1434 | 1458 | | |
| |||
0 commit comments