Commit 52e6fac
committed
fix(ducklake): disable data inlining by default + flush it in compaction + batch LP writes
Ports the memory/catalog-bloat fixes proven in the sibling ingest
service (hepic-lake-ingest) to Homer's DuckLake stack. Same storage
class (DuckDB/DuckLake + sqlite catalog + Parquet); the HEP write path
here is already well-batched (Appender + double-buffer + bulk flush),
but three gaps remained:
1. Data inlining default. DuckLakeConfig.DataInliningRowLimit defaulted
to -1 ("leave DuckLake's own default", which inlines ~10-row writes
into the catalog DB). Under streaming Line Protocol / OTLP / low-
volume HEP subtypes this turns the catalog into the dominant memory +
disk consumer (an 800 MB sqlite catalog backing only a few dozen
Parquet files, multi-GB RSS when DuckLake mirrors it in memory).
Default is now 0 (inlining off, always write Parquet). -1 and >0 are
still honoured for operators who want them.
2. No inline flush in maintenance. The CompactionService ran merge /
expire / cleanup / delete-orphaned but never ducklake_flush_inlined_data,
so anything already inlined (or inlined by an operator who re-enables
it) stayed in the catalog forever. Added a flush step at the start of
the maintenance cycle (before merge, so merge/expire act on the
freshly written Parquet). No-op when inlining is disabled.
3. Line Protocol micro-commits. The generic LP path issued one prepared
stmt.ExecContext per row = one DuckLake transaction (snapshot + tiny
write) per row. Replaced with chunked multi-row INSERT ... VALUES
(500 rows/statement), collapsing the per-row transaction/snapshot
churn by up to 500x. hep_proto_* LP and OTLP already batch per
request and are unchanged.
version.go is intentionally untouched — Homer's version is tag-driven
(version-sync.yml updates it from the release tag).1 parent 1abaef0 commit 52e6fac
3 files changed
Lines changed: 80 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
598 | 598 | | |
599 | 599 | | |
600 | 600 | | |
601 | | - | |
602 | | - | |
603 | | - | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
604 | 614 | | |
605 | 615 | | |
606 | 616 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
272 | | - | |
273 | | - | |
274 | | - | |
| 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 | + | |
275 | 317 | | |
276 | 318 | | |
277 | | - | |
| 319 | + | |
278 | 320 | | |
279 | | - | |
| 321 | + | |
280 | 322 | | |
281 | 323 | | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
298 | 327 | | |
299 | | - | |
| 328 | + | |
300 | 329 | | |
301 | 330 | | |
302 | 331 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
427 | 443 | | |
428 | 444 | | |
429 | 445 | | |
| |||
0 commit comments