Commit 66197f5
authored
cmd/utils/app: implement
`seg index --rebuild` previously `panic("not implemented")`. Now it
deletes all accessor/index files and lets the existing `BuildMissed*`
passes regenerate them from the data files.
Removed (then rebuilt) per directory:
| Ext | Dir | Data file | Rebuilt by |
|-----|-----|-----------|-----------|
| `.idx` | `snapshots/` | `.seg` (blocks + caplin beacon) |
`br.BuildMissedIndicesIfNeed` / `caplinSnaps.BuildMissingIndices` |
| `.idx` | `snapshots/caplin/` | `.seg` (caplin state) |
`caplinStateSnaps.BuildMissingIndices` |
| `.vi` | `snapshots/accessor/` | `.v` |
`temporalDb.BuildMissedAccessors` |
| `.efi` | `snapshots/accessor/` | `.ef` |
`temporalDb.BuildMissedAccessors` |
| `.kvi` `.bt` `.kvei` | `snapshots/domain/` | `.kv` |
`temporalDb.BuildMissedAccessors` |
The removed set is exactly the set the build path regenerates — every
accessor type is covered (caplin state included), and only accessors are
touched; data files are left intact. `.torrent` sidecars of removed
accessors are deleted too.
Adds `Test_removeAccessorsForRebuild` covering removal of all six
accessor types + preservation of data files.seg index --rebuild (#21919)1 parent b521c4e commit 66197f5
2 files changed
Lines changed: 103 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2885 | 2885 | | |
2886 | 2886 | | |
2887 | 2887 | | |
| 2888 | + | |
| 2889 | + | |
| 2890 | + | |
| 2891 | + | |
| 2892 | + | |
| 2893 | + | |
| 2894 | + | |
| 2895 | + | |
| 2896 | + | |
| 2897 | + | |
| 2898 | + | |
| 2899 | + | |
| 2900 | + | |
| 2901 | + | |
| 2902 | + | |
| 2903 | + | |
| 2904 | + | |
| 2905 | + | |
| 2906 | + | |
| 2907 | + | |
| 2908 | + | |
| 2909 | + | |
| 2910 | + | |
| 2911 | + | |
| 2912 | + | |
| 2913 | + | |
| 2914 | + | |
| 2915 | + | |
| 2916 | + | |
| 2917 | + | |
| 2918 | + | |
| 2919 | + | |
| 2920 | + | |
| 2921 | + | |
| 2922 | + | |
| 2923 | + | |
| 2924 | + | |
| 2925 | + | |
| 2926 | + | |
| 2927 | + | |
| 2928 | + | |
| 2929 | + | |
| 2930 | + | |
| 2931 | + | |
| 2932 | + | |
| 2933 | + | |
| 2934 | + | |
| 2935 | + | |
| 2936 | + | |
2888 | 2937 | | |
2889 | 2938 | | |
2890 | 2939 | | |
| |||
2895 | 2944 | | |
2896 | 2945 | | |
2897 | 2946 | | |
2898 | | - | |
| 2947 | + | |
| 2948 | + | |
| 2949 | + | |
2899 | 2950 | | |
2900 | 2951 | | |
2901 | 2952 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1427 | 1427 | | |
1428 | 1428 | | |
1429 | 1429 | | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
0 commit comments