Conversation
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>
Contributor
Greptile SummaryThis PR upgrades
Confidence Score: 5/5
Important Files Changed
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
Last reviewed commit: 555b6f2 |
shikhar
approved these changes
Mar 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TransactionManager::track_recent_committed_write_batchTransactionState(with cloned write keys) into an unboundedVecDeque. The deque is only drained on explicit transaction drop, which is infrequent in s2's append-heavy workload. This leads to OOM.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_batchand 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 checkpasses🤖 Generated with Claude Code