Repository navigation
Commit 2acbd3b
committed
fix(store): ADR sidecar follow-ups from DeusData#2315 review
Three small items promised in the DeusData#2315 review; behaviour is otherwise
unchanged.
1. A failed ADR restore on artifact import is no longer silent
(src/pipeline/artifact.c). The import dropped both a failed reopen of
the installed DB and the status of
cbm_store_adr_restore_from_graph_if_absent, so a team ADR that never
reached the sidecar left no trace. The restore moves into
artifact_import_restore_adr, which logs
level=warn msg=artifact.import err=adr_restore detail=<store error>
path=<db> on either failure. The import still returns 0: the graph DB
is already installed when the restore runs, and the restore stays
best-effort as documented. adr_restore_if_absent now sets the store
error for its begin, copy and commit failures, so the logged detail
names the failing step.
2. The doc comment of adr_copy_legacy_once sat above adr_copy_rows,
stacked on top of the comment that documents adr_copy_rows, which left
adr_copy_legacy_once undocumented. It now sits above
adr_copy_legacy_once (src/store/store.c).
3. adr_restore_if_absent no longer inserts the migrated marker. That
INSERT OR IGNORE could never change state. Its only caller,
cbm_store_adr_restore_from_graph_if_absent, takes the sidecar handle
from adr_conn_write, which hands out a handle (cached or fresh) only
after adr_copy_legacy_once returned OK, and that function returns OK
only when the marker row is already committed (fast path, or the
re-check under the write lock) or it just inserted and committed it.
No code deletes an adr_meta row, so the insert hit the existing
primary key every time, and its result was discarded anyway.
Tests: artifact_import_logs_failed_adr_restore puts a directory at
<db>.adr.db (the hook-free trick from the DeusData#2315 pipeline test), then
asserts the import still succeeds, the graph DB is installed, and the
warn line carries the store reason. It is red without the artifact.c
change. artifact_export_roundtrip_keeps_adr now also asserts that the
fresh destination sidecar is marked migrated after the import, which
pins the invariant item 3 relies on.
Refs DeusData#2315
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>1 parent 3b46abe commit 2acbd3b
3 files changed
Lines changed: 89 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1130 | 1130 | | |
1131 | 1131 | | |
1132 | 1132 | | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
1133 | 1155 | | |
1134 | 1156 | | |
1135 | 1157 | | |
| |||
1257 | 1279 | | |
1258 | 1280 | | |
1259 | 1281 | | |
1260 | | - | |
1261 | | - | |
1262 | | - | |
1263 | | - | |
1264 | | - | |
1265 | | - | |
1266 | | - | |
1267 | | - | |
1268 | | - | |
1269 | | - | |
| 1282 | + | |
1270 | 1283 | | |
1271 | 1284 | | |
1272 | 1285 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12010 | 12010 | | |
12011 | 12011 | | |
12012 | 12012 | | |
12013 | | - | |
12014 | | - | |
12015 | | - | |
12016 | | - | |
12017 | | - | |
12018 | | - | |
12019 | | - | |
12020 | 12013 | | |
12021 | 12014 | | |
12022 | 12015 | | |
| |||
12070 | 12063 | | |
12071 | 12064 | | |
12072 | 12065 | | |
| 12066 | + | |
| 12067 | + | |
| 12068 | + | |
| 12069 | + | |
| 12070 | + | |
| 12071 | + | |
| 12072 | + | |
12073 | 12073 | | |
12074 | 12074 | | |
12075 | 12075 | | |
| |||
12106 | 12106 | | |
12107 | 12107 | | |
12108 | 12108 | | |
12109 | | - | |
| 12109 | + | |
| 12110 | + | |
| 12111 | + | |
| 12112 | + | |
12110 | 12113 | | |
12111 | 12114 | | |
| 12115 | + | |
12112 | 12116 | | |
12113 | 12117 | | |
12114 | 12118 | | |
| 12119 | + | |
12115 | 12120 | | |
12116 | 12121 | | |
12117 | 12122 | | |
12118 | | - | |
12119 | | - | |
12120 | | - | |
12121 | 12123 | | |
| 12124 | + | |
12122 | 12125 | | |
12123 | 12126 | | |
12124 | 12127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
255 | 270 | | |
256 | 271 | | |
257 | 272 | | |
| |||
391 | 406 | | |
392 | 407 | | |
393 | 408 | | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
394 | 445 | | |
395 | 446 | | |
396 | 447 | | |
| |||
1361 | 1412 | | |
1362 | 1413 | | |
1363 | 1414 | | |
| 1415 | + | |
1364 | 1416 | | |
1365 | 1417 | | |
1366 | 1418 | | |
| |||
0 commit comments