Repository navigation
Issue 3721 - #4003
Merged
Merged
Issue 3721#4003
Conversation
Contributor
|
Schema Change Detected. Needs ingestion-core version bump Please run |
|
[catalog] Kudos, SonarCloud Quality Gate passed! |
11 tasks done
harshach
added a commit
that referenced
this pull request
May 8, 2026
…cade Two follow-up improvements to the bulk restore introduced for #4003. Batched findTo per tree level: bulkRestoreSubtree previously issued one findTo per parent during recursion, which at the schemas → tables level of a 12k-table database meant 12k DB round trips just to enumerate children. The new bulkRestoreContainedChildren helper does one findToBatchAllTypes per tree level regardless of fan-out, then groups the results by child type and dispatches to each repo's bulkRestoreSubtree. DashboardRepository's chart-restore logic moves from the now-bypassed restoreChildren override to the existing restoreAdditionalChildren extension hook so it still runs both for direct dashboard restores and when dashboards are descendants of a larger restore. Symmetric bulk soft-delete cascade: deleteByName/deleteById had the same per-entity recursion that this PR fixed for restore — soft- deleting a database with 12k tables ran 12k recursive Entity.deleteEntity calls, each writing one row + one ES update + one change event. New bulkSoftDeleteSubtree mirrors bulkRestoreSubtree: one batched findToBatchAllTypes per level, deferred-store DB writes, batched version history, batched change events, batched cache invalidation; per-descendant ES writes are skipped because the existing deleteFromSearch cascade flips the deleted flag on descendant indexes in one update_by_query. deleteChildren(List, hardDelete=false, ...) now dispatches to the bulk path; hard-delete keeps the existing batchDeleteChildren path. New softDeleteAdditionalChildren extension hook mirrors restoreAdditionalChildren; DashboardRepository's chart soft-delete migrates onto it for the same reason. Tests: extends EntityRepositoryRestoreTest with cases that verify findToBatchAllTypes is invoked exactly once per level (not once per parent) for both bulk operations, plus the existing grouping/dispatch shape for the soft-delete entry point. Extends RestoreHierarchyIT with a recursive soft-delete cascade assertion. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
harshach
added a commit
that referenced
this pull request
May 12, 2026
So mark-deletion cascades during ingestion stop blocking on the server's recursive walk (issue #4003 mirror on the ingestion side). Legacy OpenMetadata client: - delete_async(entity, id, recursive, hard_delete) hits DELETE /<entity>/async/{id}?recursive=...&hardDelete=... - restore_async(entity, id) hits PUT /<entity>/restore?async=true Both return the 202 payload (jobId + message) so the caller can correlate the dispatch with WebSocket notifications. Sink integration: - DeleteEntity model gains a dispatch_async flag (default False). - delete_entity_from_source / delete_entity_by_name accept an explicit dispatch_async= or fall back to the OM_INGESTION_DELETE_ASYNC env var via _default_dispatch_async(). This lets operators flip the entire ingestion process to async cascades with a single env var, with no per-connector schema changes. - MetadataRestSink.delete_entity routes through metadata.delete_async when DeleteEntity.dispatch_async is set, logging the returned jobId for operator correlation. Backend tweaks: - EntityResource.restoreEntityAsync's pre-check now distinguishes the two raw EntityNotFoundException failure modes — 404 if the entity truly doesn't exist (Include.ALL still misses) vs 400 if it exists but isn't soft-deleted. - Add a Javadoc "operational ceiling" note to bulkRestoreSubtree / bulkSoftDeleteSubtree calling out the single-@transaction shape and the implication for concurrent restores against a small DB pool; chunked-transaction support tracked as a follow-up. Tests: - New pytest cases in test_ometa_restore.py for the two async client methods (URL shape + 202 payload pass-through). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
harshach
added a commit
that referenced
this pull request
May 21, 2026
* fix(restore): bulk + async restore for large entity hierarchies EntityRepository.restoreEntity walked descendants synchronously, taking 4+ minutes on a 12k-table database and exceeding typical proxy timeouts. restoreChildren now groups CONTAINS children by type and dispatches one bulkRestoreSubtree per type, batching DB writes, version history, change events, and cache invalidation; the existing ES cascade handles descendant index updates in one update_by_query. Adds an async option (?async=true) on the deep-hierarchy restore endpoints that returns 202 Accepted with a job id and runs the restore on AsyncService, emitting WebSocket notifications on restoreEntityChannel. Java SDK adds .restore().async().execute() fluent builders on Tables/Databases plus restoreServerAsync on EntityServiceBase; Python SDK mirrors this with restore_request().with_async().execute() and restore_async() helpers on BaseEntity, exposing a new AsyncJobResponse type. Tests: EntityRepositoryRestoreTest verifies the per-type grouping and bulk dispatch path; RestoreFluentAPITest covers the Java SDK fluent behavior; RestoreHierarchyIT exercises sync and async restore against a real DB→schemas→tables tree end-to-end; test_restore_async.py covers the Python SDK paths. Fixes #4003
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.








Describe your changes :
I worked on the ..... because ...
Type of change :
Frontend Preview (Screenshots) :
For frontend related change, please link screenshots of your changes preview! Optional for backend related changes.
Checklist:
Reviewers