[Bug] JDBC trace profiling query fails with SQL syntax error when the segment list is empty
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
調査の方向性
スタックトレース内の JDBCTraceQueryDAO.queryBySegmentIdList から始め、ProfileTaskQueryService.getTaskSegments がセグメント ID を渡す方法を追ってください。JDBC DAO のテストを確認し、空のコレクションの回帰ケースを追加する場所を探してください。サンプリングされたセグメントがないタスクが、不正な SQL を生成せずに空のリストを返せば完了です。
索引モデルが issue の本文から書いたものです。
説明
Search before asking
- I had searched in the issues and found no similar issues.
Apache SkyWalking Component
OAP server (apache/skywalking)
What happened
Opening trace profiling results for a task with no collected calls fails with a MariaDB SQL syntax error at GraphQL /segmentList. Locally, the failure occurs when there are no collected calls.
Environment
- OAP image: apache/skywalking-oap-server:11.1.0
- Horizon image: ghcr.io/apache/skywalking-horizon-ui:1.1.0
- Storage: MariaDB, SW_STORAGE=mysql
- MySQL Connector/J: 8.4.0
What you expected to happen
A profiling task with no sampled segments should return an empty list, allowing the UI to display no data, without executing invalid SQL.
How to reproduce
- Run OAP with JDBC/MySQL storage backed by MariaDB.
- Create a trace profiling task for an instrumented service.
- Do not generate matching calls / collected profiling segments.
- Open the task segment list in Horizon Trace Profiling (GraphQL getProfileTaskSegments).
- Observe the SQLSyntaxErrorException at /segmentList.
Anything else
Observed OAP stack trace
Exception while fetching data (/segmentList): java.sql.SQLSyntaxErrorException:
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version
for the right syntax to use near ')' at line 1
at org.apache.skywalking.oap.server.library.client.jdbc.hikaricp.JDBCClient.executeQuery(JDBCClient.java:118)
at org.apache.skywalking.oap.server.storage.plugin.jdbc.common.dao.JDBCTraceQueryDAO.queryBySegmentIdList(JDBCTraceQueryDAO.java:265)
at org.apache.skywalking.oap.server.core.profiling.trace.ProfileTaskQueryService.getTaskSegments(ProfileTaskQueryService.java:202)
at org.apache.skywalking.oap.server.core.profiling.trace.ProfileTaskQueryService.getProfileTaskSegments(ProfileTaskQueryService.java:207)
at org.apache.skywalking.oap.query.graphql.resolver.ProfileQuery.lambda$getProfileTaskSegments$2(ProfileQuery.java:66)
Suspected cause: an empty segment ID collection reaches queryBySegmentIdList and produces an empty IN () predicate. The full generated SQL was not captured, so this SQL shape is an inference from the trigger and stack trace. Please check empty-list handling and add an empty-collection regression test.
Searched existing issues for segmentList + syntax and queryBySegmentIdList + empty. #14172 concerns profiling records disappearing with BanyanDB; this report concerns a JDBC/MariaDB syntax error. No local OAP code modification has been applied.
Are you willing to submit a pull request to fix on your own?
- Yes I am willing to submit a pull request on my own!
Code of Conduct
- I agree to follow this project's Code of Conduct
- 主要言語
- Java
- スター
- 25k
- フォーク
- 6.6k
- 平均マージ
- 12時間 1分
- マージ済み PR(30日)
- 43
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/skywalking のほかの issue
-
AI Assistant database enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 24/100
apache/skywalking#14237 ·
メンテナーはふだん 1 日以内に返信
-
database enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
apache/skywalking#14236 ·
メンテナーはふだん 1 日以内に返信
-
AI Assistant database enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
apache/skywalking#14235 ·
メンテナーはふだん 1 日以内に返信
-
database enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
apache/skywalking#14234 ·
メンテナーはふだん 1 日以内に返信
-
database enhancement query tracing
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
apache/skywalking#14233 ·
メンテナーはふだん 1 日以内に返信
apache/skywalking の issue をすべて見る
似ている issue
-
Re-executed query with IN condition on an index column returns deleted rows (stale IndexCursor)対応中かも @dbusche が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
h2database/h2database#4580 ·
メンテナーはふだん 1 日以内に返信
-
vips-drift
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
Stirling-Tools/JPDFium#300 ·
メンテナーはふだん 1 日以内に返信
-
hermes-queue
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
chrisalunlloyd2-sudo/mindpalace#403 ·
メンテナーはふだん 1 日以内に返信
-
Guidelines: document how to build a use case against a local, unpublished Flow/browserless-test change対応中かも @totally-not-ai が今日担当しました。 オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
vaadin/use-cases#452 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area/storage area/storage/sql
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Apicurio/apicurio-registry#11159 ·
メンテナーはふだん 1 日以内に返信