Repository navigation
Commit 76e3048
feat(database): add SQLite as a second backend (SPEC-028)
Introduce a backend-neutral database contract in internal/database whose
method sets mirror pgx's, so the 736 call sites change types only. The
database.url scheme selects the backend at startup: postgres:// keeps the
existing pgxpool implementation and passes SQL through untouched, while
sqlite:///absolute/path opens one WAL-mode file (synchronous=FULL, 0600,
immediate transactions) for a single node — VXLAN is refused.
SQLite support:
- modernc.org/sqlite (pure Go, CGO-free); golang-migrate database/sqlite
and source/iofs.
- A translation layer rewrites the PostgreSQL SQL the code already writes:
casts, = ANY($n), LIMIT NULL, FOR UPDATE and ~, and registers now(),
gen_random_uuid() and no-op advisory locks. Times, JSON, lists and []byte
are converted at the boundary. TestSQLConstructs fails the build on any
construct only PostgreSQL runs.
- Migrations live in one folder read through a per-backend view; SQLite
starts at a generated baseline (073). Migration 074 adds
volumes/snapshots.reserved_by on both backends, and TestSchemaParity
proves the 72 tables match.
Behavioural changes forced by holding one file per node:
- No transaction is held across storage, libvirt, network or HTTP work.
Cinder volume and snapshot creates reserve a creating row, build the
backing outside any transaction, then finalise; a per-node startup sweep
sets creates interrupted by a crash to error and reclaims their files.
- Nova rechecks binding quota under an advisory lock and answers 403
(Quota exceeded) instead of 413, matching upstream Nova.
Go 1.27.2. Adds a host-testing runbook and contracts under
docs/specs/028-sqlite-database-layer/.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Uwe Schwaeke <uwe.schwaeke@sap.com>1 parent 278d106 commit 76e3048
238 files changed
Lines changed: 16032 additions & 1696 deletions
File tree
- .github/workflows
- .specify/memory
- build/package
- charts/lightstack
- templates
- tests
- cmd
- lightstack-migrate
- lightstack
- deployments
- docs
- adr
- security
- specs/028-sqlite-database-layer
- checklists
- contracts
- internal
- cinder
- common
- compute
- console
- database
- dbtest
- glance
- health
- keystone
- metadata
- neutron
- nova
- teardown
- migrations
- pkg
- paths
- storage
- scripts
- test
- benchmark
- contract
- cinder
- neutron
- nova
- tools
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
| 40 | + | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
101 | 108 | | |
102 | 109 | | |
103 | 110 | | |
| |||
118 | 125 | | |
119 | 126 | | |
120 | 127 | | |
121 | | - | |
| 128 | + | |
122 | 129 | | |
123 | 130 | | |
124 | 131 | | |
| |||
158 | 165 | | |
159 | 166 | | |
160 | 167 | | |
| 168 | + | |
| 169 | + | |
161 | 170 | | |
162 | 171 | | |
163 | 172 | | |
| |||
212 | 221 | | |
213 | 222 | | |
214 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
215 | 317 | | |
216 | 318 | | |
217 | 319 | | |
| |||
339 | 441 | | |
340 | 442 | | |
341 | 443 | | |
342 | | - | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
343 | 447 | | |
344 | 448 | | |
345 | 449 | | |
| |||
386 | 490 | | |
387 | 491 | | |
388 | 492 | | |
389 | | - | |
| 493 | + | |
390 | 494 | | |
391 | 495 | | |
392 | 496 | | |
| |||
395 | 499 | | |
396 | 500 | | |
397 | 501 | | |
| 502 | + | |
398 | 503 | | |
399 | 504 | | |
400 | 505 | | |
| |||
417 | 522 | | |
418 | 523 | | |
419 | 524 | | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
420 | 530 | | |
421 | 531 | | |
422 | 532 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
0 commit comments