Conversation
chuan137
requested review from
Carthaca,
crenduchinta88,
kpawar-sap,
skook1 and
sumitarora2786
as code owners
August 11, 2026 11:49
chuan137
force-pushed
the
share-server-lock-perf
branch
from
August 11, 2026 13:24
78ec6e7 to
9753d82
Compare
chuan137
force-pushed
the
share-server-lock-perf
branch
2 times, most recently
from
August 11, 2026 13:47
45b0262 to
f4f881c
Compare
Member
Author
…checks When creating a share, the scheduler evaluates all available share servers to find one within configured per-server limits. Previously this fetched full ORM objects for every share instance and snapshot on each server, loading large result sets into Python just to compute a count and a size sum. On busy backends with many shares per server this adds significant latency to every share creation request. Replace those fetches with two SQL aggregate queries (COUNT + SUM) per share server, returning only the scalar values needed. - share_instance_count_and_size_sum_by_server: returns (count, size_sum) in a single query joining ShareInstance -> Share - share_snapshot_size_sum_by_server: returns total snapshot size using COALESCE(instance_size, snapshot.size), mirroring the ORM size property; share-group snapshot members (snapshot_id=NULL) are excluded as their size cannot be resolved - Missing ShareInstance.deleted filter added to the snapshot query to exclude snapshots belonging to soft-deleted instances Change-Id: Idcd378c654c2fb7fbf867e9eb62991cd2cbcb017
chuan137
force-pushed
the
share-server-lock-perf
branch
from
August 11, 2026 14:14
f4f881c to
c3bd319
Compare
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.
When creating a share, the scheduler evaluates all available share
servers to find one within configured per-server limits. Previously this
fetched full ORM objects for every share instance and snapshot on each
server, loading large result sets into Python just to compute a count
and a size sum. On busy backends with many shares per server this adds
significant latency to every share creation request.
Replace those fetches with two SQL aggregate queries (COUNT + SUM) per
share server, returning only the scalar values needed.
share_instance_count_and_size_sum_by_server: returns(count, size_sum)in a single query joining
ShareInstance→Shareshare_snapshot_size_sum_by_server: returns total snapshot size usingCOALESCE(instance_size, snapshot.size), mirroring the ORMsizeproperty; share-group snapshot members (
snapshot_id=NULL) are excludedas their size cannot be resolved
ShareInstance.deletedfilter added to the snapshot query toexclude snapshots belonging to soft-deleted instances
Change-Id: Idcd378c654c2fb7fbf867e9eb62991cd2cbcb017