Skip to content

ui: fix txn aggregations in txns fingerprints page#98307

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
xinhaoz:fix-txn-agg
Mar 9, 2023
Merged

ui: fix txn aggregations in txns fingerprints page#98307
craig[bot] merged 1 commit intocockroachdb:masterfrom
xinhaoz:fix-txn-agg

Conversation

@xinhaoz
Copy link
Copy Markdown
Contributor

@xinhaoz xinhaoz commented Mar 9, 2023

This commit addresses 2 issues on the txns overview page:

  1. We were previously grouping txns by txn fingerprint id, agg time, agg interval, and app name. This is from a time when we wanted all these fields, but recently we only want to aggregate on txn fingerprint id.
    This commit changes the grouping to only the txn id.

  2. Stats aggregation causing undesired data mutations: We were seeing that in the txns fingerprint page,
    stats columns would seemingly randomly continue to increase while on the page (e.g. exec count, bytes read). During stats aggregation after grouping by
    the fields mentioned above, we were using the first txn in the grouping as the base object for stats
    aggregation, meaning we inherited and mutated the stats object of that txn. Since we aggregate on every re-render, This meant that we were using the result of any previous aggregations as the base for our current aggregation in the re-render. This explains the never-ending incrementing stats. This commit addresses this bug by ensuring we don't re-use the stats object between re-renders by creating a new copy of the stats for every aggregation.

Fixes: #96186
Fixes: #68375

Release note (bug fix): stats columns in txns fingerprint overview page does not continuously increment

BEFORE
https://www.loom.com/share/d9bbd98ced2742dd899031fbc16df6af

AFTER
https://www.loom.com/share/5407fbbad086404c8d9d63e7f5ef15dd

@xinhaoz xinhaoz requested a review from a team March 9, 2023 16:29
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@xinhaoz
Copy link
Copy Markdown
Contributor Author

xinhaoz commented Mar 9, 2023

Something else I noticed that applies to both stmts (and now txns) - we never properly aggregated the different app names now that we're only grouping by the fingerprint ids. I will make a follow-up issue to track that.

@xinhaoz xinhaoz requested a review from a team March 9, 2023 16:30
@xinhaoz xinhaoz requested a review from ericharmeling March 9, 2023 16:33
Copy link
Copy Markdown

@ericharmeling ericharmeling left a comment

Choose a reason for hiding this comment

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

Nice! Thank you!

@ericharmeling
Copy link
Copy Markdown

(This should also fix #68375.)

This commit addresses 2 issues on the txns overview page:
1. We were previously grouping txns by txn fingerprint
id, agg time, agg interval, and app name. This is from
a time when we wanted all these fields, but recently
we only want to aggregate on txn fingerprint id.
This commit changes the grouping to only the txn id.

2. Stats aggregation causing undesired data mutations:
We were seeing that in the txns fingerprint page,
stats columns would seemingly randomly continue to
increase while on the page (e.g. exec count, bytes
read). During stats aggregation after grouping by
the fields mentioned above, we were using the first
txn in the grouping  as the base object for stats
aggregation, meaning we inherited and mutated the
stats object of that txn. Since we aggregate on
every re-render, This meant that we were using the
result of any previous aggregations as the base for our
current aggregation in the re-render. This explains
the never-ending incrementing stats. This commit
addresses this bug by ensuring we don't re-use the
stats object between re-renders by creating a new copy
of the stats for every aggregation.

Fixes: cockroachdb#96186
Fixes: cockroachdb#68375

Release note (bug fix): stats columns in txns fingerprint overview
page does not continuously increment
@xinhaoz
Copy link
Copy Markdown
Contributor Author

xinhaoz commented Mar 9, 2023

TFTR!
bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Mar 9, 2023

Build failed (retrying...):

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Mar 9, 2023

Build succeeded:

@craig craig bot merged commit 6f444d4 into cockroachdb:master Mar 9, 2023
@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Mar 9, 2023

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

You might need to create your backport manually using the backport tool.


error creating merge commit from a59d6b6 to blathers/backport-release-22.1-98307: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 22.1.x failed. See errors above.


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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants