Skip to content

Commit d41ba1a

Browse files
fix(ontoserver): remove allowScaledReadWrite, scaled read-write is unsupported
The chart exposed ontoserver.deployment.allowScaledReadWrite as an opt-out from the scaled read-only guard, with two shipped scaled-rw-envoy-experimental.yaml examples using it. That advertised a topology that does not exist. Ontoserver forces read-only on any scaled deployment. ProviderBase.checkReadOnly throws on `readonly || (scaled && scaledReadonly)`, and scaledReadonly defaults to true, so setting ontoserver.deployment.scaled rejects writes whatever else is configured. The upstream field comment states it exists only "to allow internal experimentation with scaled read-write deployment" — it is not a public knob, and the chart should not have surfaced one built on it. Removes the value, its schema entry, both experimental examples, and every public mention. The render-time guard no longer offers an escape hatch, and the README now leads the deployment-modes section with the constraint rather than burying it in a footnote. The scaledReadOnly env var collapses to a constant, since the read-write branch is now unreachable. Deliberately a fix rather than a breaking change: the option was inert, so nothing that worked is being taken away. A values file still carrying allowScaledReadWrite: true alongside type: scaled and isReadOnly: false now fails to render instead of deploying a server that rejects every write. Migrate by loading content with a single-instance read-write deployment and serving it scaled and read-only.
1 parent 2fd1ff1 commit d41ba1a

9 files changed

Lines changed: 34 additions & 239 deletions

File tree

