Skip to content

commitlog: Don't lock while compressing#4981

Merged
joshua-spacetime merged 2 commits into
masterfrom
kim/commitlog/dont-lock-while-compressing
May 9, 2026
Merged

commitlog: Don't lock while compressing#4981
joshua-spacetime merged 2 commits into
masterfrom
kim/commitlog/dont-lock-while-compressing

Conversation

@kim
Copy link
Copy Markdown
Contributor

@kim kim commented May 8, 2026

Commitlog compression is coordinated externally, and it is safe to compress the same segment concurrently. Therefore, we can release the lock before starting the actual compression work, thereby avoiding to interfere with writes.

Also, return an error if the mutable segment is requested to be compressed, instead of panicking.

Commitlog compression is coordinated externally, and it is safe to
compress the same segment concurrently. Therefore, we can release the
lock before starting the actual compression work, thereby avoiding to
interfere with writes.

Also, just ignore the currently active segment instead of panicking.
@kim kim force-pushed the kim/commitlog/dont-lock-while-compressing branch from dd087f0 to 9f401b5 Compare May 8, 2026 11:12
@joshua-spacetime joshua-spacetime enabled auto-merge May 8, 2026 20:43
@joshua-spacetime joshua-spacetime added this pull request to the merge queue May 9, 2026
Merged via the queue into master with commit ae523db May 9, 2026
136 of 141 checks passed
zvervospacetimedb pushed a commit to zvervospacetimedb/SpacetimeDB that referenced this pull request May 11, 2026
# Description of Changes

This reverts commit ca1b45f since after
clockworklabs#4981 we no longer hold
the lock while compressing.

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

N/A
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