Commit 1037de9f authored by Dimitrios Gogos's avatar Dimitrios Gogos
Browse files

docs: clarify AppInstanceStatus mapping and internal state representation in persistence model

parent 68fc0f9b
Loading
Loading
Loading
Loading
+6 −1
Changes for oeg/app-instance-flow.md: 6 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -638,7 +638,12 @@ Authorization: Bearer <sinkCredential access token>
| `ready` / `"completed"` | `ready` |
| `failed` / `"failed"` | `failed` |
| `terminating` | `terminating` |
| `terminated` | `terminated` |
| `terminated` | `unknown` |

> The vendored CAMARA `AppInstanceStatus` enum defines only `ready`, `instantiating`, `failed`,
> `terminating`, and `unknown` — there is no `terminated` value. `terminated` is an internal
> `app_instances.state`; on the wire it surfaces as `unknown`. It is deliberately **not** mapped to
> `terminating`, which would report a finished instance as still shutting down.

---

+1 −1
Changes for oeg/persistence-model.md: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -240,7 +240,7 @@ Indexes: `BTREE(operation_id)`, `BTREE(callback_registration_id)`.
| `app_deployment_id` | UUID FK -> `app_deployments` | NULLABLE; set only for `/deployments`-created instances |
| `app_registration_id` | UUID FK -> `app_registrations` | Owning app (ADR-0010) |
| `edge_cloud_zone_id` | UUID | The CAMARA `EdgeCloudZoneId` this instance runs in (= SRM `zone.id`, ADR-0013). Note: the outbound command field is named `targets[].resource_zone_id` (see [oeg/interface-contract.md](/oeg/interface-contract.md) §K.4) while the stored/inbound column here is `edge_cloud_zone_id` — same zone identity, deliberate naming asymmetry between the outbound-to-SRM and inbound/stored sides, not a drift bug. |
| `state` | VARCHAR(32) | Cached CAMARA-facing status (`instantiating`/`ready`/`failed`/`terminating`/`terminated`). Soft-terminate: `DELETE` publishes `command.srm.service.terminate`; on the matching `event.srm.operation.completed`, the row flips to `terminated` — it is not deleted (consistent with `app_registrations`' `REGISTERED`→`DELETED` pattern). |
| `state` | VARCHAR(32) | Cached instance state (`instantiating`/`ready`/`failed`/`terminating`/`terminated`). All but `terminated` are also CAMARA `AppInstanceStatus` values; `terminated` is internal-only and surfaces as `unknown` (see [oeg/app-instance-flow.md](/oeg/app-instance-flow.md) AppInstanceStatus Mapping). Soft-terminate: `DELETE` publishes `command.srm.service.terminate`; on the matching `event.srm.operation.completed`, the row flips to `terminated` — it is not deleted (consistent with `app_registrations`' `REGISTERED`→`DELETED` pattern). |
| `created_at` | TIMESTAMPTZ | |
| `updated_at` | TIMESTAMPTZ | |