Commit ee66b80
Karl (via Dazlarus)
fix: checkpoint WAL on live per-agent DB after publishMemoryDatabaseTables
The WAL checkpoint was inside writeMeta() which runs against the
shadow/temp database during full reindex. The meta row gets copied
to the live per-agent DB by publishMemoryDatabaseTables, so the
checkpoint must happen on originalDb (the live DB) after publish
returns — not on the shadow DB where writeMeta wrote it.
This ensures the meta row is durable on disk before the process
moves on. Without it, a crash between publish and close can leave
meta only in the WAL file, causing the next startup to declare the
index missing.
Updates test comments to reflect the new checkpoint location.1 parent 05572d2 commit ee66b80
2 files changed
Lines changed: 20 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2793 | 2793 | | |
2794 | 2794 | | |
2795 | 2795 | | |
| 2796 | + | |
| 2797 | + | |
| 2798 | + | |
| 2799 | + | |
| 2800 | + | |
| 2801 | + | |
| 2802 | + | |
| 2803 | + | |
| 2804 | + | |
| 2805 | + | |
| 2806 | + | |
| 2807 | + | |
2796 | 2808 | | |
2797 | 2809 | | |
2798 | 2810 | | |
| |||
2859 | 2871 | | |
2860 | 2872 | | |
2861 | 2873 | | |
2862 | | - | |
2863 | | - | |
2864 | | - | |
2865 | | - | |
2866 | | - | |
2867 | | - | |
2868 | | - | |
2869 | | - | |
2870 | | - | |
2871 | | - | |
2872 | 2874 | | |
2873 | 2875 | | |
2874 | 2876 | | |
Lines changed: 8 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
119 | 120 | | |
120 | 121 | | |
121 | 122 | | |
| |||
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
135 | | - | |
136 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
137 | 139 | | |
138 | 140 | | |
139 | 141 | | |
| |||
0 commit comments