Repository navigation
Handle empty JDBC trace profile segment lists - #14242
Merged
wu-sheng merged 2 commits intoNov 17, 2026
Merged
Conversation
wu-sheng
added a commit
that referenced
this pull request
Nov 17, 2026
…t the JDBC DAOs on PostgreSQL and MariaDB JDBC storage fixes, each proven by a new IT or unit test that fails on the previous code: - Empty lists: the continuous profiling targets and the eBPF profiling data built `in ()`, an SQL syntax error on MySQL, MariaDB and PostgreSQL; an empty list now reads nothing. The segment lookup by trace and instance gets the guard #14242 added to the lookup by segment ID. - Queries across day tables: the trace list pages, the Zipkin search limit and traces split at midnight, heatmap columns, Top N (ranked by the exact mean of the whole range, values above the int range), slow statements, tag autocomplete limits, the async-profiler, pprof and trace profiling task lists, and the instances of every day table. - Trace profiling: Go thread snapshots read as Java, and a day table without a segment's snapshots read as sequence 0. - The process list of an agent ignored the ping time range; browser error logs failed without a time range; events filtered by layer failed on PostgreSQL, and an event at a time range's first millisecond was left out. - UI templates: the lookup by ID missed every template, so disabling one failed, and changing a missing one reported success. - A zero-row UPDATE did not drop the metric from OAP's cache, so later flushes kept updating its missing row. The failure callback now drops it, and a later flush inserts the row again. - The boot table check logged wrong table and column states. Async-profiler fixes in shared OAP core: - On JDBC and Elasticsearch, the check refusing a second task on a service compared a minute bucket with the tasks' second buckets and never found the running task. It now uses a second bucket. - A cache refresh could keep the older of two recent tasks for the agent. Tests and CI: - New JDBC storage ITs on PostgreSQL 13 and MariaDB 11.4 (Testcontainers), 40 cases on each, run in the default Integration test job. MariaDB Connector/J (LGPL) is a test-scope dependency only. - The Zipkin and span-attached event ITs of the Elasticsearch storage also carry `@Tag("elastic-it")` and run as one slow-IT matrix entry.
3 of 4 tasks
wu-sheng
added a commit
that referenced
this pull request
Nov 17, 2026
…t the JDBC DAOs on PostgreSQL and MariaDB JDBC storage fixes, each proven by a new IT or unit test that fails on the previous code: - Empty lists: the continuous profiling targets and the eBPF profiling data built `in ()`, an SQL syntax error on MySQL, MariaDB and PostgreSQL; an empty list now reads nothing. The segment lookup by trace and instance gets the guard #14242 added to the lookup by segment ID. - Queries across day tables: the trace list pages, the Zipkin search limit and traces split at midnight, heatmap columns, Top N (ranked by the exact mean of the whole range, values above the int range), slow statements, tag autocomplete limits, the async-profiler, pprof and trace profiling task lists, and the instances of every day table. - Trace profiling: Go thread snapshots read as Java, and a day table without a segment's snapshots read as sequence 0. - The process list of an agent ignored the ping time range; browser error logs failed without a time range; events filtered by layer failed on PostgreSQL, and an event at a time range's first millisecond was left out. - UI templates: the lookup by ID missed every template, so disabling one failed, and changing a missing one reported success. - A zero-row UPDATE did not drop the metric from OAP's cache, so later flushes kept updating its missing row. The failure callback now drops it, and a later flush inserts the row again. - The boot table check logged wrong table and column states. Async-profiler fixes in shared OAP core: - On JDBC and Elasticsearch, the check refusing a second task on a service compared a minute bucket with the tasks' second buckets and never found the running task. It now uses a second bucket. - A cache refresh could keep the older of two recent tasks for the agent. Tests and CI: - New JDBC storage ITs on PostgreSQL 13 and MariaDB 11.4 (Testcontainers), 40 cases on each, run in the default Integration test job. MariaDB Connector/J (LGPL) is a test-scope dependency only. - The Zipkin and span-attached event ITs of the Elasticsearch storage also carry `@Tag("elastic-it")` and run as one slow-IT matrix entry.
wu-sheng
added a commit
that referenced
this pull request
Nov 17, 2026
…t the JDBC DAOs on PostgreSQL and MariaDB (#14243) JDBC storage fixes, each proven by a new IT or unit test that fails on the previous code: - Empty lists: the continuous profiling targets and the eBPF profiling data built `in ()`, an SQL syntax error on MySQL, MariaDB and PostgreSQL; an empty list now reads nothing. The segment lookup by trace and instance gets the guard #14242 added to the lookup by segment ID. - Queries across day tables: the trace list pages, the Zipkin search limit and traces split at midnight, heatmap columns, Top N (ranked by the exact mean of the whole range, values above the int range), slow statements, tag autocomplete limits, the async-profiler, pprof and trace profiling task lists, and the instances of every day table. - Trace profiling: Go thread snapshots read as Java, and a day table without a segment's snapshots read as sequence 0. - The process list of an agent ignored the ping time range; browser error logs failed without a time range; events filtered by layer failed on PostgreSQL, and an event at a time range's first millisecond was left out. - UI templates: the lookup by ID missed every template, so disabling one failed, and changing a missing one reported success. - A zero-row UPDATE did not drop the metric from OAP's cache, so later flushes kept updating its missing row. The failure callback now drops it, and a later flush inserts the row again. - The boot table check logged wrong table and column states. Async-profiler fixes in shared OAP core: - On JDBC and Elasticsearch, the check refusing a second task on a service compared a minute bucket with the tasks' second buckets and never found the running task. It now uses a second bucket. - A cache refresh could keep the older of two recent tasks for the agent. Tests and CI: - New JDBC storage ITs on PostgreSQL 13 and MariaDB 11.4 (Testcontainers), 40 cases on each, run in the default Integration test job. MariaDB Connector/J (LGPL) is a test-scope dependency only. - The Zipkin and span-attached event ITs of the Elasticsearch storage also carry `@Tag("elastic-it")` and run as one slow-IT matrix entry.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #14239
queryBySegmentIdListbuilds its SQLINplaceholders by joining the provided segment IDs. When the list is empty, that produces an invalid emptyIN ()predicate. Return an empty result before building or executing the JDBC query; non-empty query behavior stays unchanged.CHANGESlog.Validation
.\mvnw.cmd -B -q -pl oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin "-Dcheckstyle.skip=true" "-Dtest=JDBCTraceQueryDAOTest" test: BUILD SUCCESS, 5 tests, 0 failures/errors/skips..\mvnw.cmd -B -q clean checkstyle:check: passed..\mvnw.cmd clean flatten:flatten install javadoc:javadoc -B -q -Pall "-Dmaven.test.skip=true" "-Dcheckstyle.skip=true" "-Dgpg.skip=true": completed successfully; only existing JDK/Lombok deprecation warnings.git diff --check: passed.A live MariaDB reproduction and the full test suite were not run; the regression test verifies that an empty input returns an empty result without invoking the JDBC client. The reported
IN ()shape is inferred from the current query-building code; the issue reporter did not capture the generated SQL.