Skip to content

fix: upgrade slatedb to 0.11.2#331

Merged
cristi- merged 1 commit intomainfrom
cc/upgrade-slatedb-0.11.2
Mar 17, 2026
Merged

fix: upgrade slatedb to 0.11.2#331
cristi- merged 1 commit intomainfrom
cc/upgrade-slatedb-0.11.2

Conversation

@cristi-
Copy link
Member

@cristi- cristi- commented Mar 17, 2026

Summary

  • Upgrades slatedb from 0.11.1 to 0.11.2 to fix an unbounded memory leak in TransactionManager::track_recent_committed_write_batch
  • In 0.11.1, every non-transactional write batch unconditionally pushes a TransactionState (with cloned write keys) into an unbounded VecDeque. The deque is only drained on explicit transaction drop, which is infrequent in s2's append-heavy workload. This leads to OOM.
  • 0.11.2 includes slatedb/slatedb#1379 which drains the deque when no active transactions exist

Evidence

Heap profiles from a production instance showed memory growing from 423 MB → 911 MB in 50 minutes. The block cache plateaued at ~648 MB as expected, while track_recent_committed_write_batch and pinned key data grew unboundedly at ~6.7 MB/min (accelerating), putting a 3 GB container on track to OOM within hours.

Test plan

  • cargo check passes
  • CI passes
  • Deploy to staging and verify memory stabilizes after cache fills

🤖 Generated with Claude Code

Fixes unbounded memory growth in TransactionManager where every
non-transactional write batch accumulated TransactionState entries
in a VecDeque that was never drained, leading to OOM.

See slatedb/slatedb#1379

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 17, 2026

Greptile Summary

This PR upgrades slatedb from 0.11.1 to 0.11.2 to fix an unbounded memory leak in TransactionManager::track_recent_committed_write_batch, where non-transactional write batches were unconditionally pushed into an unbounded VecDeque that was only drained on transaction drop. The fix in 0.11.2 drains the deque when no active transactions exist, resolving a confirmed OOM regression on production.

  • Cargo.toml: Version specifier tightened from "0.11""0.11.2" (Cargo caret semantics: now requires >=0.11.2, <0.12.0 instead of >=0.11.0, <0.12.0)
  • Cargo.lock: Checksums for slatedb, slatedb-common, and slatedb-txn-obj updated to 0.11.2; several windows-sys transitive deps consolidated to 0.60.2/0.61.2
  • The change is minimal and well-scoped; no s2 application code is modified

Confidence Score: 5/5

  • This PR is safe to merge — it is a minimal, targeted dependency bump that fixes a confirmed production OOM with no application code changes.
  • Only two files change: Cargo.toml (one-line version specifier update) and Cargo.lock (checksum updates). The upstream fix is well-described and narrowly scoped to draining an internal VecDeque when no transactions are active. No s2 business logic is touched, and the risk of a regression is very low.
  • No files require special attention

Important Files Changed

Filename Overview
Cargo.toml Pins slatedb minimum version from "0.11" (>=0.11.0) to "0.11.2" (>=0.11.2), ensuring the memory-leak fix in 0.11.2 is always included
Cargo.lock Updates checksums for slatedb, slatedb-common, and slatedb-txn-obj to 0.11.2; several transitively-pulled windows-sys crates are consolidated to 0.60.2/0.61.2 as a result

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Write Batch arrives] --> B{Active transactions?}

    subgraph OLD["slatedb 0.11.1 (buggy)"]
        B1[Write Batch arrives] --> C1[Push TransactionState + cloned keys into VecDeque]
        C1 --> D1[VecDeque grows unboundedly]
        D1 --> E1[Drain only on transaction drop]
        E1 --> F1["OOM ⚠️"]
    end

    subgraph NEW["slatedb 0.11.2 (fixed)"]
        B2[Write Batch arrives] --> C2{Active transactions exist?}
        C2 -- Yes --> D2[Push TransactionState into VecDeque]
        C2 -- No --> E2[Drain VecDeque immediately]
        D2 --> F2[Drain on transaction drop]
        E2 --> G2[Memory stable ✅]
        F2 --> G2
    end
Loading

Last reviewed commit: 555b6f2

@cristi- cristi- merged commit 8660ca5 into main Mar 17, 2026
17 checks passed
@cristi- cristi- deleted the cc/upgrade-slatedb-0.11.2 branch March 17, 2026 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants