Repository navigation
Conversation
Code Review ✅ ApprovedFixes workflow cancellation and negative cache timing by deferring both operations through OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Port the fix from stacked PR #33365 onto the current retryable cleanup path. Workflow cancellation and negative-cache markers now wait for the outer transaction to commit; rollback discards both actions.
…ity (#33362) * test: pin hard-delete, subtree and transaction-boundary atomicity Add three integration tests that pin the transactional behaviour of EntityRepository on main using real commits counted through a delegating Jdbi TransactionHandler and a SqlLogger-based failure probe: - EntityTransactionBoundaryIT: nested executeInTransaction units commit once and publish post-commit actions after the outer commit, an outer failure rolls back nested writes and discards deferred actions, and custom-property replacement (removeExtensions + storeExtensions) keeps column-extension rows while committing once / rolling back together. - EntityHardDeletionAtomicityIT: deleteInternal and bulkHardDeleteSubtree commit once, roll back with an enclosing transaction (rows, extension rows and cached existence preserved), and roll back all dependent metadata when the entity-row delete fails. - EntitySubtreeAtomicityIT: bulk soft delete / restore inside an enclosing transaction rolls back rows and version history together. SqlFailureProbe injects a failure once after a matching SQL statement on the calling thread only, so background jobs are unaffected. Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix: defer hard-delete side effects until the owning commit Port the fix from stacked PR #33365 onto the current retryable cleanup path. Workflow cancellation and negative-cache markers now wait for the outer transaction to commit; rollback discards both actions. * fix: keep vanished database versions and RDF load out of parallel lanes Drop a history row when its required service relationship disappears during hydration. The new regression test failed before the guard and passes after it. Run the container-heavy RDF write recovery suite only in the dedicated RDF lanes, where CI still covers both database backends. * fix(cache): evict a committed cascade from Redis in one step, then drop L1 With the Redis cache on, an async restore of a database could leave its schemas answering 404 right after the restore committed. RestoreHierarchyIT.asyncRestore_returns202AndRestoresFullHierarchy failed in 7 of the 86 postgres-elasticsearch-redis parallel-lane runs whose commit contains #33866, and in none of the 188 without it. Since #33866 the cascade's children leave Redis only after commit, in drainCacheInvalidations, one entity at a time with about ten synchronous Redis calls each. The restored root still evicts inline in EntityUpdater, so it reads as restored the moment the transaction commits, while its children keep serving their soft-deleted copies until the drain reaches them. The test polls the database, then reads a schema inside that window. The drain now evicts the committed batch in one pass: - it bumps every write epoch first, so a loader that read the pre-commit row cannot write it back after the eviction; - it deletes every entity key (id hash, by-name and reference aliases) in one DEL, split only past 1,000 keys; - it evicts L1 after that DEL, since a reader in the window copies the stale Redis entry into L1 and nothing evicted it after the commit; - it re-arms EntityCacheRepair from the commit, because the repair armed inside the transaction fires 500 ms after that eviction, which a long transaction outlives. Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 9ce609c) * test(it): give the IT server the search pool sizes production ships TestSuiteBootstrap never set maxConnTotal or maxConnPerRoute, so the in-process server ran on the schema defaults: 10 connections to the single Elasticsearch host (30 total) instead of the 50/100 in conf/openmetadata.yaml. Under the parallel lane that pool stayed empty longer than connectionRequestTimeoutSecs (5 s), and requests failed with "error while performing request", Rest5Client's wrapper for the lease timeout. That is how SearchResourceIT.testEntityTypeCountsResponseFormat failed in the merge queue for #33338.
76a5bfe to
2ed90f9
Compare
Describe your changes:
Fixes #33360
Part of #32946. Stacked on #33362 (the atomicity pins), which supplies the
TransactionCounterandSqlFailureProbehelpers this test uses.A hard delete cancelled the entity's Flowable process instance and marked the entity missing in the negative cache as soon as its own
inTransactioncallback returned. When the delete runs inside an enclosingexecuteInTransaction, that callback only joins the outer transaction, so nothing had committed yet: a later rollback kept the entity row but its workflow instance was already gone and the negative cache already answered 404 for it. The comment incleanup()described the intended behaviour; it only held whencleanup()was the outermost transaction.Both effects now go through
PostCommitActionQueue.runOrDefer, the same outbox the lifecycle dispatcher and the RDF updater already use: an enclosing unit of work drains them after its own commit and discards them on rollback, and a standalone delete still runs them immediately, so the non-nested behaviour is unchanged.Type of change:
High-level design:
N/A — three call sites in
EntityRepository(cleanup(),bulkDeleteReferencesAndRows,bulkInvalidate) wrap the existing calls inrunOrDefer; no signature changes.Tests:
Use cases covered
Unit tests
Not applicable (behaviour is in the transaction boundary; covered by the integration tests below).
Backend integration tests
EntityHardDeletionAtomicityIT.workflowCancellationWaitsForTheEnclosingCommitrestored from Fixes 32946: Replace entity repository inheritance with composition #33248 (four combinations); it was removed from Fixes 33358: Pin hard-delete, subtree and transaction-boundary atomicity #33362 because it fails onmain(instance count 0 inside the transaction, expected 1; see Hard delete cancels governance workflow instances before the enclosing transaction commits #33360).postgres-os-redis): 10 run, 0 failures.enclosingRollbackPreservesRowsMetadataAndCachedExistencefails onmainonce a negative cache exists (isMarkedNotFoundByIdistrueafter the enclosing rollback), which is the second half of this bug; without Redis the assertion is skipped, which is why Fixes 33358: Pin hard-delete, subtree and transaction-boundary atomicity #33362 is green on the default lanes.Ingestion integration tests
Not applicable.
Playwright (UI) tests
Not applicable.
Manual testing performed
None beyond the automated runs above.
UI screen recording / screenshots:
Not applicable.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.Open workspace in Conductor