-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
call_reducer_with_tx
: move work before/after tx lock aquire/release
#1099
Open
Centril
wants to merge
6
commits into
master
Choose a base branch
from
centril/reducer-hold-tx-less
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
Centril
added
enhancement
New feature or request
performance
energy-tracking
Changes related to measuring and tracking resources within SpacetimeDB
test-with-bots
Recommend to test under higher CCU
labels
Apr 16, 2024
Shubham8287
reviewed
Apr 16, 2024
kim
reviewed
Apr 16, 2024
cloutiertyler
previously requested changes
Apr 16, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment.
Centril
force-pushed
the
centril/reducer-hold-tx-less
branch
from
April 18, 2024 21:46
a82e483
to
10eb9d6
Compare
bfops
added
release-any
To be landed in any release window
and removed
performance
labels
Apr 22, 2024
1. Create ctx & clone tx_slot before taking tx lock. 2. Move an allocation before taking tx lock. 3. Move energy_monitor.record_reducer(..) to after releasing tx lock. 4. Move tracing & metrics work to after releasing tx lock.
Centril
force-pushed
the
centril/reducer-hold-tx-less
branch
from
May 15, 2024 11:26
84663d0
to
9f57c85
Compare
…ptions so we do not include energy, reducer span stuff, and long running reducer work in the duration.
Centril
force-pushed
the
centril/reducer-hold-tx-less
branch
from
May 28, 2024 09:35
9f57c85
to
c4f6d61
Compare
coolreader18
approved these changes
May 28, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
energy-tracking
Changes related to measuring and tracking resources within SpacetimeDB
enhancement
New feature or request
release-any
To be landed in any release window
test-with-bots
Recommend to test under higher CCU
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.
Description of Changes
Most of these were noticeable in the 380 CCU flame graph.
ctx
& clonetx_slot
before takingtx
lock.tx
lock.energy_monitor.record_reducer(..)
to after releasingtx
lock.tx
lock.Arc<ModuleEvent>
(last referent) to outside ofblocking_broadcast_event
, reducing the time thesubscriptions.read()
lock andtx
lock is held.record_metrics
after tx/subscription locks have been released.merge_apply_inserts
andmerge_apply_deletes
to update metrics at most once per table.API and ABI breaking changes
None
Expected complexity level and risk
3 - We've had deadlocks and threading issues in this code path before, so review the logic with care.
Testing
A playtest would be good to run before merging, primarily for safety reasons.