charts/ontoserver/README.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,26 @@ The chart supports four deployment combinations controlled by `ontoserver.deploy
7474

7575
| | `single` | `scaled` |
7676
|---|---|---|
77-
| **`Deployment`** | One-replica Deployment | Multi-replica Deployment |
78-
| **`StatefulSet`** | One-replica StatefulSet (per-pod PVCs) | Multi-replica StatefulSet (per-pod PVCs) |
77+
| **`Deployment`** | One-replica Deployment | Multi-replica Deployment (read-only) |
78+
| **`StatefulSet`** | One-replica StatefulSet (per-pod PVCs) | Multi-replica StatefulSet (per-pod PVCs, read-only) |
79+
80+
> ### ⚠️ Scaled deployments are read-only. Scaled read-write is not supported.
81+
>
82+
> This is not a chart limitation and there is no flag to override it. **Ontoserver forces read-only
83+
> on any scaled deployment**: setting `ontoserver.deployment.scaled` makes the server reject writes
84+
> regardless of what else is configured, so a scaled read-write server is not a topology that exists.
85+
> The chart therefore refuses to render `type: scaled` with `isReadOnly: false` rather than deploy
86+
> something that cannot work.
87+
>
88+
> Load content with a **single-instance read-write** deployment, then publish it to a syndication
89+
> server and serve it from a **scaled read-only** cluster. See
90+
> [Production recommendations](#production-recommendations).
7991
8092
**Constraints:**
8193
- `scaled` requires `replicas` ≥ 2 (or 0 to scale to zero). `single` requires `replicas` < 2.
8294
- `scaled` deployments cannot use the Postgres sidecar — an external database is required.
83-
- `isReadOnly: true` is **required** for all scaled deployments — the chart refuses to render otherwise. Each replica maintains its own Lucene index on its own PVC, so content written through the round-robin Service is indexed only on the replica that served the write; requests that land on any other replica then fail. Integration tests confirm this on a scaled install: `ValueSet/$expand` and `CodeSystem/$validate-code` return HTTP 500 while the resources are present in the shared database and `$lookup` and `$translate` succeed. To ingest content, use a single-instance read-write deployment, then serve it scaled and read-only.
95+
- `isReadOnly: true` is **required** for all scaled deployments — the chart refuses to render otherwise, and there is no opt-out. Ontoserver itself forces read-only whenever the deployment is scaled, so a scaled read-write server does not exist to configure. Each replica also maintains its own Lucene index on its own PVC, so content written through the round-robin Service is indexed only on the replica that served the write; requests that land on any other replica then fail. Integration tests confirm this on a scaled install: `ValueSet/$expand` and `CodeSystem/$validate-code` return HTTP 500 while the resources are present in the shared database and `$lookup` and `$translate` succeed. To ingest content, use a single-instance read-write deployment, then serve it scaled and read-only.
8496
- `$closure` remains available in scaled read-only mode. It is a stateful operation, so it must always be routed to one specific pod — the chart provisions `<release>-ontoserver-pod0-service` for that and the `$closure` integration test verifies the routing.
85-
- Scaled read-write can be opted into with `allowScaledReadWrite: true`, as the `scaled-rw-envoy-experimental.yaml` examples do. It is untested, known-broken per the above, and **must not be used in production**.
8697
- `clusterName` sets `ontoserver.cluster.name` for auto-discovery, allowing independent scaled clusters on the same network. Defaults to `ontoserver` (the application default) when unset.
8798
- `StatefulSet` kind always provisions PVCs via `volumeClaimTemplates`. `Deployment` kind requires `persistence.enabledForDeployment: true` to use PVCs.
8899
- The `PodDisruptionBudget` is rendered **only for `scaled`** deployments. A single instance owns its Lucene index on a ReadWriteOnce PVC and must be replaced rather than kept available during a disruption, so a PDB there would block node drains without protecting anything. Set exactly one of `minAvailable` or `maxUnavailable` — both accept a whole number or a percentage string (`"25%"`), and the chart fails if both or neither are set. `minAvailable: 1` is the default, so clear it (`minAvailable: null`) when you want `maxUnavailable`.
@@ -129,6 +140,7 @@ ontoserver:
129140

130141
| `kind` | `type` | Database | Storage | Reason |
131142
|---|---|---|---|---|
143+
| *any* | `scaled` | *any* | *any* | **Read-write is not supported when scaled.** Hard rejected by the chart, and Ontoserver forces read-only on a scaled deployment regardless. There is no opt-in flag |
132144
| `Deployment` | `scaled` | Sidecar | — | Hard rejected by the chart — scaled deployments require an external database |
133145
| `Deployment` | `scaled` | External | `ReadWriteOnce` | All pods share one PVC; only one pod can mount it |
134146
| `Deployment` | `scaled` | External | `ReadWriteMany` | All pods share the same directory; Lucene `write.lock` conflicts corrupt indexes |
@@ -1177,8 +1189,7 @@ Requires the [External Secrets Operator](https://external-secrets.io/) installed
11771189
| `ontoserver.deployment.containerPort` | Container port Ontoserver listens on. Use 8080 for HTTP (ONTOSERVER_INSECURE=true) or 8443 for HTTPS (ONTOSERVER_INSECURE=false). | `8080` |
11781190
| `ontoserver.deployment.lifecycle` | Container lifecycle hooks (postStart / preStop). Passed through as-is to the container spec. | `{}` |
11791191
| `ontoserver.deployment.imagePullSecrets` | Additional pre-created image pull secrets to attach to the pod (merged with the chart-managed pull secret when imageCredentials are set) | `[]` |
1180-
| `ontoserver.deployment.isReadOnly` | Ontoserver in read‑only mode. Required to be true when type is scaled; see allowScaledReadWrite. | `true` |
1181-
| `ontoserver.deployment.allowScaledReadWrite` | Opt in to the unsupported scaled read-write topology. Each replica has its own Lucene index, so content written through the round-robin Service is only indexed on the replica that served the write and $expand / $validate-code fail on the others. Load content with a single-instance read-write deployment instead, then serve it scaled and read-only. | `false` |
1192+
| `ontoserver.deployment.isReadOnly` | Ontoserver in read‑only mode. Must be true when type is scaled — Ontoserver forces read-only on a scaled deployment regardless of this setting. | `true` |
11821193
| `ontoserver.deployment.replicas` | Number of replicas - min 2 for scaled deployment - can be set to 0 | `1` |
11831194
| `ontoserver.deployment.podManagementPolicy` | StatefulSet pod management policy (Parallel or OrderedReady); ignored when kind is Deployment. Parallel starts and replaces pods without waiting for Ready, so a multi-replica rolling update can leave the Service with no ready endpoint; OrderedReady waits for each pod to become Ready first. Immutable on a live StatefulSet - see the README for the --cascade=orphan recreate. | `Parallel` |
11841195
| `ontoserver.deployment.clusterName` | Cluster name for auto-discovery in scaled deployments (overrides the default "ontoserver" set in application.properties); ignored for single deployments | `""` |

charts/ontoserver/examples/aks/scaled-rw-envoy-experimental.yaml

Lines changed: 0 additions & 102 deletions
This file was deleted.

charts/ontoserver/examples/eks/scaled-rw-envoy-experimental.yaml

Lines changed: 0 additions & 109 deletions
This file was deleted.

charts/ontoserver/templates/deployment.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,12 @@ spec:
203203
value: "{{ .Release.Name }}-ontoserver-clustering-service"
204204
- name: ontoserver.deployment.scaled
205205
value: "true"
206+
{{- /* Internal Ontoserver flag, not a chart knob: it exists upstream only to let CSIRO
207+
experiment with scaled read-write, and it already defaults to true. Scaled
208+
deployments are read-only unconditionally, so this is always "true" here — the
209+
chart refuses to render a scaled read-write deployment. */}}
206210
- name: ontoserver.internal.deployment.scaledReadOnly
207-
{{- if required "ontoserver.deployment.isReadOnly is required" .Values.ontoserver.deployment.isReadOnly }}
208211
value: "true"
209-
{{- else }}
210-
value: "false"
211-
{{- end }}
212212
{{- if .Values.ontoserver.deployment.clusterName }}
213213
- name: ontoserver.cluster.name
214214
value: {{ .Values.ontoserver.deployment.clusterName | quote }}

charts/ontoserver/templates/statefulset.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,12 @@ spec:
198198
value: "{{ .Release.Name }}-ontoserver-clustering-service"
199199
- name: ontoserver.deployment.scaled
200200
value: "true"
201+
{{- /* Internal Ontoserver flag, not a chart knob: it exists upstream only to let CSIRO
202+
experiment with scaled read-write, and it already defaults to true. Scaled
203+
deployments are read-only unconditionally, so this is always "true" here — the
204+
chart refuses to render a scaled read-write deployment. */}}
201205
- name: ontoserver.internal.deployment.scaledReadOnly
202-
{{- if required "ontoserver.deployment.isReadOnly is required" .Values.ontoserver.deployment.isReadOnly }}
203206
value: "true"
204-
{{- else }}
205-
value: "false"
206-
{{- end }}
207207
{{- if .Values.ontoserver.deployment.clusterName }}
208208
- name: ontoserver.cluster.name
209209
value: {{ .Values.ontoserver.deployment.clusterName | quote }}

0 commit comments

Comments
 (0)