LPD-X Skip the object definition settings read without any edge - #7584
Open
JhossephG wants to merge 2 commits into
Open
LPD-X Skip the object definition settings read without any edge#7584JhossephG wants to merge 2 commits into
JhossephG wants to merge 2 commits into
Conversation
ObjectDefinitionDeployerImpl.deploy read every root object definition IDs setting for the company on each deploy, an ObjectDefinitionSetting table query that ran even for companies with no object definition tree. A root object definition IDs setting only holds a value while an edge object relationship exists, since that value is written only through ObjectDefinitionTreeUtil's bind and unbind paths, both gated on an edge relationship, and an unbind leaves the row empty rather than deleting it. The deploy path now reuses the object relationships map it already loads, checks whether any relationship is an edge, and skips the setting read entirely when none is, passing an empty map instead. populateRootObjectDefinitionIds then caches an empty array per object definition, which is identical to the result the empty setting rows would have produced.
Verifies ObjectDefinitionDeployerImpl.deploy skips the rootObjectDefinitionIds setting table read when the company has no edge object relationship, and reads it when one exists. This guards the invariant the optimization depends on: the setting is only ever written through ObjectDefinitionTreeUtil's bind and unbind paths, both gated on an edge relationship, so a company without an edge can never have a meaningful row to miss.
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
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.
What Is Being Fixed
ObjectDefinitionDeployerImpl.deployread theObjectDefinitionSettingtable (rootObjectDefinitionIds) for the company on every deploy, even for companies with no object definition tree at all — an avoidable query that showed up in deploy/startup traces.How It Is Being Fixed
A root object definition IDs setting only ever holds a value while an edge object relationship exists: it's written exclusively through
ObjectDefinitionTreeUtil's bind/unbind paths, both gated on the relationship's edge flag, and unbind leaves the row present but empty rather than deleting it.deploynow reuses the object relationships map it already loads, checks whether any relationship is an edge, and skips the setting table read entirely when none is — passing an empty map topopulateRootObjectDefinitionIds, which produces the same cached result an all-empty settings table would have.A unit test (Mockito-based, in the same module) locks in this behavior: it asserts the setting read is skipped when no edge relationship exists, and happens when one does, guarding the invariant the optimization depends on.
Reproduces shuyangzhou#12385 with added test coverage.