Skip to content

chore(release): staging to production - 2026.03.16 - #1024

Merged
maxtechera merged 7 commits into
productionfrom
staging
Mar 16, 2026
Merged

chore(release): staging to production - 2026.03.16#1024
maxtechera merged 7 commits into
productionfrom
staging

Conversation

@github-actions

Copy link
Copy Markdown

🚀 Release: Staging to Production

Release Date: 2026-03-16

Changes in this release

  • fix(AAIDomains): track source domain count separately from chunk count (9ad5106)
  • docs(documentstore): annotate SAVE_BATCH_SIZE with PostgreSQL parameter ceiling (1ce1227)
  • fix(docker): raise NODE_OPTIONS heap to 4096MB to stop OOM crashes (eaaefdd)
  • fix(docker): set Node.js heap to 384MB to match Render Standard 512MB container (dc9f186)
  • fix(documentstore): replace Promise.all individual saves with bulk insert in syncAndRefreshChunks (eac7c80)
  • fix(AAIDomains): keyset pagination + per-page splitting to fix OOM on large syncs (d1d04dc)

This PR is automatically created/updated when commits are pushed to staging.
Merging this PR will trigger the release workflow to create a new GitHub release.

… large syncs

- Replace offset .range() pagination with cursor-based keyset (.gt('id', lastId))
  eliminates O(n^2) Supabase scans on large tables
- Move textSplitter.splitDocuments() inside load() per page instead of
  splitting the entire 10k doc array after load() — eliminates dual large
  arrays in heap simultaneously
- Add textSplitter param to AAIDomainsLoaderParams and AAIDomainsLoader
- Fixes KUMELLO-68: OOM crashes when syncing 10k+ domains on Render Standard (512MB)

Other loaders unaffected — change is isolated to AAIDomains.ts only.
…sert in syncAndRefreshChunks

500 concurrent chunkRepository.save() calls per batch were opening 500
simultaneous DB connections to Supabase, causing connection pool exhaustion
and service crashes on large document stores (10k+ chunks).

Replace with single chunkRepository.insert(entities) per batch — same
pattern already used in _saveChunksToStorage. One SQL INSERT per batch
instead of 500 individual transactions.

Also adds sanitizeChunkContent() call to strip null bytes, consistent
with the _saveChunksToStorage implementation.
… container

NODE_OPTIONS was set to --max-old-space-size=8192 (8GB) but the Render
Standard plan only provides 512MB RAM. V8 GC wouldn't collect aggressively
because it believed it had 8GB of headroom, causing the OS to OOM-kill the
process at 512MB with no stack trace.

Setting to 384MB (512MB - ~128MB OS/overhead) forces V8 to GC proactively
and throw a JS heap error instead of a silent OOM kill.
- while loop now guards on fetchedDomainCount (source docs) not allDocs.length
  (chunks), so limit=N always means N source domains regardless of whether a
  textSplitter is active
- remainingItems calculation uses fetchedDomainCount, keeping page fetch size
  correctly calibrated to remaining source documents
- lastId cursor advanced only after docs are successfully pushed to allDocs,
  preventing silent data gaps on transient errors mid-page
- remove allDocs.slice(0, this.limit) — no longer correct when chunks > domains
- note insert() lifecycle-hook bypass at both call sites in documentstore service
fix(AAIDomains): keyset pagination + per-page splitting to fix OOM crashes (KUMELLO-68)
@vercel

vercel Bot commented Mar 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
answerai-docs Building Building Preview Mar 16, 2026 9:04pm
the-answerai Building Building Preview Mar 16, 2026 9:04pm

Request Review

@maxtechera
maxtechera merged commit ea80d04 into production Mar 16, 2026
8 checks passed
@maxtechera
maxtechera temporarily deployed to staging - aai-unified2-flowise-moonstruck March 16, 2026 21:05 — with Render Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant