Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AdoNet Clustering: Missing CleanupDefunctSiloEntriesKey query #8676

Open
m3nax opened this issue Oct 19, 2023 · 3 comments
Open

AdoNet Clustering: Missing CleanupDefunctSiloEntriesKey query #8676

m3nax opened this issue Oct 19, 2023 · 3 comments

Comments

@m3nax
Copy link
Contributor

m3nax commented Oct 19, 2023

Problem:

When i run the project an exception was thrown

System.ArgumentException: 'Not all required queries found. Missing are: CleanupDefunctSiloEntriesKey

The CleanupDefunctSiloEntriesKey query is missing from the SQL script SQLServer-Clustering.sql, checked main and v7.2.2 branches

Used configuration:

file project.csproj

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>net7.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Orleans.Clustering.AdoNet" Version="7.2.2" />
    <PackageReference Include="Microsoft.Orleans.Persistence.AdoNet" Version="7.2.2" />
    <PackageReference Include="Microsoft.Orleans.Server" Version="7.2.2">
      <TreatAsUsed>true</TreatAsUsed>
    </PackageReference>
    <PackageReference Include="System.Data.SqlClient" Version="4.8.5">
      <TreatAsUsed>true</TreatAsUsed>
    </PackageReference>
  </ItemGroup>

</Project>

file: program.cs

const string connectionString = "***";

var builder = WebApplication.CreateBuilder(args);

builder.Host.UseOrleans(siloBuilder =>
{
    siloBuilder
        .Configure<ClusterOptions>(options =>
        {
            options.ClusterId = "Cluster42";
            options.ServiceId = "MyAwesomeService";
        })
        .UseAdoNetClustering(options =>
        {
            options.ConnectionString = connectionString;
            options.Invariant = "System.Data.SqlClient";
        })
        .ConfigureEndpoints(siloPort: 11111, gatewayPort: 30000);

    siloBuilder.AddAdoNetGrainStorage("batt", options =>
    {
        options.Invariant = "System.Data.SqlClient";
        options.ConnectionString = connectionString;
    });
});

var app = builder.Build();

app.Run();

Guide used:

Sql script used for Database creation:

Similar issue:

@ghost ghost added the Needs: triage 🔍 label Oct 19, 2023
@snovak7
Copy link

snovak7 commented Oct 19, 2023

@m3nax
Copy link
Contributor Author

m3nax commented Oct 25, 2023

Thanks, can I open a pull request to add the missing query to the clustering SQL script?
Anyone who starts using this project from version 7.2.x with clustering gets an error like me during startup.

@snovak7
Copy link

snovak7 commented Oct 25, 2023

I don't know what's the idea here, ideally there would be migration that would automatically deploy tables, I do this separately with init container in Kubernetes, other would be as a startup task? @ReubenBond any ideas or goals for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants