Skip to content

Append commit instead of individual transactions to commitlog#4404

Open
kim wants to merge 27 commits intomasterfrom
kim/commitlog/append-commit-reopen
Open

Append commit instead of individual transactions to commitlog#4404
kim wants to merge 27 commits intomasterfrom
kim/commitlog/append-commit-reopen

Conversation

@kim
Copy link
Contributor

@kim kim commented Feb 23, 2026

Re-open #4140 (reverted in #4292).

The original patch was merged a bit too eagerly.
It should go in after 2.0 is released with some confidence.

kim added a commit that referenced this pull request Feb 24, 2026
Cherry-picked from #4404
Better default for confirmed reads (which are the default since #4390).
kim added a commit that referenced this pull request Feb 24, 2026
github-merge-queue bot pushed a commit that referenced this pull request Feb 24, 2026
Cherry-picked from #4404
Better default for confirmed reads (which are the default since #4390).
kim added a commit that referenced this pull request Feb 26, 2026
Instead of periodic flush + sync, the simplified commitlog buffering
makes it easy to just pop a batch of transaction from the queue, commit
them, and then flush + sync after each batch.

This may lead to an overall higher number of fsyncs on the system, but
also adapts to the tx throughput of the individual database (up to the
batch size).

After taking some measurements, we may want to make the batch size
configurable at runtime.

Depends-on: #4404
@kim kim mentioned this pull request Feb 26, 2026
@Shubham8287
Copy link
Contributor

Is this same patch as reverted one or anything else?


data = txdata_rx.recv() => {
let Some(txdata) = data else {
tx = transactions_rx.recv() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use a recv_many here (which will receive up to some number of messages, but always complete as soon as there are any messages)? It seems like that would give us the eager flushing behavior we want without actually flushing for every transaction.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, sorry for the stacked PRs -- this is done via #4478

Instead of periodic flush + sync, the simplified commitlog buffering
makes it easy to just pop a batch of transaction from the queue, commit
them, and then flush + sync after each batch.

This may lead to an overall higher number of fsyncs on the system, but
also adapts to the tx throughput of the individual database (up to the
batch size).

After taking some measurements, we may want to make the batch size
configurable at runtime.

Depends-on: #4404
github-merge-queue bot pushed a commit that referenced this pull request Feb 28, 2026
# Description of Changes

This does 3 things to the keynote-2 benchmark:
- it changes the default alpha to 1.5, which we actually tested the
other services with
- it turns on confirmed reads (not the default for < 2.0)
- it removes warmup

This was tested on
#4404 to have no impact
on the TPS throughput of spacetimedb.
**This PR shouldn't be merged before #4404 has.**

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

This tweaks a bench test.
@kim
Copy link
Contributor Author

kim commented Feb 28, 2026

Is this same patch as reverted one or anything else?

It's the same.

Well, it's no longer the same, because #4478 got merged into this one.
I intended this one to merge, then #4478, not squash both.

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.

3 participants