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

Explicit taskHub parameter for stored procedures #167

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

michaelplavnik
Copy link

Resolves issue #162.
Add TaskHubName parameter to all relevant SPs.
Add parameter to initialize TaskHubMode to the settings class.
NOTE: Breaking changes in vInstance and vHistory views usage in case of TaskHubMode=0.

…ter to the settings. Breaking changes in vInstance and vHistory views usage.
@michaelplavnik
Copy link
Author

@microsoft-github-policy-service agree

@cgillum
Copy link
Member

cgillum commented May 19, 2023

@michaelplavnik thanks for submitting this PR. I enabled the CI and it looks like some tests are failing because of inserting NULL into the TaskHub column.

Microsoft.Data.SqlClient.SqlException : Cannot insert the value NULL into column 'TaskHub', table 'DurableDB.dt2.Instances'; column does not allow nulls. INSERT fails.

Can you take a look?

@michaelplavnik
Copy link
Author

@cgillum Thanks for being patient :-) I have update this PR. Could you please run tests again, in my environment I cannot run performance tests.

Copy link
Member

@cgillum cgillum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests appear to be passing now. :)

I have a couple concerns about this PR from a breaking-change perspective:

  • Adding @TaskHubName to all stored procedures - isn't this also a breaking change? Sprocs that don't start with _ are considered public API and we need to maintain backwards compatibility.
  • The modified CurrentTaskHub sproc seems to no longer consider APP_NAME(). Isn't this also technically a breaking change?

Is there any way to make these changes non-breaking? I'm less concerned about the changes to vInstances and vHistory.

@michaelplavnik
Copy link
Author

@cgillum You are correct of cause that changes are breaking (and in case of vInstances, vHistory also hidden). Now, I know that you prefer to keep it backward compatible (vs. explicit breaking change). Let's see if I can make it backward compatible in all cases.

TDEVMPJ added 3 commits June 3, 2023 19:19
…end of parameter list and make it optional. Restore presence of taskHubName in connection string by default. Call all functions with SP approach.
@michaelplavnik
Copy link
Author

@cgillum Finally got some time to remove braking changes. However, functions now have private implementation and non breaking public wrapper. Please advise if you want public wrapper with explicit parameter as well.

@bhugot
Copy link
Contributor

bhugot commented Aug 30, 2023

little bump on this @cgillum

Copy link
Member

@cgillum cgillum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay on this. It was a busy summer. Just a few small things.

/// </summary>
/// <seealso cref="SqlOrchestrationService.CreateAsync(bool)"/>
[JsonProperty("createMultiTennantTaskHub ")]
public bool CreateMultiTennantTaskHub { get; set; } = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to Wikipedia, "multitenant" is a single word with just one "n". This is also the spelling we use in our documentation. Let's update all the new code in this PR to use that spelling.

Example here:

Suggested change
public bool CreateMultiTennantTaskHub { get; set; } = true;
public bool CreateMultitenantTaskHub { get; set; } = true;

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

/// <summary>
/// Initializes a new instance of the <see cref="SqlOrchestrationServiceSettings"/> class.
/// </summary>
/// <param name="connectionString">The connection string for connecting to the database.</param>
/// <param name="taskHubName">Optional. The name of the task hub. If not specified, a default name will be used.</param>
/// <param name="schemaName">Optional. The name of the schema. If not specified, the default 'dt' value will be used.</param>
public SqlOrchestrationServiceSettings(string connectionString, string? taskHubName = null, string? schemaName = null)
/// <param name="connectionStringWithTaskHubName">Optional. When true task hub name is added to connection string.
/// Default value is <c>true</c> to match how connection pool behaved before introdcution of this parameter.</param>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Default value is <c>true</c> to match how connection pool behaved before introdcution of this parameter.</param>
/// Default value is <c>true</c> to match how connection pool behaved before introduction of this parameter.</param>

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@@ -19,6 +19,7 @@ namespace DurableTask.SqlServer
using DurableTask.Core.Query;
using DurableTask.SqlServer.SqlTypes;
using DurableTask.SqlServer.Utils;
using Dynamitey.DynamicObjects;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this being used or can it be removed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@michaelplavnik
Copy link
Author

Sorry for a long delay. I have merged latest changes for main. In addition, I have added ability to set connection string as environment variable for integration tests.

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

Successfully merging this pull request may close these issues.

3 participants