Repository navigation
Optimize relinking of orphaned job host summaries - #1144
Open
ssimpson89 wants to merge 1 commit into
Open
ssimpson89 wants to merge 1 commit into
ssimpson89 wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The lookup should deduplicate names in the database to prevent memory and transfer costs from growing with matching job history.
1 open issue
What changed in this PR
Optimizes inventory-import relinking introduced in #577 by skipping updates for hosts without orphaned job summaries while preserving the existing relinking filters.
Changes:
- Queries orphaned host names once per batch and updates only matching hosts.
- Adds regression tests for batch lookup counts and skipped updates.
| File | Description |
|---|---|
ascender/main/tests/functional/commands/test_inventory_import.py |
Adds query-count and no-orphan regression tests. |
ascender/main/management/commands/inventory_import.py |
Limits relinking updates to names with orphaned summaries. |
Review effort: Balanced
…s with actual orphans Signed-off-by: Stephen Simpson <ssimpson89@users.noreply.github.com>
ssimpson89
force-pushed
the
fix/relink-orphaned-summaries-per-host-update
branch
from
October 24, 2026 23:13
6d4651f to
6aa9f0d
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.

Fix per-host UPDATE regression in inventory import relink
Regressed in #577.
_relink_orphaned_job_host_summaries()ran oneUPDATEper host on every import, even when nothing was orphaned.It now selects the host names that have orphaned summaries once per batch and only updates those. Which rows get relinked is unchanged.