SE の雑記

SQL Server の情報をメインに Microsoft 製品の勉強内容を日々投稿

Archive for the ‘SQL Database’ tag

SQL Database に接続する際の接続フローについて

leave a comment

2020/7/1 に SQL Database で次のような障害が発生しました。

7/1

Azure SQL Database – Japan East – Mitigated (Tracking ID CLCK-LD0)

Summary of Impact: Between 09:30 and 11:15 UTC on 01 Jul 2020, a subset of customers using SQL Database in Japan East may have experienced service connection failures or possible timeouts. Services utilizing SQL Databases may have also been impacted.

Preliminary Root Cause: We determined that instances of a gateway service responsible for handling traffic to and from some SQL Databases became unhealthy. This prevented some connections from completing as expected and caused downstream impact to services leveraging SQL Databases.

Mitigation: We performed a manual restart of the impacted gateways to mitigate the issue.

Next Steps: We will continue to investigate to establish the full root cause and prevent future occurrences. A full Root-Cause Analysis will be provided in the next 72 hours. Stay informed about Azure service issues by creating custom service health alerts: https://aka.ms/ash-videos for video tutorials and https://aka.ms/ash-alerts for how-to documentation.

最終的な RCA (Root Cause Analysis : 根本原因解析) としては、次のような内容が公開されています。

Summary of impact: Between 09:24 and 11:15 UTC on 01 Jul 2020, a subset of customers using Azure SQL Database, Azure SQL Data Warehouse/ Synapse analytics in Japan East may have experienced service connection failures or possible timeouts. Services utilizing SQL Databases may have also been impacted.

Root cause: Connections to Azure SQL Database and related data services go through a load balanced set of front-end nodes (Gateways) that provide directory lookup services and reroute the incoming connections to the intended backend-end nodes hosting the database. For scalability and zone redundancy purposes, there are multiple active SQL Gateway clusters in a region. During this incident, one of the SQL Gateway clusters became unhealthy having an intermittent impact on login availability. A specific network traffic pattern combined with a networking stack configuration on the SQL Gateway instances triggered an imbalance on the CPU processing of new connection requests. The persistence of such CPU imbalance over a long period of time caused high response latency and increased timeouts on connection requests. The error condition propagated across multiple instances of the SQL Gateway cluster in this region, sometimes causing a service restart.

Mitigation: Multiple SQL Gateway instances became healthy upon the triggered service restart. On further investigation, we were able to isolate the specific network pattern and the configuration setting that caused this incident and were able to reconfigure the traffic to prevent a recurrence.

Next Steps: We apologize for the impact to affected customers. We are continuously taking steps to improve the Microsoft Azure platform and our processes to help ensure such incidents do not occur in the future. In this case, this includes (but is not limited to):

  • Fix the underlying issue that causes service restart when such a condition occurs.
  • Improve the alerting logic and add identified telemetry to diagnose this kind of issues faster.
  • Activate a newer SQL Gateway cluster in this region with a more efficient networking stack configuration that reduces the chances of hitting a processing imbalance.

障害の原因としては、「SQL Gateway クラスタ」の一つで問題が発生し、新規接続要求の CPU 処理の問題や、エラーが複数の SQL Gateway クラスターに伝搬しサービスが再起動してしまい、ログインと可用性に断続的に影響を与えたということになっています。

この障害が発生していた際には、既存の接続ついては接続が維持できていたが、新規の接続が許可されないというような状態になっていた環境もあったのではないでしょうか。

障害が発生している最中に、新規の接続を試してみたのですが、SQL Database の論理サーバー名への接続を行おうとしてもタイムアウトが発生 / Pre-Login のフェーズまでは進んだが、そこから先に進むことができず、エラーとなるというような状態となっており、新規の接続を確立することができませんでした。

障害が回復した後に、SQL Database のセッションの状態や起動タイミングを確認してみたところ、データベースについては再起動が行われておらず、いくつかのセッションについては接続が切断されず残ったままとなっていましたので、私の環境については、データベースでは問題は発生しておらず、ゲートウェイ経由での接続のみ問題が発生していたようでした。

 

以前、SQL Database v12 の接続のリダイレクトについて という投稿を書いたのですが、改めて、SQL Database に接続する際には、どのような動作が行われているのかをまとめてみたいと思います。

 

Read the rest of this entry »

Written by Masayuki.Ozawa

7月 7th, 2020 at 10:10 pm

Managed Instance のロードマップ (2020/5 版)

leave a comment

Build 2020 のセッションでは、発表はなかったようなのですが、先月開催されていた、DataPlatformGeeks Virtual Symposium ので Start modernizing your workloads at scale with Managed InstanceSQL Database Managed Instance (マネージドインスタンス) のロードマップが公開されました。

