Repository navigation
fix(adonet): add missing CleanupDefunctSiloEntriesKey to Oracle clustering - #11246
Merged
ReubenBond merged 1 commit intoSep 15, 2026
Merged
Conversation
…ering Oracle-Clustering.sql never defined CleanupDefunctSiloEntriesKey. Since DbStoredQueries validates that every required key is present in its constructor, a silo using ADO.NET clustering on Oracle fails fast at startup with: System.ArgumentException: Not all required queries found. Missing are: CleanupDefunctSiloEntriesKey This is the same gap fixed for SQL Server in dotnet#8811, MySQL in dotnet#8896 and PostgreSQL in dotnet#9125; Oracle was the last backend still missing the query. The 3.7.0 migration that was meant to supply it does not work either. All four 3.7.0 migrations were added together in 4702095 (dotnet#7928) when CleanupDefunctSiloEntries was introduced; that commit touched no main clustering script, and the MySQL, SQL Server and PostgreSQL migrations all insert 'CleanupDefunctSiloEntriesKey'. The Oracle one instead names 'DeleteMembershipTableEntriesKey' while carrying the cleanup-defunct body, so the key and the body disagree. Because QUERYKEY is the primary key of ORLEANSQUERY and the setup script already inserts DeleteMembershipTableEntriesKey, that migration fails with ORA-00001 on any real database and never creates the new key. Had it applied, it would have replaced the real DeleteMembershipTableEntries query with one binding an :IAmAliveTime parameter the caller does not supply. Add the query to the setup script, next to DeleteMembershipTableEntriesKey as in MySQL-Clustering.sql, and correct the migration to insert the right key, guarded by a NOT EXISTS check so it is idempotent and safe on databases that already have the row - matching the guards used by the MySQL, SQL Server and PostgreSQL 3.7.0 migrations. Oracle's existing DeleteMembershipTableEntriesKey definition in the setup script is unchanged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
ReubenBond
force-pushed
the
fix/oracle-cleanup-defunct-silo-entries
branch
from
September 13, 2026 14:58
7478543 to
4fd1b9d
Compare
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The Oracle scripts consistently define the required query for fresh and migrated databases without unresolved issues.
Pull request overview
Adds Oracle support for the required cleanup query, preventing ADO.NET clustering startup failures.
Changes:
- Adds
CleanupDefunctSiloEntriesKeyto fresh Oracle installations. - Corrects and makes the Oracle 3.7.0 migration idempotent.
File summaries
| File | Description |
|---|---|
Oracle-Clustering.sql |
Defines the missing cleanup query. |
Migrations/Oracle-Clustering-3.7.0.sql |
Corrects the query key and safely avoids duplicates. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
ReubenBond
approved these changes
Sep 15, 2026
This was referenced Oct 3, 2026
Closed
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.
Solves #8676 for Oracle scripts by adding the missing query
CleanupDefunctSiloEntriesKey.Follows the same pattern as #8896 (MySQL) and #9125 (PostgreSQL). Oracle is the last ADO.NET backend still missing it.
Without the query, a silo configured for ADO.NET clustering on Oracle fails fast at startup, in the
DbStoredQueriesconstructor:The 3.7.0 migration does not supply it either
This gap survived the earlier per-backend fixes because the Oracle 3.7.0 migration is itself broken.
All four 3.7.0 migrations were added together in 4702095 (#7928), when
CleanupDefunctSiloEntrieswas introduced; that commit touched no main clustering script. The MySQL, SQL Server and PostgreSQL migrations each insertCleanupDefunctSiloEntriesKey. The Oracle one instead namesDeleteMembershipTableEntriesKey, while carrying the cleanup-defunct body:The key name and the body disagree, with two consequences:
QUERYKEYis the primary key ofORLEANSQUERY, andOracle-Clustering.sqlalready insertsDeleteMembershipTableEntriesKey. So the migration fails withORA-00001on any database created from the setup script, and never creates the new key.DeleteMembershipTableEntriesquery with one binding an:IAmAliveTimeparameter thatRelationalOrleansQueries.DeleteMembershipTableEntriesAsyncnever supplies.Changes
Oracle-Clustering.sql— addCleanupDefunctSiloEntriesKey, placed next toDeleteMembershipTableEntriesKeyas inMySQL-Clustering.sql. This is a pure addition; the existingDeleteMembershipTableEntriesKeydefinition is untouched.Migrations/Oracle-Clustering-3.7.0.sql— insert the correct key, guarded byWHERE NOT EXISTSso it is idempotent and safe on databases that already have the row, matching the guards used by the MySQL, SQL Server and PostgreSQL 3.7.0 migrations.The setup script and the migration now define the same query text, so a fresh install and a migrated deployment end up with the same
ORLEANSQUERYcontents.Testing
Verified against Oracle Database 23ai Free (
gvenzl/oracle-free:slim-faststart) in Docker, using four isolated schemas. The repository has no Oracle test fixture —test/Extensions/Orleans.AdoNet.Tests/RelationalUtilities/provides only SQL Server, MySQL and PostgreSQL — so this was done by hand. (TheDo_Liveness_OracleTest_*helpers inLivenessTests.csare misnamed shared helpers used by the other backends, not Oracle coverage.)Oracle-Main+ newOracle-ClusteringOracle-Main+ oldOracle-Clustering+ new migrationOracle-Main+ newOracle-Clustering+ new migrationOracle-Main+Oracle-Clustering+ old migrationORA-00001: unique constraint (ORLEANSQUERY_PK) violated ... row with column values (QUERYKEY:'DeleteMembershipTableEntriesKey') already existsThe last row reproduces the failure described above, confirming the old migration could never have been applied.
Further checks on the resulting databases:
ORLEANSQUERYcontents (symmetricMINUSover(QueryKey, QueryText)returns no rows), which is the property this PR is really about.DbStoredQueriesrequires — nothing missing, nothing extra.CleanupDefunctSiloEntriesKeytext was fetched fromORLEANSQUERYand executed as-is with the binds Orleans supplies (:DeploymentId,:IAmAliveTime) against seeded membership rows. It deleted only the defunct silo, correctly preserving theStatus = 3(Dead) entry, a recently-alive entry, and another deployment's entry.Unrelated observation
Running these scripts through plain SQL*Plus needs
SET SQLBLANKLINES ON(theCREATE TABLEstatements contain blank lines) and care around statement terminators: statements end with both;and a bare/, which makes SQL*Plus execute each one twice. That is pre-existing and affects all the Oracle scripts, so I have left it alone here.AI disclosure
This change was produced with Claude Code (Claude Opus 5). The audit that surfaced it — diffing each ADO.NET setup script against its migrations to check that the setup script alone reproduces a fully migrated database — was AI-assisted, as were the SQL edits, the testing described above and this description. I have reviewed the result.
🤖 Generated with Claude Code
Microsoft Reviewers: Open in CodeFlow