Repository navigation
perf(versioning): defer capture policy until versioned work #44928
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
Merged
rebenitez1802
merged 6 commits into
apache:master
from
mikebridge:sc-124084-lazy-capture-predicate
Oct 9, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
47b79b2
perf(versioning): defer capture policy until versioned work
mikebridge a199a77
test(versioning): link savepoint xfails to SC-124128
mikebridge 797b727
Merge remote-tracking branch 'origin/master' into sc-124084-lazy-capt…
mikebridge 161e928
Merge remote-tracking branch 'preset/master' into sc-124084-lazy-capt…
mikebridge d2d69c3
test(versioning): remove private tracker references from xfail reasons
mikebridge 3ea8bff
Merge apache master: retain lazy capture with savepoint rollback repair
mikebridge File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
Oops, something went wrong.
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.
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.
Not a blocker, more a scoping question. With
VERSIONING_CAPTURE_PREDICATEunset, which is the OSS default,capture_enabledis threeconfig.getcalls, so there is no host lookup left to defer and_has_versioned_workends up the more expensive of the two: measured per call on sqlite,capture_enabledis flat at about 0.9us while this helper is about 0.9us with 1 pending object, 4.7us at 50, 38us at 500 and 152us at 2000, and it runs 4 times per unrelated flush plus once at the commit. I could not see it at the commit level (a 2000 row unrelated commit measured 61 to 68ms here against 64 to 67ms on5a2f4c8e), andany()short circuits on the first versioned object so the versioned path is untouched. Is the intent that the win only lands for hosts that install a policy, or would apredicate is Nonefast path ahead of the scan be worth adding?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.
Thanks for the detailed comparison. On this tree the performance target is hosts with an installed predicate: when it's
None,capture_enableddoes no host lookup, while_has_versioned_workstill scans pending objects. Could we treat a default-policy fast path as a separate, measured optimization, with tests that preserve deferred decisions and finalizer sample semantics, rather than imply an OSS-default speedup here? The hygiene follow-up is ind2d69c3632.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.
That works for me. Agreed the win here is the installed predicate case, and a
predicate is Nonefast path is its own change with its own numbers, since it trades a config lookup for a scan that grows with the pending set. Nothing further from me on this thread.I also checked
d2d69c3632: bothreasonstrings lost the id andstrict=Trueplusraises=sa.exc.OperationalErrorare untouched, so the xfails still fail the suite if they ever start passing.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.
Thanks for checking. Agreed on keeping the default-policy fast path as a separate, measured optimization. One update since that snapshot:
3ea8bff9d7brings in master's #45033 savepoint fix, so the two former strict-xfail cases now pass and their markers were removed. An independent control confirmed they fail on #45033's parent and pass on the merge.