fixed index lock file error

This commit is contained in:
Carl Niklas Rydberg 2026-02-08 06:09:49 +01:00
parent f0e3768412
commit 081225ec07
2 changed files with 20 additions and 40 deletions

View file

@ -1,22 +1,22 @@
# Index Backend Repro (Isolated)
# Index Backend Verification (Isolated)
## Summary
With a fresh store root, `amduatd` on `--store-backend index` accepts the first
`/v2/graph/nodes` write, then fails on the second node write with `{"error":"store error"}`.
The same call sequence succeeds on `--store-backend fs`.
The previously reported isolated index-backend write failure is not reproducing on
current builds.
Observed daemon log on index:
Verified on **2026-02-08** with a fresh store root:
```text
ERROR: edge append failed for space/app1/daemon/edges (err=2)
```
- `POST /v2/graph/nodes` (node 1): HTTP 200
- `POST /v2/graph/nodes` (node 2): HTTP 200
- `POST /v2/graph/edges` (edge doc->topic): HTTP 200
- Control run on `--store-backend fs`: same sequence HTTP 200
- `./scripts/smoke_v2.sh` on index: PASS
- `./tests/integration_v2.sh` on index: PASS
`err=2` maps to `AMDUAT_ASL_COLLECTION_ERR_IO`.
## Re-Verification Procedure
## Minimal Repro
### 1) Start index backend
### 1) Start index backend (isolated root + socket)
```bash
STORE_BACKEND=index INDEX_BACKEND_PROBE=0 \
@ -44,42 +44,22 @@ curl --globoff --silent --show-error --unix-socket /tmp/amduatd-index-iso.sock \
http://localhost/v2/graph/edges
```
Expected: both nodes + edge succeed.
Actual on index: second node returns `{"error":"store error"}`, edge returns `{"error":"object not found"}`.
Expected: all three requests return HTTP 200.
### 3) Control check (fs backend)
Run the same payloads against fs:
```bash
STORE_BACKEND=fs STORE_ROOT=/tmp/amduat-asl-fs-iso \
SOCK=/tmp/amduatd-fs-iso.sock SPACE=app1 \
./scripts/dev_start_daemon.sh
```
All three calls succeed on `fs`.
Run the same three API calls. Expected: HTTP 200 for all calls.
## Likely Failure Path
## Regression Gate Recommendation
From source:
Use these as quick confidence checks when updating `vendor/amduat-api`:
- `vendor/amduat-api/src/amduatd_concepts.c`
- edge append path calls `amduat_asl_collection_append(...)`
- `vendor/amduat-api/vendor/amduat/src/core/asl_collection.c`
- `AMDUAT_ASL_COLLECTION_ERR_IO` comes from `amduat_asl_log_append(...)` failure
- `vendor/amduat-api/vendor/amduat/src/core/asl_log_store.c`
- failure likely in pointer/log append path (`pointer_get`, `store_get`, or `pointer_cas`)
## Targeted Upstream Patch Path
1. Add temporary diagnostic logging in `amduat_asl_log_append(...)` for:
- `pointer_name`
- `ptr_err` from `amduat_asl_pointer_get`
- `store_err` from `amduat_asl_store_get` / `amduat_asl_store_put`
- `cas_err` and retry exhaustion path
2. Re-run the minimal repro above and capture the first non-OK internal return.
3. Patch the specific failing branch in `asl_log_store.c` (or lower index store path)
rather than adding retries in app code.
4. Restore/commit missing graph index append scripts expected by CTest:
- `vendor/amduat-api/scripts/test_graph_index_append.sh`
- `vendor/amduat-api/scripts/test_graph_index_append_stress.sh`
- isolated 3-call index write sequence above
- `./scripts/smoke_v2.sh` on index backend
- `./tests/integration_v2.sh` on index backend

2
vendor/amduat-api vendored

@ -1 +1 @@
Subproject commit 444422ed01c6c02af1f7c9f4261cdd03cdbacfdd
Subproject commit 097c84d5aab68fb3fa18f9ca90dcce5f6c785286