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

Refactor ReaderModificationCommandBatch #27584

Merged
1 commit merged into from
Mar 18, 2022

Conversation

roji
Copy link
Member

@roji roji commented Mar 7, 2022

Note: this PR is based on #27573, review only the last commit.

This refactors ReaderModificationCommandBatch to simplify the adding of ModificationCommands, applying them directly to the batch's SQL and parameters rather than deferring that for later.

  • Since SQL now gets add with every command, the SQL Server length check is now very cheap, and so I've removed the heuristic for doing it (we simply check every time). If we've gone over, we simply restart and re-add all the previous commands.
  • I don't think that the scenario where we go over the SQL length is perf-critical, but if it is, we can optimize it by just rolling back the last command instead of replaying the entire batch.
  • Note in our previous design, if a IsCommandTextValid occured in the middle of a pending bulk insert (eg. after 50 rows), that would cause that bulk insert to be terminated, resulting in multiple MERGE commands instead of one.

@roji roji force-pushed the UpdatePipeline/RefactorAddCommand branch from b5df3aa to e01f069 Compare March 14, 2022 14:51
@roji roji requested a review from AndriySvyryd March 14, 2022 15:02
@roji roji force-pushed the UpdatePipeline/RefactorAddCommand branch from e01f069 to 3ab3933 Compare March 14, 2022 19:57
@roji roji marked this pull request as ready for review March 14, 2022 21:14
@roji roji requested a review from AndriySvyryd March 15, 2022 17:37
@AndriySvyryd
Copy link
Member

I'll do the final review after #27573 is merged

@roji roji force-pushed the UpdatePipeline/RefactorAddCommand branch from 149f34b to 7b7b725 Compare March 17, 2022 11:29
@roji
Copy link
Member Author

roji commented Mar 17, 2022

@AndriySvyryd merged #27573 and rebased this.

@roji roji force-pushed the UpdatePipeline/RefactorAddCommand branch 2 times, most recently from 846ea71 to 9638595 Compare March 17, 2022 12:37
/// </summary>
/// <returns>
/// <see langword="true" />
/// <see langword="true" />.
Copy link
Member

Choose a reason for hiding this comment

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

No longer true :trollface:

Copy link
Member Author

Choose a reason for hiding this comment

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

But not entirely false either 😉

@roji roji force-pushed the UpdatePipeline/RefactorAddCommand branch from 9638595 to 7ed2757 Compare March 18, 2022 12:36
@ghost
Copy link

ghost commented Mar 18, 2022

Hello @roji!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost
Copy link

ghost commented Mar 18, 2022

Apologies, while this PR appears ready to be merged, I've been configured to only merge when all checks have explicitly passed. The following integrations have not reported any progress on their checks and are blocking auto-merge:

  1. Azure Pipelines

These integrations are possibly never going to report a check, and unblocking auto-merge likely requires a human being to update my configuration to exempt these integrations from requiring a passing check.

Give feedback on this
From the bot dev team

We've tried to tune the bot such that it posts a comment like this only when auto-merge is blocked for exceptional, non-intuitive reasons. When the bot's auto-merge capability is properly configured, auto-merge should operate as you would intuitively expect and you should not see any spurious comments.

Please reach out to us at fabricbotservices@microsoft.com to provide feedback if you believe you're seeing this comment appear spuriously. Please note that we usually are unable to update your bot configuration on your team's behalf, but we're happy to help you identify your bot admin.

* Allow flexible/alternative parameter strategies
* Insert commands and update SQL immediately

Closes dotnet#27583
@roji roji force-pushed the UpdatePipeline/RefactorAddCommand branch from 7ed2757 to ffa0159 Compare March 18, 2022 13:23
@ghost
Copy link

ghost commented Mar 18, 2022

Apologies, while this PR appears ready to be merged, I've been configured to only merge when all checks have explicitly passed. The following integrations have not reported any progress on their checks and are blocking auto-merge:

  1. Azure Pipelines

These integrations are possibly never going to report a check, and unblocking auto-merge likely requires a human being to update my configuration to exempt these integrations from requiring a passing check.

Give feedback on this
From the bot dev team

We've tried to tune the bot such that it posts a comment like this only when auto-merge is blocked for exceptional, non-intuitive reasons. When the bot's auto-merge capability is properly configured, auto-merge should operate as you would intuitively expect and you should not see any spurious comments.

Please reach out to us at fabricbotservices@microsoft.com to provide feedback if you believe you're seeing this comment appear spuriously. Please note that we usually are unable to update your bot configuration on your team's behalf, but we're happy to help you identify your bot admin.

@ghost ghost merged commit 44f1c24 into dotnet:main Mar 18, 2022
@roji roji deleted the UpdatePipeline/RefactorAddCommand branch March 18, 2022 17:31
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants