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

ui: fix statement diag reports when min exec latency is null #139342

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

kyle-a-wong
Copy link
Contributor

A bug in db console was resulting in statement diagnostics reports to not work as intended. As a result, activating diagnostics didn't result in the intended state change which showed a user that a diagnostics report is running or downloadble.

This was happening in edge cases where reports "minExecutionLatency" response field was null, but the db console expected it to be populated. Now, db console should handle this edge case.

Fixes: #139340
Epic: none
Release note (bug fix): Fixes a bug where sometimes activating diagnostics for sql activity appears unresponsive, with no state or status update upon activating. Now, the status should always reflect that diagnosticsa are active or that a statement bundle is downloadable.

@kyle-a-wong kyle-a-wong requested a review from a team as a code owner January 17, 2025 16:54
@kyle-a-wong kyle-a-wong requested review from xinhaoz and removed request for a team January 17, 2025 16:54
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@kyle-a-wong
Copy link
Contributor Author

@kyle-a-wong kyle-a-wong added backport-24.3.x Flags PRs that need to be backported to 24.3 backport-25.1.x Flags PRs that need to be backported to 25.1 labels Jan 17, 2025
Copy link
Member

@xinhaoz xinhaoz left a comment

Choose a reason for hiding this comment

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

TY for fixing! Can you also add to the stmt diags cypress test so we can catch this whenn we eventually enable the test on the roachprod cypress tests?

This bug is very interesting because the API has always returned "0s" when the min_execution_latency col is null. I wonder if something else changed recently in how we decode the protobuf to js.

@kyle-a-wong
Copy link
Contributor Author

TY for fixing! Can you also add to the stmt diags cypress test so we can catch this whenn we eventually enable the test on the roachprod cypress tests?

Good idea, I'll add this as a separate PR, since it doesn't need to be back ported.

This bug is very interesting because the API has always returned "0s" when the min_execution_latency col is null. I wonder if something else changed recently in how we decode the protobuf to js.

Yeah that's still unclear to me. I'm working on identifying when this started happening

A bug in db console was resulting in statement diagnostics
reports to not work as intended. As a result, activating
diagnostics didn't result in the intended state change which
showed a user that a diagnostics report is running or downloadble.

This was happening in edge cases where reports "minExecutionLatency"
response field was null, but the db console expected it to be populated.
Now, db console should handle this edge case.

This commit also adds nanosecond granularity to the returned
StatementDiagnosticsResponse.min_execution_latency field. Previously only
the seconds portion of the statement's min_execution_latency was
converted into the returned objects duration, but often times this
latency will be sub 1 second, resulting in "O" to be returned.

Fixes: cockroachdb#139340
Epic: none
Release note (bug fix): Fixes a bug where sometimes activating
diagnostics for sql activity appears unresponsive, with no
state or status update upon activating. Now, the status should
always reflect that diagnosticsa are active or that a statement
bundle is downloadable.
@kyle-a-wong
Copy link
Contributor Author

TFTR

bors r+

craig bot pushed a commit that referenced this pull request Jan 22, 2025
139342: ui: fix statement diag reports when min exec latency is null r=kyle-a-wong a=kyle-a-wong

A bug in db console was resulting in statement diagnostics reports to not work as intended. As a result, activating diagnostics didn't result in the intended state change which showed a user that a diagnostics report is running or downloadble.

This was happening in edge cases where reports "minExecutionLatency" response field was null, but the db console expected it to be populated. Now, db console should handle this edge case.

Fixes: #139340
Epic: none
Release note (bug fix): Fixes a bug where sometimes activating diagnostics for sql activity appears unresponsive, with no state or status update upon activating. Now, the status should always reflect that diagnosticsa are active or that a statement bundle is downloadable.

139487: crosscluster/logical: permanent job errors should fail LDR job r=kev-cao a=msbutler

Previously, permanent job errors would pause the LDR job, like PCR. Since LDR
doesn't have a cutover step, we should instead fail the job to provide a
clearer UX to the user.

Epic: none

Release note: none

139491: crosscluster/physical: wait for sip shutdown before cutover r=kev-cao a=msbutler

Informs #136588

Release note: none

Co-authored-by: Kyle Wong <[email protected]>
Co-authored-by: Michael Butler <[email protected]>
@craig
Copy link
Contributor

craig bot commented Jan 22, 2025

Build failed (retrying...):

@kyle-a-wong
Copy link
Contributor Author

bors retry

@craig
Copy link
Contributor

craig bot commented Jan 22, 2025

Already running a review

@craig craig bot merged commit 6652998 into cockroachdb:master Jan 22, 2025
22 checks passed
Copy link

blathers-crl bot commented Jan 22, 2025

Based on the specified backports for this PR, I applied new labels to the following linked issue(s). Please adjust the labels as needed to match the branches actually affected by the issue(s), including adding any known older branches.


Issue #139340: branch-release-24.3, branch-release-25.1.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@kyle-a-wong
Copy link
Contributor Author

After investigation, it was determined that this issue was caused as a result of this PR: #137479, where a change was introduced to not serialize zero-valued durations. This results in the decoding of the duration field to be null on the client side

@kyle-a-wong kyle-a-wong deleted the fix_statement_bundle branch January 23, 2025 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-24.3.x Flags PRs that need to be backported to 24.3 backport-25.1.x Flags PRs that need to be backported to 25.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI: statement bundle silently fails when min_execution_latency is null
4 participants