このセッションで、どのような機能強化が予定されているのかが発表されたのかをまとめておきたいと思います。

現時点で実装されている機能については、次のようになっています。

image

Read the rest of this entry »

Written by Masayuki.Ozawa

6月 7th, 2020 at 9:27 pm

Build 2020 で発表された SQL Server / SQL Database 関連の情報

one comment

Build 2020 で発表された SQL Server / SQL Database に関連する情報を。

全体のニュースは MICROSOFT BUILD 2020BOOK OF NEWS から。

Read the rest of this entry »

Written by Masayuki.Ozawa

5月 20th, 2020 at 12:30 am

SQL Server / SQL Database パフォーマンスチューニング & トラブルシューティング シリーズ : クエリストアの有効化を例とした機能有効化による性能の影響調査 その 1

leave a comment

SQL Server のトラブルシューティングでは「特定の機能を有効化したことによる性能影響への調査」を実施することもあります。

今回は SQL Server 2016 で搭載された「クエリストア」の機能を例として、機能を有効にした場合の性能影響への調査のアプローチを考えてみましょう。

なお、今回の調査は本番環境ではなく、検証環境での調査を前提としています。

Read the rest of this entry »

Written by Masayuki.Ozawa

5月 17th, 2020 at 11:00 pm

Azure SQL 監査を仮想ネットワークとファイアウォールの背後にあるストレージアカウントに出力することが GA したので試してみる

leave a comment

Azure SQL Auditing to storage account behind Virtual Network and firewall now generally available でアナウンスがありましたが、Azure SQL Database の監査ログを、仮想ネットワークとファイアウォールのある背後にあるストレージアカウントに対して出力する機能が GA となりました。

これにより、閉じられたネットワークに対してのアクセスのみを許可しているストレージアカウントに監査ログ (サーバーレベル / DB レベルの監査の両方) の出力ができるようになります。

詳細については VNet とファイアウォールの背後にあるストレージ アカウントに対して監査を書き込む に記載されていますのでこちらを確認すれば問題ないと思いますが、関連する内容をいくつか検証してみようかと。

Read the rest of this entry »

Written by Masayuki.Ozawa

5月 15th, 2020 at 12:10 am

Posted in SQL Database

Tagged with

SQL Server / SQL Database パフォーマンスチューニング & トラブルシューティング シリーズ : sys.dm_exec_query_stats を使用したキャッシュされたクエリの分析 その 1

leave a comment

SQL Server と Azure SQL Database (Single Database (Elastic Pool) / Managed Instance / Hyperscale) でパフォーマンスチューニングやトラブルシューティングに利用できる情報を、本投稿のタイトルのシリーズでまとめていきたいと思います。

今回は「sys.dm_exec_query_stats」について紹介します。

Read the rest of this entry »

Written by Masayuki.Ozawa

5月 3rd, 2020 at 7:59 pm

SQL Server Management Studio を使いやすくするためのカスタマイズ

leave a comment

SQL Server Management Studio (SSMS) を使用するために、実施している設定のカスタマイズについてまとめておきたいと思います。

気づいたときにいろいろと追記していこうかと。

Read the rest of this entry »

Written by Masayuki.Ozawa

5月 2nd, 2020 at 3:02 pm

Azure Data Studio を使用した統計情報のヒストグラムの可視化

leave a comment

可視化の方法は様々なものが使用できますが、Azure Data Studio (ADS) にはグラフを作成するための機能がありますので、この機能を利用して SQL Server の統計情報のヒストグラムを可視化する方法を紹介したいと思います。

Read the rest of this entry »

Written by Masayuki.Ozawa

4月 30th, 2020 at 11:20 pm

Azure Data Studio で KQL の実行が可能になりました

leave a comment

The April 2020 release of Azure Data Studio is now available で Azure Data Studio 1.17.0 のリリースがアナウンスされました。

このリリースから Notebook で KQL Magic がサポートされ、KQL の実行が可能になったようです。

Read the rest of this entry »

Written by Masayuki.Ozawa

4月 29th, 2020 at 8:00 pm

Managed Instance で SQL DB にリンクサーバーを設定

leave a comment

Managed Instance (マネージドインスタンス) では、SQL Server に対してリンクサーバーを設定することができるようになっています。

これについては、Lesson Learned #63: It is possible to create Linked Server in Azure SQL Managed Instance? で解説がされていますが、どうやって設定するのかすっかり忘れていたのでメモとして残しておこうと思います。

Read the rest of this entry »

Written by Masayuki.Ozawa

3月 26th, 2020 at 9:46 am